Compare commits

..

3 Commits

Author SHA1 Message Date
7735e6b4ac admin: Return the user after creation
Some checks failed
continuous-integration/drone/tag Build is failing
2023-04-13 17:14:57 +02:00
5bef97dedf provider: Fix property retrieval 2023-04-13 17:14:35 +02:00
241d9ff3c2 api: Introduce a new method to retrieve a complete Provider 2023-04-13 17:14:15 +02:00
3 changed files with 13 additions and 3 deletions

View File

@ -39,7 +39,7 @@ class Admin:
u = AuthUser(self, **r.json())
u.Password = u.ResetPassword(password)
return
return u
def authuser_delete(self, Id):
r = self.session.delete("http+unix://" + self.socket_path + "/api/auth/" + quote_plus(Id))

View File

@ -74,6 +74,16 @@ class HappyDomain:
return ret
def provider_get(self, id):
r = self.session.get(
self.baseurl + "/api/providers/" + quote_plus(id),
)
if r.status_code != 200:
raise HappyError(r.status_code, **r.json())
return Provider(self, **r.json())
def provider_add(self, type, name, data):
r = self.session.post(
self.baseurl + "/api/providers",

View File

@ -6,14 +6,14 @@ from .domain import Domain
class Provider:
def __init__(self, _session, _srctype, _id, _ownerid, _comment, **kwargs):
def __init__(self, _session, _srctype, _id, _ownerid, _comment, Provider={}):
self._session = _session
self._srctype = _srctype
self._id = _id
self._ownerid = _ownerid
self._comment = _comment
self.args = kwargs
self.args = Provider
def _dumps(self):
return json.dumps({