huaweicloudsdkram 3.1.160__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.
Files changed (100) hide show
  1. huaweicloudsdkram/__init__.py +0 -0
  2. huaweicloudsdkram/v1/__init__.py +96 -0
  3. huaweicloudsdkram/v1/model/__init__.py +93 -0
  4. huaweicloudsdkram/v1/model/accept_resource_share_invitation_request.py +144 -0
  5. huaweicloudsdkram/v1/model/accept_resource_share_invitation_response.py +112 -0
  6. huaweicloudsdkram/v1/model/associate_permission_req_body.py +143 -0
  7. huaweicloudsdkram/v1/model/associate_resource_share_permission_request.py +169 -0
  8. huaweicloudsdkram/v1/model/associate_resource_share_permission_response.py +85 -0
  9. huaweicloudsdkram/v1/model/associate_resource_share_request.py +169 -0
  10. huaweicloudsdkram/v1/model/associate_resource_share_response.py +112 -0
  11. huaweicloudsdkram/v1/model/associated_permission.py +260 -0
  12. huaweicloudsdkram/v1/model/batch_create_resource_share_tags_request.py +169 -0
  13. huaweicloudsdkram/v1/model/batch_create_resource_share_tags_response.py +85 -0
  14. huaweicloudsdkram/v1/model/batch_delete_resource_share_tags_request.py +169 -0
  15. huaweicloudsdkram/v1/model/batch_delete_resource_share_tags_response.py +85 -0
  16. huaweicloudsdkram/v1/model/create_resource_share_req_body.py +288 -0
  17. huaweicloudsdkram/v1/model/create_resource_share_request.py +141 -0
  18. huaweicloudsdkram/v1/model/create_resource_share_response.py +112 -0
  19. huaweicloudsdkram/v1/model/delete_resource_share_request.py +144 -0
  20. huaweicloudsdkram/v1/model/delete_resource_share_response.py +85 -0
  21. huaweicloudsdkram/v1/model/disable_organization_share_request.py +116 -0
  22. huaweicloudsdkram/v1/model/disable_organization_share_response.py +85 -0
  23. huaweicloudsdkram/v1/model/disassociate_permission_req_body.py +114 -0
  24. huaweicloudsdkram/v1/model/disassociate_resource_share_permission_request.py +169 -0
  25. huaweicloudsdkram/v1/model/disassociate_resource_share_permission_response.py +85 -0
  26. huaweicloudsdkram/v1/model/disassociate_resource_share_request.py +169 -0
  27. huaweicloudsdkram/v1/model/disassociate_resource_share_response.py +112 -0
  28. huaweicloudsdkram/v1/model/enable_organization_share_request.py +116 -0
  29. huaweicloudsdkram/v1/model/enable_organization_share_response.py +85 -0
  30. huaweicloudsdkram/v1/model/list_permission_versions_request.py +202 -0
  31. huaweicloudsdkram/v1/model/list_permission_versions_response.py +141 -0
  32. huaweicloudsdkram/v1/model/list_permissions_request.py +232 -0
  33. huaweicloudsdkram/v1/model/list_permissions_response.py +141 -0
  34. huaweicloudsdkram/v1/model/list_quota_request.py +116 -0
  35. huaweicloudsdkram/v1/model/list_quota_response.py +112 -0
  36. huaweicloudsdkram/v1/model/list_resource_share_permissions_request.py +231 -0
  37. huaweicloudsdkram/v1/model/list_resource_share_permissions_response.py +141 -0
  38. huaweicloudsdkram/v1/model/list_resource_share_tags_request.py +174 -0
  39. huaweicloudsdkram/v1/model/list_resource_share_tags_response.py +141 -0
  40. huaweicloudsdkram/v1/model/list_resource_shares_by_tags_request.py +199 -0
  41. huaweicloudsdkram/v1/model/list_resource_shares_by_tags_response.py +145 -0
  42. huaweicloudsdkram/v1/model/list_resource_types_request.py +174 -0
  43. huaweicloudsdkram/v1/model/list_resource_types_response.py +141 -0
  44. huaweicloudsdkram/v1/model/match.py +142 -0
  45. huaweicloudsdkram/v1/model/page_info.py +173 -0
  46. huaweicloudsdkram/v1/model/page_info_marker_by_key.py +173 -0
  47. huaweicloudsdkram/v1/model/permission.py +427 -0
  48. huaweicloudsdkram/v1/model/permission_summary.py +399 -0
  49. huaweicloudsdkram/v1/model/quota_resources_dto.py +114 -0
  50. huaweicloudsdkram/v1/model/quotas.py +226 -0
  51. huaweicloudsdkram/v1/model/reject_resource_share_invitation_request.py +144 -0
  52. huaweicloudsdkram/v1/model/reject_resource_share_invitation_response.py +112 -0
  53. huaweicloudsdkram/v1/model/resource_dto.py +198 -0
  54. huaweicloudsdkram/v1/model/resource_share.py +340 -0
  55. huaweicloudsdkram/v1/model/resource_share_association.py +340 -0
  56. huaweicloudsdkram/v1/model/resource_share_association_req_body.py +144 -0
  57. huaweicloudsdkram/v1/model/resource_share_invitation.py +318 -0
  58. huaweicloudsdkram/v1/model/resource_shares_by_tags_req_body.py +173 -0
  59. huaweicloudsdkram/v1/model/resource_types_summary.py +142 -0
  60. huaweicloudsdkram/v1/model/search_resource_share_associations_req_body.py +317 -0
  61. huaweicloudsdkram/v1/model/search_resource_share_associations_request.py +141 -0
  62. huaweicloudsdkram/v1/model/search_resource_share_associations_response.py +141 -0
  63. huaweicloudsdkram/v1/model/search_resource_share_count_by_tags_request.py +141 -0
  64. huaweicloudsdkram/v1/model/search_resource_share_count_by_tags_response.py +116 -0
  65. huaweicloudsdkram/v1/model/search_resource_share_invitation_req_body.py +231 -0
  66. huaweicloudsdkram/v1/model/search_resource_share_invitation_request.py +141 -0
  67. huaweicloudsdkram/v1/model/search_resource_share_invitation_response.py +137 -0
  68. huaweicloudsdkram/v1/model/search_resource_shares_req_body.py +317 -0
  69. huaweicloudsdkram/v1/model/search_resource_shares_request.py +141 -0
  70. huaweicloudsdkram/v1/model/search_resource_shares_response.py +141 -0
  71. huaweicloudsdkram/v1/model/search_shared_principals_req_body.py +259 -0
  72. huaweicloudsdkram/v1/model/search_shared_principals_request.py +141 -0
  73. huaweicloudsdkram/v1/model/search_shared_principals_response.py +141 -0
  74. huaweicloudsdkram/v1/model/search_shared_resources_req_body.py +346 -0
  75. huaweicloudsdkram/v1/model/search_shared_resources_request.py +141 -0
  76. huaweicloudsdkram/v1/model/search_shared_resources_response.py +141 -0
  77. huaweicloudsdkram/v1/model/shared_principal.py +202 -0
  78. huaweicloudsdkram/v1/model/shared_resource.py +260 -0
  79. huaweicloudsdkram/v1/model/show_organization_share_request.py +116 -0
  80. huaweicloudsdkram/v1/model/show_organization_share_response.py +116 -0
  81. huaweicloudsdkram/v1/model/show_permission_request.py +173 -0
  82. huaweicloudsdkram/v1/model/show_permission_response.py +112 -0
  83. huaweicloudsdkram/v1/model/tag.py +142 -0
  84. huaweicloudsdkram/v1/model/tag_dto.py +142 -0
  85. huaweicloudsdkram/v1/model/tag_filter.py +143 -0
  86. huaweicloudsdkram/v1/model/tag_resource_req_body.py +114 -0
  87. huaweicloudsdkram/v1/model/untag.py +143 -0
  88. huaweicloudsdkram/v1/model/untag_resource_req_body.py +114 -0
  89. huaweicloudsdkram/v1/model/update_resource_share_req_body.py +172 -0
  90. huaweicloudsdkram/v1/model/update_resource_share_request.py +169 -0
  91. huaweicloudsdkram/v1/model/update_resource_share_response.py +112 -0
  92. huaweicloudsdkram/v1/ram_async_client.py +1991 -0
  93. huaweicloudsdkram/v1/ram_client.py +1988 -0
  94. huaweicloudsdkram/v1/region/__init__.py +0 -0
  95. huaweicloudsdkram/v1/region/ram_region.py +31 -0
  96. huaweicloudsdkram-3.1.160.dist-info/LICENSE +13 -0
  97. huaweicloudsdkram-3.1.160.dist-info/METADATA +26 -0
  98. huaweicloudsdkram-3.1.160.dist-info/RECORD +100 -0
  99. huaweicloudsdkram-3.1.160.dist-info/WHEEL +5 -0
  100. huaweicloudsdkram-3.1.160.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1988 @@
