forked from Dosugamea/NEXT-OCS-API-forPy
-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathapps.py
More file actions
50 lines (40 loc) · 1.1 KB
/
apps.py
File metadata and controls
50 lines (40 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# -*- coding: utf-8 -*-
from nextcloud.base import WithRequester, OCSMRD
class Apps(WithRequester):
API_URL = "/ocs/v1.php/cloud/apps"
SUCCESS_CODE = 100
@OCSMRD("apps", "apps")
def get_apps(self, filter=None):
"""
Get a list of apps installed on the Nextcloud server
:param filter: str, optional "enabled" or "disabled"
:return:
"""
params = {
"filter": filter
}
return self.requester.get(params=params)
@OCSMRD("app")
def get_app(self, app_id):
"""
Provide information on a specific application
:param app_id: str, app id
:return:
"""
return self.requester.get(app_id)
@OCSMRD()
def enable_app(self, app_id):
"""
Enable an app
:param app_id: str, app id
:return:
"""
return self.requester.post(app_id)
@OCSMRD()
def disable_app(self, app_id):
"""
Disable the specified app
:param app_id: str, app id
:return:
"""
return self.requester.delete(app_id)