| 1 |
# Copyright (C) 2016 Catalyst IT Ltd |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 |
# not use this file except in compliance with the License. You may obtain |
| 5 |
# a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 |
# License for the specific language governing permissions and limitations |
| 13 |
# under the License. |
| 14 |
|
| 15 |
from adjutantclient.common import http |
| 16 |
from adjutantclient.v1 import notifications |
| 17 |
from adjutantclient.v1 import quota |
| 18 |
from adjutantclient.v1 import roles |
| 19 |
from adjutantclient.v1 import signup |
| 20 |
from adjutantclient.v1 import status |
| 21 |
from adjutantclient.v1 import tasks |
| 22 |
from adjutantclient.v1 import tokens |
| 23 |
from adjutantclient.v1 import users |
| 24 |
|
| 25 |
|
| 26 |
class Client(object): |
| 27 |
"""Client for the Adjutant v1 API. |
| 28 |
|
| 29 |
:param string endpoint: A user-supplied endpoint URL for the adjutant |
| 30 |
service. |
| 31 |
:param string token: Token for authentication. |
| 32 |
:param integer timeout: Allows customization of the timeout for client |
| 33 |
http requests. (optional) |
| 34 |
""" |
| 35 |
|
| 36 |
def __init__(self, *args, **kwargs): |
| 37 |
"""Initialize a new client for the Adjutant v1 API.""" |
| 38 |
self.http_client = http._construct_http_client(*args, **kwargs) |
| 39 |
|
| 40 |
self.users = users.UserManager(self.http_client) |
| 41 |
self.user_roles = roles.UserRoleManager(self.http_client) |
| 42 |
self.managed_roles = roles.ManagedRoleManager(self.http_client) |
| 43 |
self.tokens = tokens.TokenManager(self.http_client) |
| 44 |
self.tasks = tasks.TaskManager(self.http_client) |
| 45 |
self.signup = signup.SignupManager(self.http_client) |
| 46 |
self.notifications = notifications.NotificationManager( |
| 47 |
self.http_client) |
| 48 |
self.status = status.StatusManager(self.http_client) |
| 49 |
self.quota = quota.QuotaManager(self.http_client) |