-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathUserManagerAPI.py
More file actions
27 lines (22 loc) · 914 Bytes
/
Copy pathUserManagerAPI.py
File metadata and controls
27 lines (22 loc) · 914 Bytes
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
"""
"""
from BasicAPI import *
from RequestData import *
class UserManagerAPI(BasicAPI):
def __init__(self, format):
BasicAPI.__init__(self, format, app='usermanager')
self.sec = True
def add_user(self, userConfig):
self.uri = '/' + self.app + '/users'
self.method = 'POST'
self.data = userConfig
self.headers = {'Accept': 'application/' + self.format,
'Content-type': 'application/' + self.format
}
return RequestData(uri=self.uri, method=self.method, data=self.data, headers=self.headers, sec=self.sec)
def del_user(self, userName):
self.uri = '/' + self.app + '/users/' + userName
self.method = 'DELETE'
self.data = None
self.headers = {'Accept': 'application/' + self.format}
return RequestData(uri=self.uri, method=self.method, data=self.data, headers=self.headers, sec=self.sec)