1
+ # coding: utf-8
2
+
3
+ from __future__ import absolute_import
4
+
5
+ import importlib
6
+ import warnings
7
+
8
+ from huaweicloudsdkcore.client import Client, ClientBuilder
9
+ from huaweicloudsdkcore.utils import http_utils
10
+ from huaweicloudsdkcore.sdk_stream_request import SdkStreamRequest
11
+
12
+ try:
13
+ from huaweicloudsdkcore.invoker.invoker import SyncInvoker
14
+ except ImportError as e:
15
+ warnings.warn(str(e) + ", please check if you are using the same versions of 'huaweicloudsdkcore' and 'huaweicloudsdkram'")
16
+
17
+
18
+ class RamClient(Client):
19
+ def __init__(self):
20
+ super(RamClient, self).__init__()
21
+ self.model_package = importlib.import_module("huaweicloudsdkram.v1.model")
22
+
23
+ @classmethod
24
+ def new_builder(cls, clazz=None):
25
+ if not clazz:
26
+ client_builder = ClientBuilder(cls, "GlobalCredentials")
27
+ else:
28
+ if clazz.__name__ != "RamClient":
29
+ raise TypeError("client type error, support client type is RamClient")
30
+ client_builder = ClientBuilder(clazz, "GlobalCredentials")
31
+
32
+
33
+
34
+ return client_builder
35
+
36
+ def associate_resource_share_permission(self, request):
37
+ r"""绑定或替换共享资源权限
38
+
39
+ 为资源共享实例中包含的资源类型绑定或替换共享资源权限。 对于资源共享实例中的每一种资源类型,您可以设置唯一权限。仅当资源共享实例中当前没有该资源类型的资源时,您才能绑定新的共享资源权限。
40
+
41
+ Please refer to HUAWEI cloud API Explorer for details.
42
+
43
+ :param request: Request instance for AssociateResourceSharePermission
44
+ :type request: :class:`huaweicloudsdkram.v1.AssociateResourceSharePermissionRequest`
45
+ :rtype: :class:`huaweicloudsdkram.v1.AssociateResourceSharePermissionResponse`
46
+ """
47
+ http_info = self._associate_resource_share_permission_http_info(request)
48
+ return self._call_api(**http_info)
49
+
50
+ def associate_resource_share_permission_invoker(self, request):
51
+ http_info = self._associate_resource_share_permission_http_info(request)
52
+ return SyncInvoker(self, http_info)
53
+
54
+ @classmethod
55
+ def _associate_resource_share_permission_http_info(cls, request):
56
+ http_info = {
57
+ "method": "POST",
58
+ "resource_path": "/v1/resource-shares/{resource_share_id}/associate-permission",
59
+ "request_type": request.__class__.__name__,
60
+ "response_type": "AssociateResourceSharePermissionResponse"
61
+ }
62
+
63
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
64
+
65
+ cname = None
66
+
67
+ collection_formats = {}
68
+
69
+ path_params = {}
70
+ if 'resource_share_id' in local_var_params:
71
+ path_params['resource_share_id'] = local_var_params['resource_share_id']
72
+
73
+ query_params = []
74
+
75
+ header_params = {}
76
+ if 'x_security_token' in local_var_params:
77
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
78
+
79
+ form_params = {}
80
+
81
+ body = None
82
+ if 'body' in local_var_params:
83
+ body = local_var_params['body']
84
+ if isinstance(request, SdkStreamRequest):
85
+ body = request.get_file_stream()
86
+
87
+ response_headers = []
88
+
89
+ header_params['Content-Type'] = http_utils.select_header_content_type(
90
+ ['application/json'])
91
+
92
+ auth_settings = ['AccessKeyAuth']
93
+
94
+ http_info["cname"] = cname
95
+ http_info["collection_formats"] = collection_formats
96
+ http_info["path_params"] = path_params
97
+ http_info["query_params"] = query_params
98
+ http_info["header_params"] = header_params
99
+ http_info["post_params"] = form_params
100
+ http_info["body"] = body
101
+ http_info["response_headers"] = response_headers
102
+
103
+ return http_info
104
+
105
+ def disassociate_resource_share_permission(self, request):
106
+ r"""移除共享资源权限
107
+
108
+ 移除资源共享实例绑定的共享资源权限。权限更改立即生效。只有当目前资源共享实例中没有绑定相关资源类型时,您才能从资源共享实例中移除共享资源权限。
109
+
110
+ Please refer to HUAWEI cloud API Explorer for details.
111
+
112
+ :param request: Request instance for DisassociateResourceSharePermission
113
+ :type request: :class:`huaweicloudsdkram.v1.DisassociateResourceSharePermissionRequest`
114
+ :rtype: :class:`huaweicloudsdkram.v1.DisassociateResourceSharePermissionResponse`
115
+ """
116
+ http_info = self._disassociate_resource_share_permission_http_info(request)
117
+ return self._call_api(**http_info)
118
+
119
+ def disassociate_resource_share_permission_invoker(self, request):
120
+ http_info = self._disassociate_resource_share_permission_http_info(request)
121
+ return SyncInvoker(self, http_info)
122
+
123
+ @classmethod
124
+ def _disassociate_resource_share_permission_http_info(cls, request):
125
+ http_info = {
126
+ "method": "POST",
127
+ "resource_path": "/v1/resource-shares/{resource_share_id}/disassociate-permission",
128
+ "request_type": request.__class__.__name__,
129
+ "response_type": "DisassociateResourceSharePermissionResponse"
130
+ }
131
+
132
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
133
+
134
+ cname = None
135
+
136
+ collection_formats = {}
137
+
138
+ path_params = {}
139
+ if 'resource_share_id' in local_var_params:
140
+ path_params['resource_share_id'] = local_var_params['resource_share_id']
141
+
142
+ query_params = []
143
+
144
+ header_params = {}
145
+ if 'x_security_token' in local_var_params:
146
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
147
+
148
+ form_params = {}
149
+
150
+ body = None
151
+ if 'body' in local_var_params:
152
+ body = local_var_params['body']
153
+ if isinstance(request, SdkStreamRequest):
154
+ body = request.get_file_stream()
155
+
156
+ response_headers = []
157
+
158
+ header_params['Content-Type'] = http_utils.select_header_content_type(
159
+ ['application/json'])
160
+
161
+ auth_settings = ['AccessKeyAuth']
162
+
163
+ http_info["cname"] = cname
164
+ http_info["collection_formats"] = collection_formats
165
+ http_info["path_params"] = path_params
166
+ http_info["query_params"] = query_params
167
+ http_info["header_params"] = header_params
168
+ http_info["post_params"] = form_params
169
+ http_info["body"] = body
170
+ http_info["response_headers"] = response_headers
171
+
172
+ return http_info
173
+
174
+ def list_resource_share_permissions(self, request):
175
+ r"""检索绑定的共享资源权限
176
+
177
+ 检索资源共享实例关联的共享资源权限。
178
+
179
+ Please refer to HUAWEI cloud API Explorer for details.
180
+
181
+ :param request: Request instance for ListResourceSharePermissions
182
+ :type request: :class:`huaweicloudsdkram.v1.ListResourceSharePermissionsRequest`
183
+ :rtype: :class:`huaweicloudsdkram.v1.ListResourceSharePermissionsResponse`
184
+ """
185
+ http_info = self._list_resource_share_permissions_http_info(request)
186
+ return self._call_api(**http_info)
187
+
188
+ def list_resource_share_permissions_invoker(self, request):
189
+ http_info = self._list_resource_share_permissions_http_info(request)
190
+ return SyncInvoker(self, http_info)
191
+
192
+ @classmethod
193
+ def _list_resource_share_permissions_http_info(cls, request):
194
+ http_info = {
195
+ "method": "GET",
196
+ "resource_path": "/v1/resource-shares/{resource_share_id}/associated-permissions",
197
+ "request_type": request.__class__.__name__,
198
+ "response_type": "ListResourceSharePermissionsResponse"
199
+ }
200
+
201
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
202
+
203
+ cname = None
204
+
205
+ collection_formats = {}
206
+
207
+ path_params = {}
208
+ if 'resource_share_id' in local_var_params:
209
+ path_params['resource_share_id'] = local_var_params['resource_share_id']
210
+
211
+ query_params = []
212
+ if 'permission_name' in local_var_params:
213
+ query_params.append(('permission_name', local_var_params['permission_name']))
214
+ if 'limit' in local_var_params:
215
+ query_params.append(('limit', local_var_params['limit']))
216
+ if 'marker' in local_var_params:
217
+ query_params.append(('marker', local_var_params['marker']))
218
+
219
+ header_params = {}
220
+ if 'x_security_token' in local_var_params:
221
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
222
+
223
+ form_params = {}
224
+
225
+ body = None
226
+ if isinstance(request, SdkStreamRequest):
227
+ body = request.get_file_stream()
228
+
229
+ response_headers = []
230
+
231
+ header_params['Content-Type'] = http_utils.select_header_content_type(
232
+ ['application/json'])
233
+
234
+ auth_settings = ['AccessKeyAuth']
235
+
236
+ http_info["cname"] = cname
237
+ http_info["collection_formats"] = collection_formats
238
+ http_info["path_params"] = path_params
239
+ http_info["query_params"] = query_params
240
+ http_info["header_params"] = header_params
241
+ http_info["post_params"] = form_params
242
+ http_info["body"] = body
243
+ http_info["response_headers"] = response_headers
244
+
245
+ return http_info
246
+
247
+ def list_quota(self, request):
248
+ r"""查询资源共享的配额
249
+
250
+ 查询当前账号的资源共享配额信息。
251
+
252
+ Please refer to HUAWEI cloud API Explorer for details.
253
+
254
+ :param request: Request instance for ListQuota
255
+ :type request: :class:`huaweicloudsdkram.v1.ListQuotaRequest`
256
+ :rtype: :class:`huaweicloudsdkram.v1.ListQuotaResponse`
257
+ """
258
+ http_info = self._list_quota_http_info(request)
259
+ return self._call_api(**http_info)
260
+
261
+ def list_quota_invoker(self, request):
262
+ http_info = self._list_quota_http_info(request)
263
+ return SyncInvoker(self, http_info)
264
+
265
+ @classmethod
266
+ def _list_quota_http_info(cls, request):
267
+ http_info = {
268
+ "method": "GET",
269
+ "resource_path": "/v1/resource-shares/quotas",
270
+ "request_type": request.__class__.__name__,
271
+ "response_type": "ListQuotaResponse"
272
+ }
273
+
274
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
275
+
276
+ cname = None
277
+
278
+ collection_formats = {}
279
+
280
+ path_params = {}
281
+
282
+ query_params = []
283
+
284
+ header_params = {}
285
+ if 'x_security_token' in local_var_params:
286
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
287
+
288
+ form_params = {}
289
+
290
+ body = None
291
+ if isinstance(request, SdkStreamRequest):
292
+ body = request.get_file_stream()
293
+
294
+ response_headers = []
295
+
296
+ header_params['Content-Type'] = http_utils.select_header_content_type(
297
+ ['application/json'])
298
+
299
+ auth_settings = ['AccessKeyAuth']
300
+
301
+ http_info["cname"] = cname
302
+ http_info["collection_formats"] = collection_formats
303
+ http_info["path_params"] = path_params
304
+ http_info["query_params"] = query_params
305
+ http_info["header_params"] = header_params
306
+ http_info["post_params"] = form_params
307
+ http_info["body"] = body
308
+ http_info["response_headers"] = response_headers
309
+
310
+ return http_info
311
+
312
+ def list_resource_types(self, request):
313
+ r"""检索云服务资源类型
314
+
315
+ 查询已对接云服务的资源类型和区域等信息。
316
+
317
+ Please refer to HUAWEI cloud API Explorer for details.
318
+
319
+ :param request: Request instance for ListResourceTypes
320
+ :type request: :class:`huaweicloudsdkram.v1.ListResourceTypesRequest`
321
+ :rtype: :class:`huaweicloudsdkram.v1.ListResourceTypesResponse`
322
+ """
323
+ http_info = self._list_resource_types_http_info(request)
324
+ return self._call_api(**http_info)
325
+
326
+ def list_resource_types_invoker(self, request):
327
+ http_info = self._list_resource_types_http_info(request)
328
+ return SyncInvoker(self, http_info)
329
+
330
+ @classmethod
331
+ def _list_resource_types_http_info(cls, request):
332
+ http_info = {
333
+ "method": "GET",
334
+ "resource_path": "/v1/resource-types",
335
+ "request_type": request.__class__.__name__,
336
+ "response_type": "ListResourceTypesResponse"
337
+ }
338
+
339
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
340
+
341
+ cname = None
342
+
343
+ collection_formats = {}
344
+
345
+ path_params = {}
346
+
347
+ query_params = []
348
+ if 'limit' in local_var_params:
349
+ query_params.append(('limit', local_var_params['limit']))
350
+ if 'marker' in local_var_params:
351
+ query_params.append(('marker', local_var_params['marker']))
352
+
353
+ header_params = {}
354
+ if 'x_security_token' in local_var_params:
355
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
356
+
357
+ form_params = {}
358
+
359
+ body = None
360
+ if isinstance(request, SdkStreamRequest):
361
+ body = request.get_file_stream()
362
+
363
+ response_headers = []
364
+
365
+ header_params['Content-Type'] = http_utils.select_header_content_type(
366
+ ['application/json'])
367
+
368
+ auth_settings = ['AccessKeyAuth']
369
+
370
+ http_info["cname"] = cname
371
+ http_info["collection_formats"] = collection_formats
372
+ http_info["path_params"] = path_params
373
+ http_info["query_params"] = query_params
374
+ http_info["header_params"] = header_params
375
+ http_info["post_params"] = form_params
376
+ http_info["body"] = body
377
+ http_info["response_headers"] = response_headers
378
+
379
+ return http_info
380
+
381
+ def disable_organization_share(self, request):
382
+ r"""关闭与组织共享
383
+
384
+ 关闭与组织共享资源。
385
+
386
+ Please refer to HUAWEI cloud API Explorer for details.
387
+
388
+ :param request: Request instance for DisableOrganizationShare
389
+ :type request: :class:`huaweicloudsdkram.v1.DisableOrganizationShareRequest`
390
+ :rtype: :class:`huaweicloudsdkram.v1.DisableOrganizationShareResponse`
391
+ """
392
+ http_info = self._disable_organization_share_http_info(request)
393
+ return self._call_api(**http_info)
394
+
395
+ def disable_organization_share_invoker(self, request):
396
+ http_info = self._disable_organization_share_http_info(request)
397
+ return SyncInvoker(self, http_info)
398
+
399
+ @classmethod
400
+ def _disable_organization_share_http_info(cls, request):
401
+ http_info = {
402
+ "method": "POST",
403
+ "resource_path": "/v1/organization-share/disable",
404
+ "request_type": request.__class__.__name__,
405
+ "response_type": "DisableOrganizationShareResponse"
406
+ }
407
+
408
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
409
+
410
+ cname = None
411
+
412
+ collection_formats = {}
413
+
414
+ path_params = {}
415
+
416
+ query_params = []
417
+
418
+ header_params = {}
419
+ if 'x_security_token' in local_var_params:
420
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
421
+
422
+ form_params = {}
423
+
424
+ body = None
425
+ if isinstance(request, SdkStreamRequest):
426
+ body = request.get_file_stream()
427
+
428
+ response_headers = []
429
+
430
+ header_params['Content-Type'] = http_utils.select_header_content_type(
431
+ ['application/json'])
432
+
433
+ auth_settings = ['AccessKeyAuth']
434
+
435
+ http_info["cname"] = cname
436
+ http_info["collection_formats"] = collection_formats
437
+ http_info["path_params"] = path_params
438
+ http_info["query_params"] = query_params
439
+ http_info["header_params"] = header_params
440
+ http_info["post_params"] = form_params
441
+ http_info["body"] = body
442
+ http_info["response_headers"] = response_headers
443
+
444
+ return http_info
445
+
446
+ def enable_organization_share(self, request):
447
+ r"""启用与组织共享
448
+
449
+ 启用与组织共享资源。
450
+
451
+ Please refer to HUAWEI cloud API Explorer for details.
452
+
453
+ :param request: Request instance for EnableOrganizationShare
454
+ :type request: :class:`huaweicloudsdkram.v1.EnableOrganizationShareRequest`
455
+ :rtype: :class:`huaweicloudsdkram.v1.EnableOrganizationShareResponse`
456
+ """
457
+ http_info = self._enable_organization_share_http_info(request)
458
+ return self._call_api(**http_info)
459
+
460
+ def enable_organization_share_invoker(self, request):
461
+ http_info = self._enable_organization_share_http_info(request)
462
+ return SyncInvoker(self, http_info)
463
+
464
+ @classmethod
465
+ def _enable_organization_share_http_info(cls, request):
466
+ http_info = {
467
+ "method": "POST",
468
+ "resource_path": "/v1/organization-share/enable",
469
+ "request_type": request.__class__.__name__,
470
+ "response_type": "EnableOrganizationShareResponse"
471
+ }
472
+
473
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
474
+
475
+ cname = None
476
+
477
+ collection_formats = {}
478
+
479
+ path_params = {}
480
+
481
+ query_params = []
482
+
483
+ header_params = {}
484
+ if 'x_security_token' in local_var_params:
485
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
486
+
487
+ form_params = {}
488
+
489
+ body = None
490
+ if isinstance(request, SdkStreamRequest):
491
+ body = request.get_file_stream()
492
+
493
+ response_headers = []
494
+
495
+ header_params['Content-Type'] = http_utils.select_header_content_type(
496
+ ['application/json'])
497
+
498
+ auth_settings = ['AccessKeyAuth']
499
+
500
+ http_info["cname"] = cname
501
+ http_info["collection_formats"] = collection_formats
502
+ http_info["path_params"] = path_params
503
+ http_info["query_params"] = query_params
504
+ http_info["header_params"] = header_params
505
+ http_info["post_params"] = form_params
506
+ http_info["body"] = body
507
+ http_info["response_headers"] = response_headers
508
+
509
+ return http_info
510
+
511
+ def show_organization_share(self, request):
512
+ r"""检索是否启用与组织共享
513
+
514
+ 检索是否启用与组织共享资源。
515
+
516
+ Please refer to HUAWEI cloud API Explorer for details.
517
+
518
+ :param request: Request instance for ShowOrganizationShare
519
+ :type request: :class:`huaweicloudsdkram.v1.ShowOrganizationShareRequest`
520
+ :rtype: :class:`huaweicloudsdkram.v1.ShowOrganizationShareResponse`
521
+ """
522
+ http_info = self._show_organization_share_http_info(request)
523
+ return self._call_api(**http_info)
524
+
525
+ def show_organization_share_invoker(self, request):
526
+ http_info = self._show_organization_share_http_info(request)
527
+ return SyncInvoker(self, http_info)
528
+
529
+ @classmethod
530
+ def _show_organization_share_http_info(cls, request):
531
+ http_info = {
532
+ "method": "GET",
533
+ "resource_path": "/v1/organization-share",
534
+ "request_type": request.__class__.__name__,
535
+ "response_type": "ShowOrganizationShareResponse"
536
+ }
537
+
538
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
539
+
540
+ cname = None
541
+
542
+ collection_formats = {}
543
+
544
+ path_params = {}
545
+
546
+ query_params = []
547
+
548
+ header_params = {}
549
+ if 'x_security_token' in local_var_params:
550
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
551
+
552
+ form_params = {}
553
+
554
+ body = None
555
+ if isinstance(request, SdkStreamRequest):
556
+ body = request.get_file_stream()
557
+
558
+ response_headers = []
559
+
560
+ header_params['Content-Type'] = http_utils.select_header_content_type(
561
+ ['application/json'])
562
+
563
+ auth_settings = ['AccessKeyAuth']
564
+
565
+ http_info["cname"] = cname
566
+ http_info["collection_formats"] = collection_formats
567
+ http_info["path_params"] = path_params
568
+ http_info["query_params"] = query_params
569
+ http_info["header_params"] = header_params
570
+ http_info["post_params"] = form_params
571
+ http_info["body"] = body
572
+ http_info["response_headers"] = response_headers
573
+
574
+ return http_info
575
+
576
+ def list_permission_versions(self, request):
577
+ r"""获取权限的所有版本
578
+
579
+ 获取权限的所有版本。
580
+
581
+ Please refer to HUAWEI cloud API Explorer for details.
582
+
583
+ :param request: Request instance for ListPermissionVersions
584
+ :type request: :class:`huaweicloudsdkram.v1.ListPermissionVersionsRequest`
585
+ :rtype: :class:`huaweicloudsdkram.v1.ListPermissionVersionsResponse`
586
+ """
587
+ http_info = self._list_permission_versions_http_info(request)
588
+ return self._call_api(**http_info)
589
+
590
+ def list_permission_versions_invoker(self, request):
591
+ http_info = self._list_permission_versions_http_info(request)
592
+ return SyncInvoker(self, http_info)
593
+
594
+ @classmethod
595
+ def _list_permission_versions_http_info(cls, request):
596
+ http_info = {
597
+ "method": "GET",
598
+ "resource_path": "/v1/permissions/{permission_id}/versions",
599
+ "request_type": request.__class__.__name__,
600
+ "response_type": "ListPermissionVersionsResponse"
601
+ }
602
+
603
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
604
+
605
+ cname = None
606
+
607
+ collection_formats = {}
608
+
609
+ path_params = {}
610
+ if 'permission_id' in local_var_params:
611
+ path_params['permission_id'] = local_var_params['permission_id']
612
+
613
+ query_params = []
614
+ if 'limit' in local_var_params:
615
+ query_params.append(('limit', local_var_params['limit']))
616
+ if 'marker' in local_var_params:
617
+ query_params.append(('marker', local_var_params['marker']))
618
+
619
+ header_params = {}
620
+ if 'x_security_token' in local_var_params:
621
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
622
+
623
+ form_params = {}
624
+
625
+ body = None
626
+ if isinstance(request, SdkStreamRequest):
627
+ body = request.get_file_stream()
628
+
629
+ response_headers = []
630
+
631
+ header_params['Content-Type'] = http_utils.select_header_content_type(
632
+ ['application/json'])
633
+
634
+ auth_settings = []
635
+
636
+ http_info["cname"] = cname
637
+ http_info["collection_formats"] = collection_formats
638
+ http_info["path_params"] = path_params
639
+ http_info["query_params"] = query_params
640
+ http_info["header_params"] = header_params
641
+ http_info["post_params"] = form_params
642
+ http_info["body"] = body
643
+ http_info["response_headers"] = response_headers
644
+
645
+ return http_info
646
+
647
+ def list_permissions(self, request):
648
+ r"""检索共享资源权限列表
649
+
650
+ 检索指定资源类型的共享资源权限列表。
651
+
652
+ Please refer to HUAWEI cloud API Explorer for details.
653
+
654
+ :param request: Request instance for ListPermissions
655
+ :type request: :class:`huaweicloudsdkram.v1.ListPermissionsRequest`
656
+ :rtype: :class:`huaweicloudsdkram.v1.ListPermissionsResponse`
657
+ """
658
+ http_info = self._list_permissions_http_info(request)
659
+ return self._call_api(**http_info)
660
+
661
+ def list_permissions_invoker(self, request):
662
+ http_info = self._list_permissions_http_info(request)
663
+ return SyncInvoker(self, http_info)
664
+
665
+ @classmethod
666
+ def _list_permissions_http_info(cls, request):
667
+ http_info = {
668
+ "method": "GET",
669
+ "resource_path": "/v1/permissions",
670
+ "request_type": request.__class__.__name__,
671
+ "response_type": "ListPermissionsResponse"
672
+ }
673
+
674
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
675
+
676
+ cname = None
677
+
678
+ collection_formats = {}
679
+
680
+ path_params = {}
681
+
682
+ query_params = []
683
+ if 'limit' in local_var_params:
684
+ query_params.append(('limit', local_var_params['limit']))
685
+ if 'marker' in local_var_params:
686
+ query_params.append(('marker', local_var_params['marker']))
687
+ if 'resource_type' in local_var_params:
688
+ query_params.append(('resource_type', local_var_params['resource_type']))
689
+ if 'permission_type' in local_var_params:
690
+ query_params.append(('permission_type', local_var_params['permission_type']))
691
+
692
+ header_params = {}
693
+ if 'x_security_token' in local_var_params:
694
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
695
+
696
+ form_params = {}
697
+
698
+ body = None
699
+ if isinstance(request, SdkStreamRequest):
700
+ body = request.get_file_stream()
701
+
702
+ response_headers = []
703
+
704
+ header_params['Content-Type'] = http_utils.select_header_content_type(
705
+ ['application/json'])
706
+
707
+ auth_settings = ['AccessKeyAuth']
708
+
709
+ http_info["cname"] = cname
710
+ http_info["collection_formats"] = collection_formats
711
+ http_info["path_params"] = path_params
712
+ http_info["query_params"] = query_params
713
+ http_info["header_params"] = header_params
714
+ http_info["post_params"] = form_params
715
+ http_info["body"] = body
716
+ http_info["response_headers"] = response_headers
717
+
718
+ return http_info
719
+
720
+ def show_permission(self, request):
721
+ r"""检索资源共享权限内容
722
+
723
+ 检索指定资源类型的共享资源指定版本的权限内容,如果不指定权限版本,则返回默认版本的权限内容。
724
+
725
+ Please refer to HUAWEI cloud API Explorer for details.
726
+
727
+ :param request: Request instance for ShowPermission
728
+ :type request: :class:`huaweicloudsdkram.v1.ShowPermissionRequest`
729
+ :rtype: :class:`huaweicloudsdkram.v1.ShowPermissionResponse`
730
+ """
731
+ http_info = self._show_permission_http_info(request)
732
+ return self._call_api(**http_info)
733
+
734
+ def show_permission_invoker(self, request):
735
+ http_info = self._show_permission_http_info(request)
736
+ return SyncInvoker(self, http_info)
737
+
738
+ @classmethod
739
+ def _show_permission_http_info(cls, request):
740
+ http_info = {
741
+ "method": "GET",
742
+ "resource_path": "/v1/permissions/{permission_id}",
743
+ "request_type": request.__class__.__name__,
744
+ "response_type": "ShowPermissionResponse"
745
+ }
746
+
747
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
748
+
749
+ cname = None
750
+
751
+ collection_formats = {}
752
+
753
+ path_params = {}
754
+ if 'permission_id' in local_var_params:
755
+ path_params['permission_id'] = local_var_params['permission_id']
756
+
757
+ query_params = []
758
+ if 'permission_version' in local_var_params:
759
+ query_params.append(('permission_version', local_var_params['permission_version']))
760
+
761
+ header_params = {}
762
+ if 'x_security_token' in local_var_params:
763
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
764
+
765
+ form_params = {}
766
+
767
+ body = None
768
+ if isinstance(request, SdkStreamRequest):
769
+ body = request.get_file_stream()
770
+
771
+ response_headers = []
772
+
773
+ header_params['Content-Type'] = http_utils.select_header_content_type(
774
+ ['application/json'])
775
+
776
+ auth_settings = ['AccessKeyAuth']
777
+
778
+ http_info["cname"] = cname
779
+ http_info["collection_formats"] = collection_formats
780
+ http_info["path_params"] = path_params
781
+ http_info["query_params"] = query_params
782
+ http_info["header_params"] = header_params
783
+ http_info["post_params"] = form_params
784
+ http_info["body"] = body
785
+ http_info["response_headers"] = response_headers
786
+
787
+ return http_info
788
+
789
+ def search_shared_principals(self, request):
790
+ r"""检索资源使用者
791
+
792
+ 检索共享资源的使用者。
793
+
794
+ Please refer to HUAWEI cloud API Explorer for details.
795
+
796
+ :param request: Request instance for SearchSharedPrincipals
797
+ :type request: :class:`huaweicloudsdkram.v1.SearchSharedPrincipalsRequest`
798
+ :rtype: :class:`huaweicloudsdkram.v1.SearchSharedPrincipalsResponse`
799
+ """
800
+ http_info = self._search_shared_principals_http_info(request)
801
+ return self._call_api(**http_info)
802
+
803
+ def search_shared_principals_invoker(self, request):
804
+ http_info = self._search_shared_principals_http_info(request)
805
+ return SyncInvoker(self, http_info)
806
+
807
+ @classmethod
808
+ def _search_shared_principals_http_info(cls, request):
809
+ http_info = {
810
+ "method": "POST",
811
+ "resource_path": "/v1/shared-principals/search",
812
+ "request_type": request.__class__.__name__,
813
+ "response_type": "SearchSharedPrincipalsResponse"
814
+ }
815
+
816
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
817
+
818
+ cname = None
819
+
820
+ collection_formats = {}
821
+
822
+ path_params = {}
823
+
824
+ query_params = []
825
+
826
+ header_params = {}
827
+ if 'x_security_token' in local_var_params:
828
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
829
+
830
+ form_params = {}
831
+
832
+ body = None
833
+ if 'body' in local_var_params:
834
+ body = local_var_params['body']
835
+ if isinstance(request, SdkStreamRequest):
836
+ body = request.get_file_stream()
837
+
838
+ response_headers = []
839
+
840
+ header_params['Content-Type'] = http_utils.select_header_content_type(
841
+ ['application/json'])
842
+
843
+ auth_settings = ['AccessKeyAuth']
844
+
845
+ http_info["cname"] = cname
846
+ http_info["collection_formats"] = collection_formats
847
+ http_info["path_params"] = path_params
848
+ http_info["query_params"] = query_params
849
+ http_info["header_params"] = header_params
850
+ http_info["post_params"] = form_params
851
+ http_info["body"] = body
852
+ http_info["response_headers"] = response_headers
853
+
854
+ return http_info
855
+
856
+ def search_shared_resources(self, request):
857
+ r"""检索共享的资源
858
+
859
+ 检索您共享的或共享给您的资源。
860
+
861
+ Please refer to HUAWEI cloud API Explorer for details.
862
+
863
+ :param request: Request instance for SearchSharedResources
864
+ :type request: :class:`huaweicloudsdkram.v1.SearchSharedResourcesRequest`
865
+ :rtype: :class:`huaweicloudsdkram.v1.SearchSharedResourcesResponse`
866
+ """
867
+ http_info = self._search_shared_resources_http_info(request)
868
+ return self._call_api(**http_info)
869
+
870
+ def search_shared_resources_invoker(self, request):
871
+ http_info = self._search_shared_resources_http_info(request)
872
+ return SyncInvoker(self, http_info)
873
+
874
+ @classmethod
875
+ def _search_shared_resources_http_info(cls, request):
876
+ http_info = {
877
+ "method": "POST",
878
+ "resource_path": "/v1/shared-resources/search",
879
+ "request_type": request.__class__.__name__,
880
+ "response_type": "SearchSharedResourcesResponse"
881
+ }
882
+
883
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
884
+
885
+ cname = None
886
+
887
+ collection_formats = {}
888
+
889
+ path_params = {}
890
+
891
+ query_params = []
892
+
893
+ header_params = {}
894
+ if 'x_security_token' in local_var_params:
895
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
896
+
897
+ form_params = {}
898
+
899
+ body = None
900
+ if 'body' in local_var_params:
901
+ body = local_var_params['body']
902
+ if isinstance(request, SdkStreamRequest):
903
+ body = request.get_file_stream()
904
+
905
+ response_headers = []
906
+
907
+ header_params['Content-Type'] = http_utils.select_header_content_type(
908
+ ['application/json'])
909
+
910
+ auth_settings = ['AccessKeyAuth']
911
+
912
+ http_info["cname"] = cname
913
+ http_info["collection_formats"] = collection_formats
914
+ http_info["path_params"] = path_params
915
+ http_info["query_params"] = query_params
916
+ http_info["header_params"] = header_params
917
+ http_info["post_params"] = form_params
918
+ http_info["body"] = body
919
+ http_info["response_headers"] = response_headers
920
+
921
+ return http_info
922
+
923
+ def create_resource_share(self, request):
924
+ r"""创建资源共享实例
925
+
926
+ 创建一个资源共享实例。您可以指定需要共享的资源列表,资源使用者列表,以及授予资源使用者的权限列表。
927
+
928
+ Please refer to HUAWEI cloud API Explorer for details.
929
+
930
+ :param request: Request instance for CreateResourceShare
931
+ :type request: :class:`huaweicloudsdkram.v1.CreateResourceShareRequest`
932
+ :rtype: :class:`huaweicloudsdkram.v1.CreateResourceShareResponse`
933
+ """
934
+ http_info = self._create_resource_share_http_info(request)
935
+ return self._call_api(**http_info)
936
+
937
+ def create_resource_share_invoker(self, request):
938
+ http_info = self._create_resource_share_http_info(request)
939
+ return SyncInvoker(self, http_info)
940
+
941
+ @classmethod
942
+ def _create_resource_share_http_info(cls, request):
943
+ http_info = {
944
+ "method": "POST",
945
+ "resource_path": "/v1/resource-shares",
946
+ "request_type": request.__class__.__name__,
947
+ "response_type": "CreateResourceShareResponse"
948
+ }
949
+
950
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
951
+
952
+ cname = None
953
+
954
+ collection_formats = {}
955
+
956
+ path_params = {}
957
+
958
+ query_params = []
959
+
960
+ header_params = {}
961
+ if 'x_security_token' in local_var_params:
962
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
963
+
964
+ form_params = {}
965
+
966
+ body = None
967
+ if 'body' in local_var_params:
968
+ body = local_var_params['body']
969
+ if isinstance(request, SdkStreamRequest):
970
+ body = request.get_file_stream()
971
+
972
+ response_headers = []
973
+
974
+ header_params['Content-Type'] = http_utils.select_header_content_type(
975
+ ['application/json'])
976
+
977
+ auth_settings = ['AccessKeyAuth']
978
+
979
+ http_info["cname"] = cname
980
+ http_info["collection_formats"] = collection_formats
981
+ http_info["path_params"] = path_params
982
+ http_info["query_params"] = query_params
983
+ http_info["header_params"] = header_params
984
+ http_info["post_params"] = form_params
985
+ http_info["body"] = body
986
+ http_info["response_headers"] = response_headers
987
+
988
+ return http_info
989
+
990
+ def delete_resource_share(self, request):
991
+ r"""删除资源共享实例
992
+
993
+ 删除指定的资源共享实例。此操作不会删除实体资源,仅停止向其他账号共享资源。
994
+
995
+ Please refer to HUAWEI cloud API Explorer for details.
996
+
997
+ :param request: Request instance for DeleteResourceShare
998
+ :type request: :class:`huaweicloudsdkram.v1.DeleteResourceShareRequest`
999
+ :rtype: :class:`huaweicloudsdkram.v1.DeleteResourceShareResponse`
1000
+ """
1001
+ http_info = self._delete_resource_share_http_info(request)
1002
+ return self._call_api(**http_info)
1003
+
1004
+ def delete_resource_share_invoker(self, request):
1005
+ http_info = self._delete_resource_share_http_info(request)
1006
+ return SyncInvoker(self, http_info)
1007
+
1008
+ @classmethod
1009
+ def _delete_resource_share_http_info(cls, request):
1010
+ http_info = {
1011
+ "method": "DELETE",
1012
+ "resource_path": "/v1/resource-shares/{resource_share_id}",
1013
+ "request_type": request.__class__.__name__,
1014
+ "response_type": "DeleteResourceShareResponse"
1015
+ }
1016
+
1017
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1018
+
1019
+ cname = None
1020
+
1021
+ collection_formats = {}
1022
+
1023
+ path_params = {}
1024
+ if 'resource_share_id' in local_var_params:
1025
+ path_params['resource_share_id'] = local_var_params['resource_share_id']
1026
+
1027
+ query_params = []
1028
+
1029
+ header_params = {}
1030
+ if 'x_security_token' in local_var_params:
1031
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
1032
+
1033
+ form_params = {}
1034
+
1035
+ body = None
1036
+ if isinstance(request, SdkStreamRequest):
1037
+ body = request.get_file_stream()
1038
+
1039
+ response_headers = []
1040
+
1041
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1042
+ ['application/json'])
1043
+
1044
+ auth_settings = ['AccessKeyAuth']
1045
+
1046
+ http_info["cname"] = cname
1047
+ http_info["collection_formats"] = collection_formats
1048
+ http_info["path_params"] = path_params
1049
+ http_info["query_params"] = query_params
1050
+ http_info["header_params"] = header_params
1051
+ http_info["post_params"] = form_params
1052
+ http_info["body"] = body
1053
+ http_info["response_headers"] = response_headers
1054
+
1055
+ return http_info
1056
+
1057
+ def search_resource_shares(self, request):
1058
+ r"""检索资源共享实例
1059
+
1060
+ 检索您创建的或者共享给您的资源共享实例详情。
1061
+
1062
+ Please refer to HUAWEI cloud API Explorer for details.
1063
+
1064
+ :param request: Request instance for SearchResourceShares
1065
+ :type request: :class:`huaweicloudsdkram.v1.SearchResourceSharesRequest`
1066
+ :rtype: :class:`huaweicloudsdkram.v1.SearchResourceSharesResponse`
1067
+ """
1068
+ http_info = self._search_resource_shares_http_info(request)
1069
+ return self._call_api(**http_info)
1070
+
1071
+ def search_resource_shares_invoker(self, request):
1072
+ http_info = self._search_resource_shares_http_info(request)
1073
+ return SyncInvoker(self, http_info)
1074
+
1075
+ @classmethod
1076
+ def _search_resource_shares_http_info(cls, request):
1077
+ http_info = {
1078
+ "method": "POST",
1079
+ "resource_path": "/v1/resource-shares/search",
1080
+ "request_type": request.__class__.__name__,
1081
+ "response_type": "SearchResourceSharesResponse"
1082
+ }
1083
+
1084
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1085
+
1086
+ cname = None
1087
+
1088
+ collection_formats = {}
1089
+
1090
+ path_params = {}
1091
+
1092
+ query_params = []
1093
+
1094
+ header_params = {}
1095
+ if 'x_security_token' in local_var_params:
1096
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
1097
+
1098
+ form_params = {}
1099
+
1100
+ body = None
1101
+ if 'body' in local_var_params:
1102
+ body = local_var_params['body']
1103
+ if isinstance(request, SdkStreamRequest):
1104
+ body = request.get_file_stream()
1105
+
1106
+ response_headers = []
1107
+
1108
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1109
+ ['application/json'])
1110
+
1111
+ auth_settings = ['AccessKeyAuth']
1112
+
1113
+ http_info["cname"] = cname
1114
+ http_info["collection_formats"] = collection_formats
1115
+ http_info["path_params"] = path_params
1116
+ http_info["query_params"] = query_params
1117
+ http_info["header_params"] = header_params
1118
+ http_info["post_params"] = form_params
1119
+ http_info["body"] = body
1120
+ http_info["response_headers"] = response_headers
1121
+
1122
+ return http_info
1123
+
1124
+ def update_resource_share(self, request):
1125
+ r"""更新资源共享实例
1126
+
1127
+ 修改资源共享实例的特定属性。
1128
+
1129
+ Please refer to HUAWEI cloud API Explorer for details.
1130
+
1131
+ :param request: Request instance for UpdateResourceShare
1132
+ :type request: :class:`huaweicloudsdkram.v1.UpdateResourceShareRequest`
1133
+ :rtype: :class:`huaweicloudsdkram.v1.UpdateResourceShareResponse`
1134
+ """
1135
+ http_info = self._update_resource_share_http_info(request)
1136
+ return self._call_api(**http_info)
1137
+
1138
+ def update_resource_share_invoker(self, request):
1139
+ http_info = self._update_resource_share_http_info(request)
1140
+ return SyncInvoker(self, http_info)
1141
+
1142
+ @classmethod
1143
+ def _update_resource_share_http_info(cls, request):
1144
+ http_info = {
1145
+ "method": "PUT",
1146
+ "resource_path": "/v1/resource-shares/{resource_share_id}",
1147
+ "request_type": request.__class__.__name__,
1148
+ "response_type": "UpdateResourceShareResponse"
1149
+ }
1150
+
1151
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1152
+
1153
+ cname = None
1154
+
1155
+ collection_formats = {}
1156
+
1157
+ path_params = {}
1158
+ if 'resource_share_id' in local_var_params:
1159
+ path_params['resource_share_id'] = local_var_params['resource_share_id']
1160
+
1161
+ query_params = []
1162
+
1163
+ header_params = {}
1164
+ if 'x_security_token' in local_var_params:
1165
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
1166
+
1167
+ form_params = {}
1168
+
1169
+ body = None
1170
+ if 'body' in local_var_params:
1171
+ body = local_var_params['body']
1172
+ if isinstance(request, SdkStreamRequest):
1173
+ body = request.get_file_stream()
1174
+
1175
+ response_headers = []
1176
+
1177
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1178
+ ['application/json'])
1179
+
1180
+ auth_settings = ['AccessKeyAuth']
1181
+
1182
+ http_info["cname"] = cname
1183
+ http_info["collection_formats"] = collection_formats
1184
+ http_info["path_params"] = path_params
1185
+ http_info["query_params"] = query_params
1186
+ http_info["header_params"] = header_params
1187
+ http_info["post_params"] = form_params
1188
+ http_info["body"] = body
1189
+ http_info["response_headers"] = response_headers
1190
+
1191
+ return http_info
1192
+
1193
+ def associate_resource_share(self, request):
1194
+ r"""绑定资源使用者和共享资源
1195
+
1196
+ 向资源共享实例绑定指定的资源使用者列表或共享资源列表。对于新增的共享资源,有权访问此资源共享实例的资源使用者获得该共享资源的访问权限。对于新增的资源使用者,获得对此资源共享实例中共享资源的访问权限。
1197
+
1198
+ Please refer to HUAWEI cloud API Explorer for details.
1199
+
1200
+ :param request: Request instance for AssociateResourceShare
1201
+ :type request: :class:`huaweicloudsdkram.v1.AssociateResourceShareRequest`
1202
+ :rtype: :class:`huaweicloudsdkram.v1.AssociateResourceShareResponse`
1203
+ """
1204
+ http_info = self._associate_resource_share_http_info(request)
1205
+ return self._call_api(**http_info)
1206
+
1207
+ def associate_resource_share_invoker(self, request):
1208
+ http_info = self._associate_resource_share_http_info(request)
1209
+ return SyncInvoker(self, http_info)
1210
+
1211
+ @classmethod
1212
+ def _associate_resource_share_http_info(cls, request):
1213
+ http_info = {
1214
+ "method": "POST",
1215
+ "resource_path": "/v1/resource-shares/{resource_share_id}/associate",
1216
+ "request_type": request.__class__.__name__,
1217
+ "response_type": "AssociateResourceShareResponse"
1218
+ }
1219
+
1220
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1221
+
1222
+ cname = None
1223
+
1224
+ collection_formats = {}
1225
+
1226
+ path_params = {}
1227
+ if 'resource_share_id' in local_var_params:
1228
+ path_params['resource_share_id'] = local_var_params['resource_share_id']
1229
+
1230
+ query_params = []
1231
+
1232
+ header_params = {}
1233
+ if 'x_security_token' in local_var_params:
1234
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
1235
+
1236
+ form_params = {}
1237
+
1238
+ body = None
1239
+ if 'body' in local_var_params:
1240
+ body = local_var_params['body']
1241
+ if isinstance(request, SdkStreamRequest):
1242
+ body = request.get_file_stream()
1243
+
1244
+ response_headers = []
1245
+
1246
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1247
+ ['application/json'])
1248
+
1249
+ auth_settings = ['AccessKeyAuth']
1250
+
1251
+ http_info["cname"] = cname
1252
+ http_info["collection_formats"] = collection_formats
1253
+ http_info["path_params"] = path_params
1254
+ http_info["query_params"] = query_params
1255
+ http_info["header_params"] = header_params
1256
+ http_info["post_params"] = form_params
1257
+ http_info["body"] = body
1258
+ http_info["response_headers"] = response_headers
1259
+
1260
+ return http_info
1261
+
1262
+ def disassociate_resource_share(self, request):
1263
+ r"""移除资源使用者或共享资源
1264
+
1265
+ 将指定的资源使用者或共享资源从指定的资源共享实例中移除。资源使用者也可以从指定的资源共享实例中主动退出。
1266
+
1267
+ Please refer to HUAWEI cloud API Explorer for details.
1268
+
1269
+ :param request: Request instance for DisassociateResourceShare
1270
+ :type request: :class:`huaweicloudsdkram.v1.DisassociateResourceShareRequest`
1271
+ :rtype: :class:`huaweicloudsdkram.v1.DisassociateResourceShareResponse`
1272
+ """
1273
+ http_info = self._disassociate_resource_share_http_info(request)
1274
+ return self._call_api(**http_info)
1275
+
1276
+ def disassociate_resource_share_invoker(self, request):
1277
+ http_info = self._disassociate_resource_share_http_info(request)
1278
+ return SyncInvoker(self, http_info)
1279
+
1280
+ @classmethod
1281
+ def _disassociate_resource_share_http_info(cls, request):
1282
+ http_info = {
1283
+ "method": "POST",
1284
+ "resource_path": "/v1/resource-shares/{resource_share_id}/disassociate",
1285
+ "request_type": request.__class__.__name__,
1286
+ "response_type": "DisassociateResourceShareResponse"
1287
+ }
1288
+
1289
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1290
+
1291
+ cname = None
1292
+
1293
+ collection_formats = {}
1294
+
1295
+ path_params = {}
1296
+ if 'resource_share_id' in local_var_params:
1297
+ path_params['resource_share_id'] = local_var_params['resource_share_id']
1298
+
1299
+ query_params = []
1300
+
1301
+ header_params = {}
1302
+ if 'x_security_token' in local_var_params:
1303
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
1304
+
1305
+ form_params = {}
1306
+
1307
+ body = None
1308
+ if 'body' in local_var_params:
1309
+ body = local_var_params['body']
1310
+ if isinstance(request, SdkStreamRequest):
1311
+ body = request.get_file_stream()
1312
+
1313
+ response_headers = []
1314
+
1315
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1316
+ ['application/json'])
1317
+
1318
+ auth_settings = ['AccessKeyAuth']
1319
+
1320
+ http_info["cname"] = cname
1321
+ http_info["collection_formats"] = collection_formats
1322
+ http_info["path_params"] = path_params
1323
+ http_info["query_params"] = query_params
1324
+ http_info["header_params"] = header_params
1325
+ http_info["post_params"] = form_params
1326
+ http_info["body"] = body
1327
+ http_info["response_headers"] = response_headers
1328
+
1329
+ return http_info
1330
+
1331
+ def search_resource_share_associations(self, request):
1332
+ r"""检索绑定的资源使用者和共享资源
1333
+
1334
+ 检索您拥有的资源共享实例中绑定的共享资源和资源使用者。
1335
+
1336
+ Please refer to HUAWEI cloud API Explorer for details.
1337
+
1338
+ :param request: Request instance for SearchResourceShareAssociations
1339
+ :type request: :class:`huaweicloudsdkram.v1.SearchResourceShareAssociationsRequest`
1340
+ :rtype: :class:`huaweicloudsdkram.v1.SearchResourceShareAssociationsResponse`
1341
+ """
1342
+ http_info = self._search_resource_share_associations_http_info(request)
1343
+ return self._call_api(**http_info)
1344
+
1345
+ def search_resource_share_associations_invoker(self, request):
1346
+ http_info = self._search_resource_share_associations_http_info(request)
1347
+ return SyncInvoker(self, http_info)
1348
+
1349
+ @classmethod
1350
+ def _search_resource_share_associations_http_info(cls, request):
1351
+ http_info = {
1352
+ "method": "POST",
1353
+ "resource_path": "/v1/resource-share-associations/search",
1354
+ "request_type": request.__class__.__name__,
1355
+ "response_type": "SearchResourceShareAssociationsResponse"
1356
+ }
1357
+
1358
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1359
+
1360
+ cname = None
1361
+
1362
+ collection_formats = {}
1363
+
1364
+ path_params = {}
1365
+
1366
+ query_params = []
1367
+
1368
+ header_params = {}
1369
+ if 'x_security_token' in local_var_params:
1370
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
1371
+
1372
+ form_params = {}
1373
+
1374
+ body = None
1375
+ if 'body' in local_var_params:
1376
+ body = local_var_params['body']
1377
+ if isinstance(request, SdkStreamRequest):
1378
+ body = request.get_file_stream()
1379
+
1380
+ response_headers = []
1381
+
1382
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1383
+ ['application/json'])
1384
+
1385
+ auth_settings = ['AccessKeyAuth']
1386
+
1387
+ http_info["cname"] = cname
1388
+ http_info["collection_formats"] = collection_formats
1389
+ http_info["path_params"] = path_params
1390
+ http_info["query_params"] = query_params
1391
+ http_info["header_params"] = header_params
1392
+ http_info["post_params"] = form_params
1393
+ http_info["body"] = body
1394
+ http_info["response_headers"] = response_headers
1395
+
1396
+ return http_info
1397
+
1398
+ def accept_resource_share_invitation(self, request):
1399
+ r"""接受共享邀请
1400
+
1401
+ 接受来自其他账号的资源共享邀请。
1402
+
1403
+ Please refer to HUAWEI cloud API Explorer for details.
1404
+
1405
+ :param request: Request instance for AcceptResourceShareInvitation
1406
+ :type request: :class:`huaweicloudsdkram.v1.AcceptResourceShareInvitationRequest`
1407
+ :rtype: :class:`huaweicloudsdkram.v1.AcceptResourceShareInvitationResponse`
1408
+ """
1409
+ http_info = self._accept_resource_share_invitation_http_info(request)
1410
+ return self._call_api(**http_info)
1411
+
1412
+ def accept_resource_share_invitation_invoker(self, request):
1413
+ http_info = self._accept_resource_share_invitation_http_info(request)
1414
+ return SyncInvoker(self, http_info)
1415
+
1416
+ @classmethod
1417
+ def _accept_resource_share_invitation_http_info(cls, request):
1418
+ http_info = {
1419
+ "method": "POST",
1420
+ "resource_path": "/v1/resource-share-invitations/{resource_share_invitation_id}/accept",
1421
+ "request_type": request.__class__.__name__,
1422
+ "response_type": "AcceptResourceShareInvitationResponse"
1423
+ }
1424
+
1425
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1426
+
1427
+ cname = None
1428
+
1429
+ collection_formats = {}
1430
+
1431
+ path_params = {}
1432
+ if 'resource_share_invitation_id' in local_var_params:
1433
+ path_params['resource_share_invitation_id'] = local_var_params['resource_share_invitation_id']
1434
+
1435
+ query_params = []
1436
+
1437
+ header_params = {}
1438
+ if 'x_security_token' in local_var_params:
1439
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
1440
+
1441
+ form_params = {}
1442
+
1443
+ body = None
1444
+ if isinstance(request, SdkStreamRequest):
1445
+ body = request.get_file_stream()
1446
+
1447
+ response_headers = []
1448
+
1449
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1450
+ ['application/json'])
1451
+
1452
+ auth_settings = ['AccessKeyAuth']
1453
+
1454
+ http_info["cname"] = cname
1455
+ http_info["collection_formats"] = collection_formats
1456
+ http_info["path_params"] = path_params
1457
+ http_info["query_params"] = query_params
1458
+ http_info["header_params"] = header_params
1459
+ http_info["post_params"] = form_params
1460
+ http_info["body"] = body
1461
+ http_info["response_headers"] = response_headers
1462
+
1463
+ return http_info
1464
+
1465
+ def reject_resource_share_invitation(self, request):
1466
+ r"""拒绝共享邀请
1467
+
1468
+ 拒绝来自其他账号的资源共享邀请。
1469
+
1470
+ Please refer to HUAWEI cloud API Explorer for details.
1471
+
1472
+ :param request: Request instance for RejectResourceShareInvitation
1473
+ :type request: :class:`huaweicloudsdkram.v1.RejectResourceShareInvitationRequest`
1474
+ :rtype: :class:`huaweicloudsdkram.v1.RejectResourceShareInvitationResponse`
1475
+ """
1476
+ http_info = self._reject_resource_share_invitation_http_info(request)
1477
+ return self._call_api(**http_info)
1478
+
1479
+ def reject_resource_share_invitation_invoker(self, request):
1480
+ http_info = self._reject_resource_share_invitation_http_info(request)
1481
+ return SyncInvoker(self, http_info)
1482
+
1483
+ @classmethod
1484
+ def _reject_resource_share_invitation_http_info(cls, request):
1485
+ http_info = {
1486
+ "method": "POST",
1487
+ "resource_path": "/v1/resource-share-invitations/{resource_share_invitation_id}/reject",
1488
+ "request_type": request.__class__.__name__,
1489
+ "response_type": "RejectResourceShareInvitationResponse"
1490
+ }
1491
+
1492
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1493
+
1494
+ cname = None
1495
+
1496
+ collection_formats = {}
1497
+
1498
+ path_params = {}
1499
+ if 'resource_share_invitation_id' in local_var_params:
1500
+ path_params['resource_share_invitation_id'] = local_var_params['resource_share_invitation_id']
1501
+
1502
+ query_params = []
1503
+
1504
+ header_params = {}
1505
+ if 'x_security_token' in local_var_params:
1506
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
1507
+
1508
+ form_params = {}
1509
+
1510
+ body = None
1511
+ if isinstance(request, SdkStreamRequest):
1512
+ body = request.get_file_stream()
1513
+
1514
+ response_headers = []
1515
+
1516
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1517
+ ['application/json'])
1518
+
1519
+ auth_settings = ['AccessKeyAuth']
1520
+
1521
+ http_info["cname"] = cname
1522
+ http_info["collection_formats"] = collection_formats
1523
+ http_info["path_params"] = path_params
1524
+ http_info["query_params"] = query_params
1525
+ http_info["header_params"] = header_params
1526
+ http_info["post_params"] = form_params
1527
+ http_info["body"] = body
1528
+ http_info["response_headers"] = response_headers
1529
+
1530
+ return http_info
1531
+
1532
+ def search_resource_share_invitation(self, request):
1533
+ r"""检索共享邀请
1534
+
1535
+ 通过条件检索资源共享邀请。
1536
+
1537
+ Please refer to HUAWEI cloud API Explorer for details.
1538
+
1539
+ :param request: Request instance for SearchResourceShareInvitation
1540
+ :type request: :class:`huaweicloudsdkram.v1.SearchResourceShareInvitationRequest`
1541
+ :rtype: :class:`huaweicloudsdkram.v1.SearchResourceShareInvitationResponse`
1542
+ """
1543
+ http_info = self._search_resource_share_invitation_http_info(request)
1544
+ return self._call_api(**http_info)
1545
+
1546
+ def search_resource_share_invitation_invoker(self, request):
1547
+ http_info = self._search_resource_share_invitation_http_info(request)
1548
+ return SyncInvoker(self, http_info)
1549
+
1550
+ @classmethod
1551
+ def _search_resource_share_invitation_http_info(cls, request):
1552
+ http_info = {
1553
+ "method": "POST",
1554
+ "resource_path": "/v1/resource-share-invitations/search",
1555
+ "request_type": request.__class__.__name__,
1556
+ "response_type": "SearchResourceShareInvitationResponse"
1557
+ }
1558
+
1559
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1560
+
1561
+ cname = None
1562
+
1563
+ collection_formats = {}
1564
+
1565
+ path_params = {}
1566
+
1567
+ query_params = []
1568
+
1569
+ header_params = {}
1570
+ if 'x_security_token' in local_var_params:
1571
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
1572
+
1573
+ form_params = {}
1574
+
1575
+ body = None
1576
+ if 'body' in local_var_params:
1577
+ body = local_var_params['body']
1578
+ if isinstance(request, SdkStreamRequest):
1579
+ body = request.get_file_stream()
1580
+
1581
+ response_headers = []
1582
+
1583
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1584
+ ['application/json'])
1585
+
1586
+ auth_settings = ['AccessKeyAuth']
1587
+
1588
+ http_info["cname"] = cname
1589
+ http_info["collection_formats"] = collection_formats
1590
+ http_info["path_params"] = path_params
1591
+ http_info["query_params"] = query_params
1592
+ http_info["header_params"] = header_params
1593
+ http_info["post_params"] = form_params
1594
+ http_info["body"] = body
1595
+ http_info["response_headers"] = response_headers
1596
+
1597
+ return http_info
1598
+
1599
+ def batch_create_resource_share_tags(self, request):
1600
+ r"""资源共享实例增加标签
1601
+
1602
+ 资源共享实例增加标签。
1603
+
1604
+ Please refer to HUAWEI cloud API Explorer for details.
1605
+
1606
+ :param request: Request instance for BatchCreateResourceShareTags
1607
+ :type request: :class:`huaweicloudsdkram.v1.BatchCreateResourceShareTagsRequest`
1608
+ :rtype: :class:`huaweicloudsdkram.v1.BatchCreateResourceShareTagsResponse`
1609
+ """
1610
+ http_info = self._batch_create_resource_share_tags_http_info(request)
1611
+ return self._call_api(**http_info)
1612
+
1613
+ def batch_create_resource_share_tags_invoker(self, request):
1614
+ http_info = self._batch_create_resource_share_tags_http_info(request)
1615
+ return SyncInvoker(self, http_info)
1616
+
1617
+ @classmethod
1618
+ def _batch_create_resource_share_tags_http_info(cls, request):
1619
+ http_info = {
1620
+ "method": "POST",
1621
+ "resource_path": "/v1/resource-shares/{resource_share_id}/tags/create",
1622
+ "request_type": request.__class__.__name__,
1623
+ "response_type": "BatchCreateResourceShareTagsResponse"
1624
+ }
1625
+
1626
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1627
+
1628
+ cname = None
1629
+
1630
+ collection_formats = {}
1631
+
1632
+ path_params = {}
1633
+ if 'resource_share_id' in local_var_params:
1634
+ path_params['resource_share_id'] = local_var_params['resource_share_id']
1635
+
1636
+ query_params = []
1637
+
1638
+ header_params = {}
1639
+ if 'x_security_token' in local_var_params:
1640
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
1641
+
1642
+ form_params = {}
1643
+
1644
+ body = None
1645
+ if 'body' in local_var_params:
1646
+ body = local_var_params['body']
1647
+ if isinstance(request, SdkStreamRequest):
1648
+ body = request.get_file_stream()
1649
+
1650
+ response_headers = []
1651
+
1652
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1653
+ ['application/json'])
1654
+
1655
+ auth_settings = ['AccessKeyAuth']
1656
+
1657
+ http_info["cname"] = cname
1658
+ http_info["collection_formats"] = collection_formats
1659
+ http_info["path_params"] = path_params
1660
+ http_info["query_params"] = query_params
1661
+ http_info["header_params"] = header_params
1662
+ http_info["post_params"] = form_params
1663
+ http_info["body"] = body
1664
+ http_info["response_headers"] = response_headers
1665
+
1666
+ return http_info
1667
+
1668
+ def batch_delete_resource_share_tags(self, request):
1669
+ r"""删除资源共享实例的标签
1670
+
1671
+ 删除资源共享实例指定的标签。
1672
+
1673
+ Please refer to HUAWEI cloud API Explorer for details.
1674
+
1675
+ :param request: Request instance for BatchDeleteResourceShareTags
1676
+ :type request: :class:`huaweicloudsdkram.v1.BatchDeleteResourceShareTagsRequest`
1677
+ :rtype: :class:`huaweicloudsdkram.v1.BatchDeleteResourceShareTagsResponse`
1678
+ """
1679
+ http_info = self._batch_delete_resource_share_tags_http_info(request)
1680
+ return self._call_api(**http_info)
1681
+
1682
+ def batch_delete_resource_share_tags_invoker(self, request):
1683
+ http_info = self._batch_delete_resource_share_tags_http_info(request)
1684
+ return SyncInvoker(self, http_info)
1685
+
1686
+ @classmethod
1687
+ def _batch_delete_resource_share_tags_http_info(cls, request):
1688
+ http_info = {
1689
+ "method": "POST",
1690
+ "resource_path": "/v1/resource-shares/{resource_share_id}/tags/delete",
1691
+ "request_type": request.__class__.__name__,
1692
+ "response_type": "BatchDeleteResourceShareTagsResponse"
1693
+ }
1694
+
1695
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1696
+
1697
+ cname = None
1698
+
1699
+ collection_formats = {}
1700
+
1701
+ path_params = {}
1702
+ if 'resource_share_id' in local_var_params:
1703
+ path_params['resource_share_id'] = local_var_params['resource_share_id']
1704
+
1705
+ query_params = []
1706
+
1707
+ header_params = {}
1708
+ if 'x_security_token' in local_var_params:
1709
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
1710
+
1711
+ form_params = {}
1712
+
1713
+ body = None
1714
+ if 'body' in local_var_params:
1715
+ body = local_var_params['body']
1716
+ if isinstance(request, SdkStreamRequest):
1717
+ body = request.get_file_stream()
1718
+
1719
+ response_headers = []
1720
+
1721
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1722
+ ['application/json'])
1723
+
1724
+ auth_settings = ['AccessKeyAuth']
1725
+
1726
+ http_info["cname"] = cname
1727
+ http_info["collection_formats"] = collection_formats
1728
+ http_info["path_params"] = path_params
1729
+ http_info["query_params"] = query_params
1730
+ http_info["header_params"] = header_params
1731
+ http_info["post_params"] = form_params
1732
+ http_info["body"] = body
1733
+ http_info["response_headers"] = response_headers
1734
+
1735
+ return http_info
1736
+
1737
+ def list_resource_share_tags(self, request):
1738
+ r"""查询已使用的标签列表
1739
+
1740
+ 查询资源共享实例已使用标签的列表。
1741
+
1742
+ Please refer to HUAWEI cloud API Explorer for details.
1743
+
1744
+ :param request: Request instance for ListResourceShareTags
1745
+ :type request: :class:`huaweicloudsdkram.v1.ListResourceShareTagsRequest`
1746
+ :rtype: :class:`huaweicloudsdkram.v1.ListResourceShareTagsResponse`
1747
+ """
1748
+ http_info = self._list_resource_share_tags_http_info(request)
1749
+ return self._call_api(**http_info)
1750
+
1751
+ def list_resource_share_tags_invoker(self, request):
1752
+ http_info = self._list_resource_share_tags_http_info(request)
1753
+ return SyncInvoker(self, http_info)
1754
+
1755
+ @classmethod
1756
+ def _list_resource_share_tags_http_info(cls, request):
1757
+ http_info = {
1758
+ "method": "GET",
1759
+ "resource_path": "/v1/resource-shares/tags",
1760
+ "request_type": request.__class__.__name__,
1761
+ "response_type": "ListResourceShareTagsResponse"
1762
+ }
1763
+
1764
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1765
+
1766
+ cname = None
1767
+
1768
+ collection_formats = {}
1769
+
1770
+ path_params = {}
1771
+
1772
+ query_params = []
1773
+ if 'limit' in local_var_params:
1774
+ query_params.append(('limit', local_var_params['limit']))
1775
+ if 'marker' in local_var_params:
1776
+ query_params.append(('marker', local_var_params['marker']))
1777
+
1778
+ header_params = {}
1779
+ if 'x_security_token' in local_var_params:
1780
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
1781
+
1782
+ form_params = {}
1783
+
1784
+ body = None
1785
+ if isinstance(request, SdkStreamRequest):
1786
+ body = request.get_file_stream()
1787
+
1788
+ response_headers = []
1789
+
1790
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1791
+ ['application/json'])
1792
+
1793
+ auth_settings = ['AccessKeyAuth']
1794
+
1795
+ http_info["cname"] = cname
1796
+ http_info["collection_formats"] = collection_formats
1797
+ http_info["path_params"] = path_params
1798
+ http_info["query_params"] = query_params
1799
+ http_info["header_params"] = header_params
1800
+ http_info["post_params"] = form_params
1801
+ http_info["body"] = body
1802
+ http_info["response_headers"] = response_headers
1803
+
1804
+ return http_info
1805
+
1806
+ def list_resource_shares_by_tags(self, request):
1807
+ r"""根据标签信息查询实例列表
1808
+
1809
+ 根据标签信息查询资源共享实例列表。
1810
+
1811
+ Please refer to HUAWEI cloud API Explorer for details.
1812
+
1813
+ :param request: Request instance for ListResourceSharesByTags
1814
+ :type request: :class:`huaweicloudsdkram.v1.ListResourceSharesByTagsRequest`
1815
+ :rtype: :class:`huaweicloudsdkram.v1.ListResourceSharesByTagsResponse`
1816
+ """
1817
+ http_info = self._list_resource_shares_by_tags_http_info(request)
1818
+ return self._call_api(**http_info)
1819
+
1820
+ def list_resource_shares_by_tags_invoker(self, request):
1821
+ http_info = self._list_resource_shares_by_tags_http_info(request)
1822
+ return SyncInvoker(self, http_info)
1823
+
1824
+ @classmethod
1825
+ def _list_resource_shares_by_tags_http_info(cls, request):
1826
+ http_info = {
1827
+ "method": "POST",
1828
+ "resource_path": "/v1/resource-shares/resource-instances/filter",
1829
+ "request_type": request.__class__.__name__,
1830
+ "response_type": "ListResourceSharesByTagsResponse"
1831
+ }
1832
+
1833
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1834
+
1835
+ cname = None
1836
+
1837
+ collection_formats = {}
1838
+
1839
+ path_params = {}
1840
+
1841
+ query_params = []
1842
+ if 'limit' in local_var_params:
1843
+ query_params.append(('limit', local_var_params['limit']))
1844
+ if 'offset' in local_var_params:
1845
+ query_params.append(('offset', local_var_params['offset']))
1846
+
1847
+ header_params = {}
1848
+ if 'x_security_token' in local_var_params:
1849
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
1850
+
1851
+ form_params = {}
1852
+
1853
+ body = None
1854
+ if 'body' in local_var_params:
1855
+ body = local_var_params['body']
1856
+ if isinstance(request, SdkStreamRequest):
1857
+ body = request.get_file_stream()
1858
+
1859
+ response_headers = []
1860
+
1861
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1862
+ ['application/json'])
1863
+
1864
+ auth_settings = ['AccessKeyAuth']
1865
+
1866
+ http_info["cname"] = cname
1867
+ http_info["collection_formats"] = collection_formats
1868
+ http_info["path_params"] = path_params
1869
+ http_info["query_params"] = query_params
1870
+ http_info["header_params"] = header_params
1871
+ http_info["post_params"] = form_params
1872
+ http_info["body"] = body
1873
+ http_info["response_headers"] = response_headers
1874
+
1875
+ return http_info
1876
+
1877
+ def search_resource_share_count_by_tags(self, request):
1878
+ r"""根据标签信息查询实例数量
1879
+
1880
+ 根据标签信息查询资源共享实例数量。
1881
+
1882
+ Please refer to HUAWEI cloud API Explorer for details.
1883
+
1884
+ :param request: Request instance for SearchResourceShareCountByTags
1885
+ :type request: :class:`huaweicloudsdkram.v1.SearchResourceShareCountByTagsRequest`
1886
+ :rtype: :class:`huaweicloudsdkram.v1.SearchResourceShareCountByTagsResponse`
1887
+ """
1888
+ http_info = self._search_resource_share_count_by_tags_http_info(request)
1889
+ return self._call_api(**http_info)
1890
+
1891
+ def search_resource_share_count_by_tags_invoker(self, request):
1892
+ http_info = self._search_resource_share_count_by_tags_http_info(request)
1893
+ return SyncInvoker(self, http_info)
1894
+
1895
+ @classmethod
1896
+ def _search_resource_share_count_by_tags_http_info(cls, request):
1897
+ http_info = {
1898
+ "method": "POST",
1899
+ "resource_path": "/v1/resource-shares/resource-instances/count",
1900
+ "request_type": request.__class__.__name__,
1901
+ "response_type": "SearchResourceShareCountByTagsResponse"
1902
+ }
1903
+
1904
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1905
+
1906
+ cname = None
1907
+
1908
+ collection_formats = {}
1909
+
1910
+ path_params = {}
1911
+
1912
+ query_params = []
1913
+
1914
+ header_params = {}
1915
+ if 'x_security_token' in local_var_params:
1916
+ header_params['X-Security-Token'] = local_var_params['x_security_token']
1917
+
1918
+ form_params = {}
1919
+
1920
+ body = None
1921
+ if 'body' in local_var_params:
1922
+ body = local_var_params['body']
1923
+ if isinstance(request, SdkStreamRequest):
1924
+ body = request.get_file_stream()
1925
+
1926
+ response_headers = []
1927
+
1928
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1929
+ ['application/json'])
1930
+
1931
+ auth_settings = ['AccessKeyAuth']
1932
+
1933
+ http_info["cname"] = cname
1934
+ http_info["collection_formats"] = collection_formats
1935
+ http_info["path_params"] = path_params
1936
+ http_info["query_params"] = query_params
1937
+ http_info["header_params"] = header_params
1938
+ http_info["post_params"] = form_params
1939
+ http_info["body"] = body
1940
+ http_info["response_headers"] = response_headers
1941
+
1942
+ return http_info
1943
+
1944
+ def _call_api(self, **kwargs):
1945
+ try:
1946
+ return self.do_http_request(**kwargs)
1947
+ except TypeError:
1948
+ import inspect
1949
+ params = inspect.signature(self.do_http_request).parameters
1950
+ http_info = {param_name: kwargs.get(param_name) for param_name in params if param_name in kwargs}
1951
+ return self.do_http_request(**http_info)
1952
+
1953
+ def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None,
1954
+ post_params=None, cname=None, response_type=None, response_headers=None, auth_settings=None,
1955
+ collection_formats=None, request_type=None):
1956
+ """Makes the HTTP request and returns deserialized data.
1957
+
1958
+ :param resource_path: Path to method endpoint.
1959
+ :param method: Method to call.
1960
+ :param path_params: Path parameters in the url.
1961
+ :param query_params: Query parameters in the url.
1962
+ :param header_params: Header parameters to be placed in the request header.
1963
+ :param body: Request body.
1964
+ :param post_params: Request post form parameters,
1965
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
1966
+ :param cname: Used for obs endpoint.
1967
+ :param auth_settings: Auth Settings names for the request.
1968
+ :param response_type: Response data type.
1969
+ :param response_headers: Header should be added to response data.
1970
+ :param collection_formats: dict of collection formats for path, query,
1971
+ header, and post parameters.
1972
+ :param request_type: Request data type.
1973
+ :return:
1974
+ Return the response directly.
1975
+ """
1976
+ return self.do_http_request(
1977
+ method=method,
1978
+ resource_path=resource_path,
1979
+ path_params=path_params,
1980
+ query_params=query_params,
1981
+ header_params=header_params,
1982
+ body=body,
1983
+ post_params=post_params,
1984
+ cname=cname,
1985
+ response_type=response_type,
1986
+ response_headers=response_headers,
1987
+ collection_formats=collection_formats,
1988
+ request_type=request_type)