yellowdog-sdk 9.1.2__py3-none-any.whl → 9.1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- yellowdog_client/_version.py +1 -1
- yellowdog_client/account/__init__.py +6 -0
- yellowdog_client/account/account_client.py +119 -0
- yellowdog_client/account/account_client_impl.py +125 -0
- yellowdog_client/account/account_service_proxy.py +121 -0
- yellowdog_client/platform_client.py +8 -2
- {yellowdog_sdk-9.1.2.dist-info → yellowdog_sdk-9.1.4.dist-info}/METADATA +1 -1
- {yellowdog_sdk-9.1.2.dist-info → yellowdog_sdk-9.1.4.dist-info}/RECORD +11 -8
- {yellowdog_sdk-9.1.2.dist-info → yellowdog_sdk-9.1.4.dist-info}/WHEEL +1 -1
- {yellowdog_sdk-9.1.2.dist-info → yellowdog_sdk-9.1.4.dist-info}/licenses/LICENSE +0 -0
- {yellowdog_sdk-9.1.2.dist-info → yellowdog_sdk-9.1.4.dist-info}/top_level.txt +0 -0
yellowdog_client/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '9.1.
|
|
1
|
+
__version__ = '9.1.4' # YEL-13378
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
from .account_client import AccountClient
|
|
2
|
+
from .account_client_impl import AccountClientImpl
|
|
3
|
+
from .account_service_proxy import AccountServiceProxy
|
|
1
4
|
from .keyring_client_impl import KeyringClientImpl
|
|
2
5
|
from .keyring_service_proxy import KeyringServiceProxy
|
|
3
6
|
from .keyring_client import KeyringClient
|
|
4
7
|
|
|
5
8
|
__all__ = [
|
|
9
|
+
"AccountClient",
|
|
10
|
+
"AccountClientImpl",
|
|
11
|
+
"AccountServiceProxy",
|
|
6
12
|
"KeyringClientImpl",
|
|
7
13
|
"KeyringServiceProxy",
|
|
8
14
|
"KeyringClient"
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from abc import ABC, abstractmethod
|
|
4
|
+
from typing import List
|
|
5
|
+
|
|
6
|
+
from yellowdog_client.common import Closeable, SearchClient
|
|
7
|
+
from yellowdog_client.model import AddApplicationRequest, AddApplicationResponse, AddGroupRequest, ApiKey, Application, ApplicationSearch, Group, GroupSearch, GroupSummary, PermissionDetail, Role, RoleSearch, UpdateApplicationRequest, UpdateGroupRequest, User, UserSearch
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AccountClient(ABC, Closeable):
|
|
11
|
+
"""The API interface exposed by the YellowDog Account Service"""
|
|
12
|
+
|
|
13
|
+
@abstractmethod
|
|
14
|
+
def get_user(self, user_id: str) -> User:
|
|
15
|
+
pass
|
|
16
|
+
|
|
17
|
+
@abstractmethod
|
|
18
|
+
def get_users(self, search: UserSearch) -> SearchClient[User]:
|
|
19
|
+
pass
|
|
20
|
+
|
|
21
|
+
@abstractmethod
|
|
22
|
+
def get_user_groups(self, user_id: str) -> SearchClient[GroupSummary]:
|
|
23
|
+
pass
|
|
24
|
+
|
|
25
|
+
@abstractmethod
|
|
26
|
+
def get_application(self, application_id: str) -> Application:
|
|
27
|
+
pass
|
|
28
|
+
|
|
29
|
+
@abstractmethod
|
|
30
|
+
def update_application(self, application_id: str, request: UpdateApplicationRequest) -> Application:
|
|
31
|
+
pass
|
|
32
|
+
|
|
33
|
+
@abstractmethod
|
|
34
|
+
def add_application(self, request: AddApplicationRequest) -> AddApplicationResponse:
|
|
35
|
+
pass
|
|
36
|
+
|
|
37
|
+
@abstractmethod
|
|
38
|
+
def regenerate_application_api_key(self, application_id: str) -> ApiKey:
|
|
39
|
+
pass
|
|
40
|
+
|
|
41
|
+
@abstractmethod
|
|
42
|
+
def get_applications(self, search: ApplicationSearch) -> SearchClient[Application]:
|
|
43
|
+
pass
|
|
44
|
+
|
|
45
|
+
@abstractmethod
|
|
46
|
+
def get_application_groups(self, application_id: str) -> SearchClient[GroupSummary]:
|
|
47
|
+
pass
|
|
48
|
+
|
|
49
|
+
@abstractmethod
|
|
50
|
+
def delete_application(self, application_id: str) -> None:
|
|
51
|
+
pass
|
|
52
|
+
|
|
53
|
+
@abstractmethod
|
|
54
|
+
def list_permissions(self) -> List[PermissionDetail]:
|
|
55
|
+
pass
|
|
56
|
+
|
|
57
|
+
@abstractmethod
|
|
58
|
+
def get_role(self, role_id: str) -> Role:
|
|
59
|
+
pass
|
|
60
|
+
|
|
61
|
+
@abstractmethod
|
|
62
|
+
def get_roles(self, search: RoleSearch) -> SearchClient[Role]:
|
|
63
|
+
pass
|
|
64
|
+
|
|
65
|
+
@abstractmethod
|
|
66
|
+
def get_role_groups(self, role_id: str) -> SearchClient[GroupSummary]:
|
|
67
|
+
pass
|
|
68
|
+
|
|
69
|
+
@abstractmethod
|
|
70
|
+
def get_group(self, group_id: str) -> Group:
|
|
71
|
+
pass
|
|
72
|
+
|
|
73
|
+
@abstractmethod
|
|
74
|
+
def add_group(self, request: AddGroupRequest) -> Group:
|
|
75
|
+
pass
|
|
76
|
+
|
|
77
|
+
@abstractmethod
|
|
78
|
+
def update_group(self, group_id: str, request: UpdateGroupRequest) -> Group:
|
|
79
|
+
pass
|
|
80
|
+
|
|
81
|
+
@abstractmethod
|
|
82
|
+
def get_group_users(self, group_id: str) -> SearchClient[User]:
|
|
83
|
+
pass
|
|
84
|
+
|
|
85
|
+
@abstractmethod
|
|
86
|
+
def get_group_applications(self, group_id: str) -> SearchClient[Application]:
|
|
87
|
+
pass
|
|
88
|
+
|
|
89
|
+
@abstractmethod
|
|
90
|
+
def get_groups(self, search: GroupSearch) -> SearchClient[GroupSummary]:
|
|
91
|
+
pass
|
|
92
|
+
|
|
93
|
+
@abstractmethod
|
|
94
|
+
def add_user_to_group(self, group_id: str, user_id: str) -> None:
|
|
95
|
+
pass
|
|
96
|
+
|
|
97
|
+
@abstractmethod
|
|
98
|
+
def add_application_to_group(self, group_id: str, application_id: str) -> None:
|
|
99
|
+
pass
|
|
100
|
+
|
|
101
|
+
@abstractmethod
|
|
102
|
+
def add_role_to_group(self, group_id: str, role_id: str) -> None:
|
|
103
|
+
pass
|
|
104
|
+
|
|
105
|
+
@abstractmethod
|
|
106
|
+
def remove_user_from_group(self, group_id: str, user_id: str) -> None:
|
|
107
|
+
pass
|
|
108
|
+
|
|
109
|
+
@abstractmethod
|
|
110
|
+
def remove_application_from_group(self, group_id: str, application_id: str) -> None:
|
|
111
|
+
pass
|
|
112
|
+
|
|
113
|
+
@abstractmethod
|
|
114
|
+
def remove_role_from_group(self, group_id: str, role_id: str) -> None:
|
|
115
|
+
pass
|
|
116
|
+
|
|
117
|
+
@abstractmethod
|
|
118
|
+
def delete_group(self, group_id: str) -> None:
|
|
119
|
+
pass
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
|
|
3
|
+
from yellowdog_client.account.account_client import AccountClient
|
|
4
|
+
from yellowdog_client.account.account_service_proxy import AccountServiceProxy
|
|
5
|
+
from yellowdog_client.common import SearchClient
|
|
6
|
+
from yellowdog_client.model import User, SliceReference, UserSearch, Slice, GroupSummary, Application, \
|
|
7
|
+
ApplicationSearch, UpdateApplicationRequest, AddApplicationResponse, AddApplicationRequest, ApiKey, \
|
|
8
|
+
PermissionDetail, Role, Group, AddGroupRequest, UpdateGroupRequest, GroupSearch, RoleSearch
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AccountClientImpl(AccountClient):
|
|
12
|
+
def __init__(self, service_proxy: AccountServiceProxy) -> None:
|
|
13
|
+
self.__service_proxy = service_proxy
|
|
14
|
+
|
|
15
|
+
def get_user(self, user_id: str) -> User:
|
|
16
|
+
return self.__service_proxy.get_user(user_id)
|
|
17
|
+
|
|
18
|
+
def get_users(self, search: UserSearch) -> SearchClient[User]:
|
|
19
|
+
def get_next_slice_function(slice_reference: SliceReference) -> Slice[User]:
|
|
20
|
+
return self.__service_proxy.search_users(search, slice_reference)
|
|
21
|
+
|
|
22
|
+
return SearchClient(get_next_slice_function)
|
|
23
|
+
|
|
24
|
+
def get_user_groups(self, user_id: str) -> SearchClient[GroupSummary]:
|
|
25
|
+
def get_next_slice_function(slice_reference: SliceReference) -> Slice[GroupSummary]:
|
|
26
|
+
return self.__service_proxy.list_user_groups(user_id, slice_reference)
|
|
27
|
+
|
|
28
|
+
return SearchClient(get_next_slice_function)
|
|
29
|
+
|
|
30
|
+
def get_application(self, application_id: str) -> Application:
|
|
31
|
+
return self.__service_proxy.get_application(application_id)
|
|
32
|
+
|
|
33
|
+
def update_application(self, application_id: str, request: UpdateApplicationRequest) -> Application:
|
|
34
|
+
return self.__service_proxy.update_application(application_id, request)
|
|
35
|
+
|
|
36
|
+
def add_application(self, request: AddApplicationRequest) -> AddApplicationResponse:
|
|
37
|
+
return self.__service_proxy.add_application(request)
|
|
38
|
+
|
|
39
|
+
def regenerate_application_api_key(self, application_id: str) -> ApiKey:
|
|
40
|
+
return self.__service_proxy.regenerate_application_api_key(application_id)
|
|
41
|
+
|
|
42
|
+
def get_applications(self, search: ApplicationSearch) -> SearchClient[Application]:
|
|
43
|
+
def get_next_slice_function(slice_reference: SliceReference) -> Slice[Application]:
|
|
44
|
+
return self.__service_proxy.search_applications(search, slice_reference)
|
|
45
|
+
|
|
46
|
+
return SearchClient(get_next_slice_function)
|
|
47
|
+
|
|
48
|
+
def get_application_groups(self, application_id: str) -> SearchClient[GroupSummary]:
|
|
49
|
+
def get_next_slice_function(slice_reference: SliceReference) -> Slice[GroupSummary]:
|
|
50
|
+
return self.__service_proxy.list_application_groups(application_id, slice_reference)
|
|
51
|
+
|
|
52
|
+
return SearchClient(get_next_slice_function)
|
|
53
|
+
|
|
54
|
+
def delete_application(self, application_id: str) -> None:
|
|
55
|
+
return self.__service_proxy.delete_application(application_id)
|
|
56
|
+
|
|
57
|
+
def list_permissions(self) -> List[PermissionDetail]:
|
|
58
|
+
return self.__service_proxy.list_permissions()
|
|
59
|
+
|
|
60
|
+
def get_role(self, role_id: str) -> Role:
|
|
61
|
+
return self.__service_proxy.get_role(role_id)
|
|
62
|
+
|
|
63
|
+
def get_roles(self, search: RoleSearch) -> SearchClient[Role]:
|
|
64
|
+
def get_next_slice_function(slice_reference: SliceReference) -> Slice[Role]:
|
|
65
|
+
return self.__service_proxy.search_roles(search, slice_reference)
|
|
66
|
+
|
|
67
|
+
return SearchClient(get_next_slice_function)
|
|
68
|
+
|
|
69
|
+
def get_role_groups(self, role_id: str) -> SearchClient[GroupSummary]:
|
|
70
|
+
def get_next_slice_function(slice_reference: SliceReference) -> Slice[GroupSummary]:
|
|
71
|
+
return self.__service_proxy.list_role_groups(role_id, slice_reference)
|
|
72
|
+
|
|
73
|
+
return SearchClient(get_next_slice_function)
|
|
74
|
+
|
|
75
|
+
def get_group(self, group_id: str) -> Group:
|
|
76
|
+
return self.__service_proxy.get_group(group_id)
|
|
77
|
+
|
|
78
|
+
def add_group(self, request: AddGroupRequest) -> Group:
|
|
79
|
+
return self.__service_proxy.add_group(request)
|
|
80
|
+
|
|
81
|
+
def update_group(self, group_id: str, request: UpdateGroupRequest) -> Group:
|
|
82
|
+
return self.__service_proxy.update_group(group_id, request)
|
|
83
|
+
|
|
84
|
+
def get_group_users(self, group_id: str) -> SearchClient[User]:
|
|
85
|
+
def get_next_slice_function(slice_reference: SliceReference) -> Slice[User]:
|
|
86
|
+
return self.__service_proxy.list_group_users(group_id, slice_reference)
|
|
87
|
+
|
|
88
|
+
return SearchClient(get_next_slice_function)
|
|
89
|
+
|
|
90
|
+
def get_group_applications(self, group_id: str) -> SearchClient[Application]:
|
|
91
|
+
def get_next_slice_function(slice_reference: SliceReference) -> Slice[Application]:
|
|
92
|
+
return self.__service_proxy.list_group_applications(group_id, slice_reference)
|
|
93
|
+
|
|
94
|
+
return SearchClient(get_next_slice_function)
|
|
95
|
+
|
|
96
|
+
def get_groups(self, search: GroupSearch) -> SearchClient[GroupSummary]:
|
|
97
|
+
def get_next_slice_function(slice_reference: SliceReference) -> Slice[GroupSummary]:
|
|
98
|
+
return self.__service_proxy.search_groups(search, slice_reference)
|
|
99
|
+
|
|
100
|
+
return SearchClient(get_next_slice_function)
|
|
101
|
+
|
|
102
|
+
def add_user_to_group(self, group_id: str, user_id: str) -> None:
|
|
103
|
+
return self.__service_proxy.add_user_to_group(group_id, user_id)
|
|
104
|
+
|
|
105
|
+
def add_application_to_group(self, group_id: str, application_id: str) -> None:
|
|
106
|
+
return self.__service_proxy.add_application_to_group(group_id, application_id)
|
|
107
|
+
|
|
108
|
+
def add_role_to_group(self, group_id: str, role_id: str) -> None:
|
|
109
|
+
return self.__service_proxy.add_role_to_group(group_id, role_id)
|
|
110
|
+
|
|
111
|
+
def remove_user_from_group(self, group_id: str, user_id: str) -> None:
|
|
112
|
+
return self.__service_proxy.remove_user_from_group(group_id, user_id)
|
|
113
|
+
|
|
114
|
+
def remove_application_from_group(self, group_id: str, application_id: str) -> None:
|
|
115
|
+
return self.__service_proxy.remove_application_from_group(group_id, application_id)
|
|
116
|
+
|
|
117
|
+
def remove_role_from_group(self, group_id: str, role_id: str) -> None:
|
|
118
|
+
return self.__service_proxy.remove_role_from_group(group_id, role_id)
|
|
119
|
+
|
|
120
|
+
def delete_group(self, group_id: str) -> None:
|
|
121
|
+
return self.__service_proxy.delete_group(group_id)
|
|
122
|
+
|
|
123
|
+
def close(self):
|
|
124
|
+
# Has no closing resources
|
|
125
|
+
pass
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
|
|
3
|
+
from yellowdog_client.common import Proxy
|
|
4
|
+
from yellowdog_client.model import UserSearch, SliceReference, Slice, GroupSummary, Application, \
|
|
5
|
+
UpdateApplicationRequest, AddApplicationRequest, AddApplicationResponse, ApiKey, ApplicationSearch, \
|
|
6
|
+
PermissionDetail, \
|
|
7
|
+
Role, RoleSearch, Group, AddGroupRequest, UpdateGroupRequest, GroupSearch, User
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class AccountServiceProxy:
|
|
11
|
+
def __init__(self, proxy: Proxy) -> None:
|
|
12
|
+
self.proxy: Proxy = proxy.append_base_url("/account/")
|
|
13
|
+
|
|
14
|
+
def get_user(self, user_id: str) -> User:
|
|
15
|
+
return self.proxy.get(User, "users/%s" % user_id)
|
|
16
|
+
|
|
17
|
+
def search_users(self, search: UserSearch, slice_reference: SliceReference) -> Slice[User]:
|
|
18
|
+
return self.proxy.get(
|
|
19
|
+
Slice[User], "users",
|
|
20
|
+
self.proxy.to_params(search, slice_reference)
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
def list_user_groups(self, user_id: str, slice_reference: SliceReference) -> Slice[GroupSummary]:
|
|
24
|
+
return self.proxy.get(
|
|
25
|
+
Slice[GroupSummary], "users/%s/groups" % user_id,
|
|
26
|
+
self.proxy.to_params(slice_reference)
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
def get_application(self, application_id: str) -> Application:
|
|
30
|
+
return self.proxy.get(Application, "applications/%s" % application_id)
|
|
31
|
+
|
|
32
|
+
def update_application(self, application_id: str, request: UpdateApplicationRequest) -> Application:
|
|
33
|
+
return self.proxy.put(Application, request, "applications/%s" % application_id)
|
|
34
|
+
|
|
35
|
+
def add_application(self, request: AddApplicationRequest) -> AddApplicationResponse:
|
|
36
|
+
return self.proxy.post(AddApplicationResponse, request, "applications")
|
|
37
|
+
|
|
38
|
+
def regenerate_application_api_key(self, application_id: str) -> ApiKey:
|
|
39
|
+
return self.proxy.post(url="applications/%s/key" % application_id)
|
|
40
|
+
|
|
41
|
+
def search_applications(self, search: ApplicationSearch, slice_reference: SliceReference) -> Slice[Application]:
|
|
42
|
+
return self.proxy.get(
|
|
43
|
+
Slice[Application], "applications",
|
|
44
|
+
self.proxy.to_params(search, slice_reference)
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
def list_application_groups(self, application_id: str, slice_reference: SliceReference) -> Slice[GroupSummary]:
|
|
48
|
+
return self.proxy.get(
|
|
49
|
+
Slice[GroupSummary], "applications/%s/groups" % application_id,
|
|
50
|
+
self.proxy.to_params(slice_reference)
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
def delete_application(self, application_id: str) -> None:
|
|
54
|
+
return self.proxy.delete("applications/%s" % application_id)
|
|
55
|
+
|
|
56
|
+
def list_permissions(self) -> List[PermissionDetail]:
|
|
57
|
+
return self.proxy.get(List[PermissionDetail], "permissions")
|
|
58
|
+
|
|
59
|
+
def get_role(self, role_id: str) -> Role:
|
|
60
|
+
return self.proxy.get(Role, "roles/%s" % role_id)
|
|
61
|
+
|
|
62
|
+
def search_roles(self, search: RoleSearch, slice_reference: SliceReference) -> Slice[Role]:
|
|
63
|
+
return self.proxy.get(
|
|
64
|
+
Slice[Role], "roles",
|
|
65
|
+
self.proxy.to_params(search, slice_reference)
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
def list_role_groups(self, role_id: str, slice_reference: SliceReference) -> Slice[GroupSummary]:
|
|
69
|
+
return self.proxy.get(
|
|
70
|
+
Slice[GroupSummary], "roles/%s/groups" % role_id,
|
|
71
|
+
self.proxy.to_params(slice_reference)
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
def get_group(self, group_id: str) -> Group:
|
|
75
|
+
return self.proxy.get(Group, "groups/%s" % group_id)
|
|
76
|
+
|
|
77
|
+
def add_group(self, request: AddGroupRequest) -> Group:
|
|
78
|
+
return self.proxy.post(Group, request, "groups")
|
|
79
|
+
|
|
80
|
+
def update_group(self, group_id: str, request: UpdateGroupRequest) -> Group:
|
|
81
|
+
return self.proxy.put(Group, request, "groups/%s" % group_id)
|
|
82
|
+
|
|
83
|
+
def list_group_users(self, group_id: str, slice_reference: SliceReference) -> Slice[User]:
|
|
84
|
+
return self.proxy.get(
|
|
85
|
+
Slice[User], "groups/%s/users" % group_id,
|
|
86
|
+
self.proxy.to_params(slice_reference)
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
def list_group_applications(self, group_id: str, slice_reference: SliceReference) -> Slice[Application]:
|
|
90
|
+
return self.proxy.get(
|
|
91
|
+
Slice[Application], "groups/%s/applications" % group_id,
|
|
92
|
+
self.proxy.to_params(slice_reference)
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
def search_groups(self, search: GroupSearch, slice_reference: SliceReference) -> Slice[GroupSummary]:
|
|
96
|
+
return self.proxy.get(
|
|
97
|
+
Slice[GroupSummary], "groups",
|
|
98
|
+
self.proxy.to_params(search, slice_reference)
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
def add_user_to_group(self, group_id: str, user_id: str) -> None:
|
|
102
|
+
return self.proxy.put(url="groups/%s/users/%s" % (group_id, user_id))
|
|
103
|
+
|
|
104
|
+
def add_application_to_group(self, group_id: str, application_id: str) -> None:
|
|
105
|
+
return self.proxy.put(url="groups/%s/applications/%s" % (group_id, application_id))
|
|
106
|
+
|
|
107
|
+
def add_role_to_group(self, group_id: str, role_id: str) -> None:
|
|
108
|
+
return self.proxy.put(url="groups/%s/roles/%s" % (group_id, role_id))
|
|
109
|
+
|
|
110
|
+
def remove_user_from_group(self, group_id: str, user_id: str) -> None:
|
|
111
|
+
return self.proxy.delete("groups/%s/users/%s" % (group_id, user_id))
|
|
112
|
+
|
|
113
|
+
def remove_application_from_group(self, group_id: str, application_id: str) -> None:
|
|
114
|
+
return self.proxy.delete("groups/%s/applications/%s" % (group_id, application_id))
|
|
115
|
+
|
|
116
|
+
def remove_role_from_group(self, group_id: str, role_id: str) -> None:
|
|
117
|
+
return self.proxy.delete("groups/%s/roles/%s" % (group_id, role_id))
|
|
118
|
+
|
|
119
|
+
def delete_group(self, group_id: str) -> None:
|
|
120
|
+
return self.proxy.delete("groups/%s" % group_id)
|
|
121
|
+
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import sys
|
|
2
2
|
|
|
3
3
|
from ._version import __version__
|
|
4
|
-
from .account import KeyringClient, KeyringClientImpl, KeyringServiceProxy
|
|
4
|
+
from .account import KeyringClient, KeyringClientImpl, KeyringServiceProxy, AccountClientImpl, AccountServiceProxy
|
|
5
|
+
from .account.account_client import AccountClient
|
|
5
6
|
from .client_collection import ClientCollection
|
|
6
7
|
from .cloud_info import CloudInfoClient, CloudInfoClientImpl, CloudInfoProxy
|
|
7
8
|
from .common import Proxy, Closeable, UserAgent
|
|
@@ -26,6 +27,7 @@ class PlatformClient(Closeable):
|
|
|
26
27
|
|
|
27
28
|
def __init__(
|
|
28
29
|
self,
|
|
30
|
+
account_client: AccountClient,
|
|
29
31
|
keyring_client: KeyringClient,
|
|
30
32
|
compute_client: ComputeClient,
|
|
31
33
|
images_client: ImagesClient,
|
|
@@ -37,6 +39,8 @@ class PlatformClient(Closeable):
|
|
|
37
39
|
cloud_info_client: CloudInfoClient
|
|
38
40
|
) -> None:
|
|
39
41
|
self.__clients = ClientCollection()
|
|
42
|
+
self.account_client: AccountClient = self.__clients.add(account_client)
|
|
43
|
+
"""Account service client. Used for controlling accounts"""
|
|
40
44
|
self.compute_client: ComputeClient = self.__clients.add(compute_client)
|
|
41
45
|
"""Compute service client. Used for controlling compute requirements and instances"""
|
|
42
46
|
self.keyring_client: KeyringClient = self.__clients.add(keyring_client)
|
|
@@ -90,8 +94,9 @@ class PlatformClient(Closeable):
|
|
|
90
94
|
usage_url = services_schema.defaultUrl if services_schema.usageServiceUrl is None else services_schema.usageServiceUrl
|
|
91
95
|
cloud_info_url = services_schema.defaultUrl if services_schema.cloudInfoServiceUrl is None else services_schema.cloudInfoServiceUrl
|
|
92
96
|
|
|
93
|
-
|
|
97
|
+
account_client = AccountClientImpl(AccountServiceProxy(proxy.append_base_url(account_url)))
|
|
94
98
|
keyring_client = KeyringClientImpl(KeyringServiceProxy(proxy.append_base_url(account_url)))
|
|
99
|
+
compute_client = ComputeClientImpl(ComputeServiceProxy(proxy.append_base_url(compute_url)))
|
|
95
100
|
images_client = ImagesClientImpl(ImagesServiceProxy(proxy.append_base_url(images_url)))
|
|
96
101
|
namespaces_client = NamespacesClientImpl(NamespacesServiceProxy(proxy.append_base_url(scheduler_url)))
|
|
97
102
|
work_client = WorkClientImpl(WorkServiceProxy(proxy.append_base_url(scheduler_url)))
|
|
@@ -101,6 +106,7 @@ class PlatformClient(Closeable):
|
|
|
101
106
|
cloud_info_client = CloudInfoClientImpl(CloudInfoProxy(proxy.append_base_url(cloud_info_url)))
|
|
102
107
|
|
|
103
108
|
return PlatformClient(
|
|
109
|
+
account_client=account_client,
|
|
104
110
|
keyring_client=keyring_client,
|
|
105
111
|
compute_client=compute_client,
|
|
106
112
|
images_client=images_client,
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
yellowdog_client/__init__.py,sha256=xHGTw5UbjkeEl_hC8_gJCacfji6462qJWD1nvJdFssE,13162
|
|
3
|
-
yellowdog_client/_version.py,sha256=
|
|
3
|
+
yellowdog_client/_version.py,sha256=US9w_fiCtXDv8XAOOa8PKRWIKfxVYpZfB3aD9B_aH8w,34
|
|
4
4
|
yellowdog_client/client_collection.py,sha256=VSEzjf6iR1qCQ0YGLyDq_Kgvw8r832QDwTp6-MLB4Vs,388
|
|
5
|
-
yellowdog_client/platform_client.py,sha256=
|
|
6
|
-
yellowdog_client/account/__init__.py,sha256=
|
|
5
|
+
yellowdog_client/platform_client.py,sha256=yCzKsOQKllnfzwP9bG-JGtvOdvY7EaEQzFsgX3ERzVY,7476
|
|
6
|
+
yellowdog_client/account/__init__.py,sha256=DiLL3uSMyVlAKWsncX0k5Ioc2hw87HQoEkSYO0ro0fg,456
|
|
7
|
+
yellowdog_client/account/account_client.py,sha256=TRuWPcY4pyk78WXiLU_GOLTSHDhQcpppAGmzFlIPEXw,3398
|
|
8
|
+
yellowdog_client/account/account_client_impl.py,sha256=DUtybxZJpWkS8iyzidJ-veYb9V0iNmEKzB47TcrzzIc,6021
|
|
9
|
+
yellowdog_client/account/account_service_proxy.py,sha256=jHOsXRyNUKnoGYILoN-i1xIOmtpVu4OCK7IkoC8kkGY,5388
|
|
7
10
|
yellowdog_client/account/keyring_client.py,sha256=IFogh3LNNtL0cSbvbaEuhJ41UhtJbItyxm0AEnAaFMk,1125
|
|
8
11
|
yellowdog_client/account/keyring_client_impl.py,sha256=s_IltFtozR7lYdR9XNEZVj885pgJ0DoInv0B24GtblI,1665
|
|
9
12
|
yellowdog_client/account/keyring_service_proxy.py,sha256=8oK6lK3FxHOIbq--qcKSAd5bqkPGMN023CrX_Q8RKeI,1220
|
|
@@ -457,8 +460,8 @@ yellowdog_client/usage/__init__.py,sha256=XQwRJqTdxKZa1QUTsxBEL0TqQJeQHGyPklFeqc
|
|
|
457
460
|
yellowdog_client/usage/allowances_client.py,sha256=H6n63jXjT4OwuWJgFUXSjSmvGTZz9uspy3kj3upinaA,1337
|
|
458
461
|
yellowdog_client/usage/allowances_client_impl.py,sha256=nQPnSzJKhL3WvyCn5fmiDkwE84xZryH9YvV5Z1GjU4M,2061
|
|
459
462
|
yellowdog_client/usage/allowances_service_proxy.py,sha256=uO6LWnpjIzUcZTGdOxPXn7SyYX7NMRqO5KUiHUGr490,1320
|
|
460
|
-
yellowdog_sdk-9.1.
|
|
461
|
-
yellowdog_sdk-9.1.
|
|
462
|
-
yellowdog_sdk-9.1.
|
|
463
|
-
yellowdog_sdk-9.1.
|
|
464
|
-
yellowdog_sdk-9.1.
|
|
463
|
+
yellowdog_sdk-9.1.4.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
464
|
+
yellowdog_sdk-9.1.4.dist-info/METADATA,sha256=9TXYc5OO3HCDKtzDcak9zWRq_o9IzZky2NW6BbuMSCA,3238
|
|
465
|
+
yellowdog_sdk-9.1.4.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
|
|
466
|
+
yellowdog_sdk-9.1.4.dist-info/top_level.txt,sha256=6PH16DcoqpYHhQ5A0UJOjf0tg-1rTrNC9C2CLqCMuFo,26
|
|
467
|
+
yellowdog_sdk-9.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|