huaweicloudsdkoms 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 (121) hide show
  1. huaweicloudsdkoms/__init__.py +0 -0
  2. huaweicloudsdkoms/v2/__init__.py +117 -0
  3. huaweicloudsdkoms/v2/model/__init__.py +114 -0
  4. huaweicloudsdkoms/v2/model/bandwidth_policy_dto.py +170 -0
  5. huaweicloudsdkoms/v2/model/batch_update_tasks_req.py +201 -0
  6. huaweicloudsdkoms/v2/model/batch_update_tasks_request.py +111 -0
  7. huaweicloudsdkoms/v2/model/batch_update_tasks_response.py +85 -0
  8. huaweicloudsdkoms/v2/model/check_prefix_req.py +343 -0
  9. huaweicloudsdkoms/v2/model/check_prefix_request.py +111 -0
  10. huaweicloudsdkoms/v2/model/check_prefix_response.py +116 -0
  11. huaweicloudsdkoms/v2/model/checked_key.py +173 -0
  12. huaweicloudsdkoms/v2/model/create_sync_events_request.py +139 -0
  13. huaweicloudsdkoms/v2/model/create_sync_events_response.py +85 -0
  14. huaweicloudsdkoms/v2/model/create_sync_task_req.py +567 -0
  15. huaweicloudsdkoms/v2/model/create_sync_task_request.py +111 -0
  16. huaweicloudsdkoms/v2/model/create_sync_task_response.py +116 -0
  17. huaweicloudsdkoms/v2/model/create_task_group_req.py +531 -0
  18. huaweicloudsdkoms/v2/model/create_task_group_request.py +111 -0
  19. huaweicloudsdkoms/v2/model/create_task_group_response.py +116 -0
  20. huaweicloudsdkoms/v2/model/create_task_req.py +561 -0
  21. huaweicloudsdkoms/v2/model/create_task_request.py +111 -0
  22. huaweicloudsdkoms/v2/model/create_task_response.py +145 -0
  23. huaweicloudsdkoms/v2/model/delete_sync_task_request.py +114 -0
  24. huaweicloudsdkoms/v2/model/delete_sync_task_response.py +85 -0
  25. huaweicloudsdkoms/v2/model/delete_task_group_request.py +114 -0
  26. huaweicloudsdkoms/v2/model/delete_task_group_response.py +85 -0
  27. huaweicloudsdkoms/v2/model/delete_task_request.py +114 -0
  28. huaweicloudsdkoms/v2/model/delete_task_response.py +85 -0
  29. huaweicloudsdkoms/v2/model/dst_node_req.py +256 -0
  30. huaweicloudsdkoms/v2/model/dst_node_resp.py +173 -0
  31. huaweicloudsdkoms/v2/model/error_reason_resp.py +144 -0
  32. huaweicloudsdkoms/v2/model/failed_object_record_dto.py +173 -0
  33. huaweicloudsdkoms/v2/model/link.py +144 -0
  34. huaweicloudsdkoms/v2/model/list_api_versions_request.py +84 -0
  35. huaweicloudsdkoms/v2/model/list_api_versions_response.py +116 -0
  36. huaweicloudsdkoms/v2/model/list_buckets_req.py +230 -0
  37. huaweicloudsdkoms/v2/model/list_file.py +171 -0
  38. huaweicloudsdkoms/v2/model/list_sync_task_statistic_request.py +198 -0
  39. huaweicloudsdkoms/v2/model/list_sync_task_statistic_response.py +174 -0
  40. huaweicloudsdkoms/v2/model/list_sync_tasks_request.py +173 -0
  41. huaweicloudsdkoms/v2/model/list_sync_tasks_response.py +145 -0
  42. huaweicloudsdkoms/v2/model/list_task_group_request.py +173 -0
  43. huaweicloudsdkoms/v2/model/list_task_group_response.py +145 -0
  44. huaweicloudsdkoms/v2/model/list_tasks_request.py +202 -0
  45. huaweicloudsdkoms/v2/model/list_tasks_response.py +145 -0
  46. huaweicloudsdkoms/v2/model/prefix_key_info.py +114 -0
  47. huaweicloudsdkoms/v2/model/region_info.py +173 -0
  48. huaweicloudsdkoms/v2/model/retry_task_group_req.py +289 -0
  49. huaweicloudsdkoms/v2/model/retry_task_group_request.py +139 -0
  50. huaweicloudsdkoms/v2/model/retry_task_group_response.py +85 -0
  51. huaweicloudsdkoms/v2/model/show_api_info_request.py +114 -0
  52. huaweicloudsdkoms/v2/model/show_api_info_response.py +203 -0
  53. huaweicloudsdkoms/v2/model/show_bucket_list_request.py +111 -0
  54. huaweicloudsdkoms/v2/model/show_bucket_list_response.py +112 -0
  55. huaweicloudsdkoms/v2/model/show_bucket_objects_request.py +111 -0
  56. huaweicloudsdkoms/v2/model/show_bucket_objects_response.py +174 -0
  57. huaweicloudsdkoms/v2/model/show_bucket_record.py +144 -0
  58. huaweicloudsdkoms/v2/model/show_bucket_region_req.py +258 -0
  59. huaweicloudsdkoms/v2/model/show_bucket_region_request.py +111 -0
  60. huaweicloudsdkoms/v2/model/show_bucket_region_response.py +174 -0
  61. huaweicloudsdkoms/v2/model/show_bucket_req.py +370 -0
  62. huaweicloudsdkoms/v2/model/show_cdn_info_req.py +304 -0
  63. huaweicloudsdkoms/v2/model/show_cdn_info_request.py +111 -0
  64. huaweicloudsdkoms/v2/model/show_cdn_info_response.py +174 -0
  65. huaweicloudsdkoms/v2/model/show_cloud_type_request.py +114 -0
  66. huaweicloudsdkoms/v2/model/show_cloud_type_response.py +112 -0
  67. huaweicloudsdkoms/v2/model/show_region_info_request.py +84 -0
  68. huaweicloudsdkoms/v2/model/show_region_info_resp.py +144 -0
  69. huaweicloudsdkoms/v2/model/show_region_info_response.py +112 -0
  70. huaweicloudsdkoms/v2/model/show_sync_task_request.py +142 -0
  71. huaweicloudsdkoms/v2/model/show_sync_task_response.py +725 -0
  72. huaweicloudsdkoms/v2/model/show_task_group_request.py +114 -0
  73. huaweicloudsdkoms/v2/model/show_task_group_response.py +1165 -0
  74. huaweicloudsdkoms/v2/model/show_task_request.py +114 -0
  75. huaweicloudsdkoms/v2/model/show_task_response.py +1194 -0
  76. huaweicloudsdkoms/v2/model/smn_config.py +200 -0
  77. huaweicloudsdkoms/v2/model/smn_info.py +173 -0
  78. huaweicloudsdkoms/v2/model/source_cdn_req.py +199 -0
  79. huaweicloudsdkoms/v2/model/source_cdn_resp.py +171 -0
  80. huaweicloudsdkoms/v2/model/src_node_req.py +372 -0
  81. huaweicloudsdkoms/v2/model/src_node_resp.py +256 -0
  82. huaweicloudsdkoms/v2/model/start_sync_task_req.py +227 -0
  83. huaweicloudsdkoms/v2/model/start_sync_task_request.py +139 -0
  84. huaweicloudsdkoms/v2/model/start_sync_task_response.py +85 -0
  85. huaweicloudsdkoms/v2/model/start_task_group_req.py +258 -0
  86. huaweicloudsdkoms/v2/model/start_task_group_request.py +139 -0
  87. huaweicloudsdkoms/v2/model/start_task_group_response.py +85 -0
  88. huaweicloudsdkoms/v2/model/start_task_req.py +345 -0
  89. huaweicloudsdkoms/v2/model/start_task_request.py +139 -0
  90. huaweicloudsdkoms/v2/model/start_task_response.py +85 -0
  91. huaweicloudsdkoms/v2/model/statistic_data.py +144 -0
  92. huaweicloudsdkoms/v2/model/statistic_type_data.py +144 -0
  93. huaweicloudsdkoms/v2/model/stop_sync_task_request.py +114 -0
  94. huaweicloudsdkoms/v2/model/stop_sync_task_response.py +85 -0
  95. huaweicloudsdkoms/v2/model/stop_task_group_request.py +114 -0
  96. huaweicloudsdkoms/v2/model/stop_task_group_response.py +85 -0
  97. huaweicloudsdkoms/v2/model/stop_task_request.py +114 -0
  98. huaweicloudsdkoms/v2/model/stop_task_response.py +85 -0
  99. huaweicloudsdkoms/v2/model/sync_object_req.py +114 -0
  100. huaweicloudsdkoms/v2/model/sync_task_info.py +604 -0
  101. huaweicloudsdkoms/v2/model/task_group_dst_node.py +256 -0
  102. huaweicloudsdkoms/v2/model/task_group_dst_node_resp.py +173 -0
  103. huaweicloudsdkoms/v2/model/task_group_resp.py +1164 -0
  104. huaweicloudsdkoms/v2/model/task_group_src_node.py +343 -0
  105. huaweicloudsdkoms/v2/model/task_group_src_node_resp.py +256 -0
  106. huaweicloudsdkoms/v2/model/task_resp.py +1193 -0
  107. huaweicloudsdkoms/v2/model/update_bandwidth_policy_req.py +114 -0
  108. huaweicloudsdkoms/v2/model/update_bandwidth_policy_request.py +139 -0
  109. huaweicloudsdkoms/v2/model/update_bandwidth_policy_response.py +85 -0
  110. huaweicloudsdkoms/v2/model/update_task_group_request.py +139 -0
  111. huaweicloudsdkoms/v2/model/update_task_group_response.py +85 -0
  112. huaweicloudsdkoms/v2/model/version.py +202 -0
  113. huaweicloudsdkoms/v2/oms_async_client.py +2263 -0
  114. huaweicloudsdkoms/v2/oms_client.py +2260 -0
  115. huaweicloudsdkoms/v2/region/__init__.py +0 -0
  116. huaweicloudsdkoms/v2/region/oms_region.py +91 -0
  117. huaweicloudsdkoms-3.1.160.dist-info/LICENSE +13 -0
  118. huaweicloudsdkoms-3.1.160.dist-info/METADATA +26 -0
  119. huaweicloudsdkoms-3.1.160.dist-info/RECORD +121 -0
  120. huaweicloudsdkoms-3.1.160.dist-info/WHEEL +5 -0
  121. huaweicloudsdkoms-3.1.160.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2263 @@
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 AsyncInvoker
14
+ except ImportError as e:
15
+ warnings.warn(str(e) + ", please check if you are using the same versions of 'huaweicloudsdkcore' and 'huaweicloudsdkoms'")
16
+
17
+
18
+ class OmsAsyncClient(Client):
19
+ def __init__(self):
20
+ super(OmsAsyncClient, self).__init__()
21
+ self.model_package = importlib.import_module("huaweicloudsdkoms.v2.model")
22
+
23
+ @classmethod
24
+ def new_builder(cls, clazz=None):
25
+ if not clazz:
26
+ client_builder = ClientBuilder(cls)
27
+ else:
28
+ if clazz.__name__ != "OmsAsyncClient":
29
+ raise TypeError("client type error, support client type is OmsAsyncClient")
30
+ client_builder = ClientBuilder(clazz)
31
+
32
+
33
+
34
+ return client_builder
35
+
36
+ def batch_update_tasks_async(self, request):
37
+ r"""批量更新任务
38
+
39
+ 批量更新迁移任务,可指定单个迁移任务组下所有的迁移任务或通过迁移任务ID来执行。
40
+
41
+ Please refer to HUAWEI cloud API Explorer for details.
42
+
43
+
44
+ :param request: Request instance for BatchUpdateTasks
45
+ :type request: :class:`huaweicloudsdkoms.v2.BatchUpdateTasksRequest`
46
+ :rtype: :class:`huaweicloudsdkoms.v2.BatchUpdateTasksResponse`
47
+ """
48
+ http_info = self._batch_update_tasks_http_info(request)
49
+ return self._call_api(**http_info)
50
+
51
+ def batch_update_tasks_async_invoker(self, request):
52
+ http_info = self._batch_update_tasks_http_info(request)
53
+ return AsyncInvoker(self, http_info)
54
+
55
+ def _batch_update_tasks_http_info(self, request):
56
+ http_info = {
57
+ "method": "POST",
58
+ "resource_path": "/v2/{project_id}/tasks/batch-update",
59
+ "request_type": request.__class__.__name__,
60
+ "response_type": "BatchUpdateTasksResponse"
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
+
71
+ query_params = []
72
+
73
+ header_params = {}
74
+
75
+ form_params = {}
76
+
77
+ body = None
78
+ if 'body' in local_var_params:
79
+ body = local_var_params['body']
80
+ if isinstance(request, SdkStreamRequest):
81
+ body = request.get_file_stream()
82
+
83
+ response_headers = []
84
+
85
+ header_params['Content-Type'] = http_utils.select_header_content_type(
86
+ ['application/json;charset=UTF-8'])
87
+
88
+ auth_settings = []
89
+
90
+ http_info["cname"] = cname
91
+ http_info["collection_formats"] = collection_formats
92
+ http_info["path_params"] = path_params
93
+ http_info["query_params"] = query_params
94
+ http_info["header_params"] = header_params
95
+ http_info["post_params"] = form_params
96
+ http_info["body"] = body
97
+ http_info["response_headers"] = response_headers
98
+
99
+ return http_info
100
+
101
+ def check_prefix_async(self, request):
102
+ r"""检查前缀是否在源端桶中存在
103
+
104
+ 检查前缀是否在源端桶中存在
105
+
106
+ Please refer to HUAWEI cloud API Explorer for details.
107
+
108
+
109
+ :param request: Request instance for CheckPrefix
110
+ :type request: :class:`huaweicloudsdkoms.v2.CheckPrefixRequest`
111
+ :rtype: :class:`huaweicloudsdkoms.v2.CheckPrefixResponse`
112
+ """
113
+ http_info = self._check_prefix_http_info(request)
114
+ return self._call_api(**http_info)
115
+
116
+ def check_prefix_async_invoker(self, request):
117
+ http_info = self._check_prefix_http_info(request)
118
+ return AsyncInvoker(self, http_info)
119
+
120
+ def _check_prefix_http_info(self, request):
121
+ http_info = {
122
+ "method": "POST",
123
+ "resource_path": "/v2/{project_id}/objectstorage/buckets/prefix",
124
+ "request_type": request.__class__.__name__,
125
+ "response_type": "CheckPrefixResponse"
126
+ }
127
+
128
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
129
+
130
+ cname = None
131
+
132
+ collection_formats = {}
133
+
134
+ path_params = {}
135
+
136
+ query_params = []
137
+
138
+ header_params = {}
139
+
140
+ form_params = {}
141
+
142
+ body = None
143
+ if 'body' in local_var_params:
144
+ body = local_var_params['body']
145
+ if isinstance(request, SdkStreamRequest):
146
+ body = request.get_file_stream()
147
+
148
+ response_headers = []
149
+
150
+ header_params['Content-Type'] = http_utils.select_header_content_type(
151
+ ['application/json;charset=UTF-8'])
152
+
153
+ auth_settings = []
154
+
155
+ http_info["cname"] = cname
156
+ http_info["collection_formats"] = collection_formats
157
+ http_info["path_params"] = path_params
158
+ http_info["query_params"] = query_params
159
+ http_info["header_params"] = header_params
160
+ http_info["post_params"] = form_params
161
+ http_info["body"] = body
162
+ http_info["response_headers"] = response_headers
163
+
164
+ return http_info
165
+
166
+ def create_sync_events_async(self, request):
167
+ r"""创建同步事件
168
+
169
+ 源端有对象需要进行同步时,调用该接口创建一个同步事件,系统将根据同步事件中包含的对象名称进行同步(目前只支持华北-北京四、华东-上海一地区)。
170
+
171
+ Please refer to HUAWEI cloud API Explorer for details.
172
+
173
+
174
+ :param request: Request instance for CreateSyncEvents
175
+ :type request: :class:`huaweicloudsdkoms.v2.CreateSyncEventsRequest`
176
+ :rtype: :class:`huaweicloudsdkoms.v2.CreateSyncEventsResponse`
177
+ """
178
+ http_info = self._create_sync_events_http_info(request)
179
+ return self._call_api(**http_info)
180
+
181
+ def create_sync_events_async_invoker(self, request):
182
+ http_info = self._create_sync_events_http_info(request)
183
+ return AsyncInvoker(self, http_info)
184
+
185
+ def _create_sync_events_http_info(self, request):
186
+ http_info = {
187
+ "method": "POST",
188
+ "resource_path": "/v2/{project_id}/sync-tasks/{sync_task_id}/events",
189
+ "request_type": request.__class__.__name__,
190
+ "response_type": "CreateSyncEventsResponse"
191
+ }
192
+
193
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
194
+
195
+ cname = None
196
+
197
+ collection_formats = {}
198
+
199
+ path_params = {}
200
+ if 'sync_task_id' in local_var_params:
201
+ path_params['sync_task_id'] = local_var_params['sync_task_id']
202
+
203
+ query_params = []
204
+
205
+ header_params = {}
206
+
207
+ form_params = {}
208
+
209
+ body = None
210
+ if 'body' in local_var_params:
211
+ body = local_var_params['body']
212
+ if isinstance(request, SdkStreamRequest):
213
+ body = request.get_file_stream()
214
+
215
+ response_headers = []
216
+
217
+ header_params['Content-Type'] = http_utils.select_header_content_type(
218
+ ['application/json;charset=UTF-8'])
219
+
220
+ auth_settings = []
221
+
222
+ http_info["cname"] = cname
223
+ http_info["collection_formats"] = collection_formats
224
+ http_info["path_params"] = path_params
225
+ http_info["query_params"] = query_params
226
+ http_info["header_params"] = header_params
227
+ http_info["post_params"] = form_params
228
+ http_info["body"] = body
229
+ http_info["response_headers"] = response_headers
230
+
231
+ return http_info
232
+
233
+ def create_sync_task_async(self, request):
234
+ r"""创建同步任务
235
+
236
+ 创建同步任务,创建成功后,任务会被自动启动,不需要额外调用启动任务命令。
237
+
238
+ Please refer to HUAWEI cloud API Explorer for details.
239
+
240
+
241
+ :param request: Request instance for CreateSyncTask
242
+ :type request: :class:`huaweicloudsdkoms.v2.CreateSyncTaskRequest`
243
+ :rtype: :class:`huaweicloudsdkoms.v2.CreateSyncTaskResponse`
244
+ """
245
+ http_info = self._create_sync_task_http_info(request)
246
+ return self._call_api(**http_info)
247
+
248
+ def create_sync_task_async_invoker(self, request):
249
+ http_info = self._create_sync_task_http_info(request)
250
+ return AsyncInvoker(self, http_info)
251
+
252
+ def _create_sync_task_http_info(self, request):
253
+ http_info = {
254
+ "method": "POST",
255
+ "resource_path": "/v2/{project_id}/sync-tasks",
256
+ "request_type": request.__class__.__name__,
257
+ "response_type": "CreateSyncTaskResponse"
258
+ }
259
+
260
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
261
+
262
+ cname = None
263
+
264
+ collection_formats = {}
265
+
266
+ path_params = {}
267
+
268
+ query_params = []
269
+
270
+ header_params = {}
271
+
272
+ form_params = {}
273
+
274
+ body = None
275
+ if 'body' in local_var_params:
276
+ body = local_var_params['body']
277
+ if isinstance(request, SdkStreamRequest):
278
+ body = request.get_file_stream()
279
+
280
+ response_headers = []
281
+
282
+ header_params['Content-Type'] = http_utils.select_header_content_type(
283
+ ['application/json;charset=UTF-8'])
284
+
285
+ auth_settings = []
286
+
287
+ http_info["cname"] = cname
288
+ http_info["collection_formats"] = collection_formats
289
+ http_info["path_params"] = path_params
290
+ http_info["query_params"] = query_params
291
+ http_info["header_params"] = header_params
292
+ http_info["post_params"] = form_params
293
+ http_info["body"] = body
294
+ http_info["response_headers"] = response_headers
295
+
296
+ return http_info
297
+
298
+ def create_task_async(self, request):
299
+ r"""创建迁移任务
300
+
301
+ 创建迁移任务,创建成功后,任务会被自动启动,不需要额外调用启动任务命令。
302
+
303
+ Please refer to HUAWEI cloud API Explorer for details.
304
+
305
+
306
+ :param request: Request instance for CreateTask
307
+ :type request: :class:`huaweicloudsdkoms.v2.CreateTaskRequest`
308
+ :rtype: :class:`huaweicloudsdkoms.v2.CreateTaskResponse`
309
+ """
310
+ http_info = self._create_task_http_info(request)
311
+ return self._call_api(**http_info)
312
+
313
+ def create_task_async_invoker(self, request):
314
+ http_info = self._create_task_http_info(request)
315
+ return AsyncInvoker(self, http_info)
316
+
317
+ def _create_task_http_info(self, request):
318
+ http_info = {
319
+ "method": "POST",
320
+ "resource_path": "/v2/{project_id}/tasks",
321
+ "request_type": request.__class__.__name__,
322
+ "response_type": "CreateTaskResponse"
323
+ }
324
+
325
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
326
+
327
+ cname = None
328
+
329
+ collection_formats = {}
330
+
331
+ path_params = {}
332
+
333
+ query_params = []
334
+
335
+ header_params = {}
336
+
337
+ form_params = {}
338
+
339
+ body = None
340
+ if 'body' in local_var_params:
341
+ body = local_var_params['body']
342
+ if isinstance(request, SdkStreamRequest):
343
+ body = request.get_file_stream()
344
+
345
+ response_headers = []
346
+
347
+ header_params['Content-Type'] = http_utils.select_header_content_type(
348
+ ['application/json;charset=UTF-8'])
349
+
350
+ auth_settings = []
351
+
352
+ http_info["cname"] = cname
353
+ http_info["collection_formats"] = collection_formats
354
+ http_info["path_params"] = path_params
355
+ http_info["query_params"] = query_params
356
+ http_info["header_params"] = header_params
357
+ http_info["post_params"] = form_params
358
+ http_info["body"] = body
359
+ http_info["response_headers"] = response_headers
360
+
361
+ return http_info
362
+
363
+ def create_task_group_async(self, request):
364
+ r"""创建迁移任务组
365
+
366
+ 创建迁移任务组,创建成功后,迁移任务组会自动创建迁移任务,不需要额外调用启动任务命令。
367
+
368
+ Please refer to HUAWEI cloud API Explorer for details.
369
+
370
+
371
+ :param request: Request instance for CreateTaskGroup
372
+ :type request: :class:`huaweicloudsdkoms.v2.CreateTaskGroupRequest`
373
+ :rtype: :class:`huaweicloudsdkoms.v2.CreateTaskGroupResponse`
374
+ """
375
+ http_info = self._create_task_group_http_info(request)
376
+ return self._call_api(**http_info)
377
+
378
+ def create_task_group_async_invoker(self, request):
379
+ http_info = self._create_task_group_http_info(request)
380
+ return AsyncInvoker(self, http_info)
381
+
382
+ def _create_task_group_http_info(self, request):
383
+ http_info = {
384
+ "method": "POST",
385
+ "resource_path": "/v2/{project_id}/taskgroups",
386
+ "request_type": request.__class__.__name__,
387
+ "response_type": "CreateTaskGroupResponse"
388
+ }
389
+
390
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
391
+
392
+ cname = None
393
+
394
+ collection_formats = {}
395
+
396
+ path_params = {}
397
+
398
+ query_params = []
399
+
400
+ header_params = {}
401
+
402
+ form_params = {}
403
+
404
+ body = None
405
+ if 'body' in local_var_params:
406
+ body = local_var_params['body']
407
+ if isinstance(request, SdkStreamRequest):
408
+ body = request.get_file_stream()
409
+
410
+ response_headers = []
411
+
412
+ header_params['Content-Type'] = http_utils.select_header_content_type(
413
+ ['application/json;charset=UTF-8'])
414
+
415
+ auth_settings = []
416
+
417
+ http_info["cname"] = cname
418
+ http_info["collection_formats"] = collection_formats
419
+ http_info["path_params"] = path_params
420
+ http_info["query_params"] = query_params
421
+ http_info["header_params"] = header_params
422
+ http_info["post_params"] = form_params
423
+ http_info["body"] = body
424
+ http_info["response_headers"] = response_headers
425
+
426
+ return http_info
427
+
428
+ def delete_sync_task_async(self, request):
429
+ r"""删除同步任务
430
+
431
+ 调用该接口删除同步任务。
432
+ 正在同步的任务不允许删除,如果删除会返回失败;若要删除,请先行暂停任务。
433
+
434
+ Please refer to HUAWEI cloud API Explorer for details.
435
+
436
+
437
+ :param request: Request instance for DeleteSyncTask
438
+ :type request: :class:`huaweicloudsdkoms.v2.DeleteSyncTaskRequest`
439
+ :rtype: :class:`huaweicloudsdkoms.v2.DeleteSyncTaskResponse`
440
+ """
441
+ http_info = self._delete_sync_task_http_info(request)
442
+ return self._call_api(**http_info)
443
+
444
+ def delete_sync_task_async_invoker(self, request):
445
+ http_info = self._delete_sync_task_http_info(request)
446
+ return AsyncInvoker(self, http_info)
447
+
448
+ def _delete_sync_task_http_info(self, request):
449
+ http_info = {
450
+ "method": "DELETE",
451
+ "resource_path": "/v2/{project_id}/sync-tasks/{sync_task_id}",
452
+ "request_type": request.__class__.__name__,
453
+ "response_type": "DeleteSyncTaskResponse"
454
+ }
455
+
456
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
457
+
458
+ cname = None
459
+
460
+ collection_formats = {}
461
+
462
+ path_params = {}
463
+ if 'sync_task_id' in local_var_params:
464
+ path_params['sync_task_id'] = local_var_params['sync_task_id']
465
+
466
+ query_params = []
467
+
468
+ header_params = {}
469
+
470
+ form_params = {}
471
+
472
+ body = None
473
+ if isinstance(request, SdkStreamRequest):
474
+ body = request.get_file_stream()
475
+
476
+ response_headers = []
477
+
478
+ header_params['Content-Type'] = http_utils.select_header_content_type(
479
+ ['application/json'])
480
+
481
+ auth_settings = []
482
+
483
+ http_info["cname"] = cname
484
+ http_info["collection_formats"] = collection_formats
485
+ http_info["path_params"] = path_params
486
+ http_info["query_params"] = query_params
487
+ http_info["header_params"] = header_params
488
+ http_info["post_params"] = form_params
489
+ http_info["body"] = body
490
+ http_info["response_headers"] = response_headers
491
+
492
+ return http_info
493
+
494
+ def delete_task_async(self, request):
495
+ r"""删除迁移任务
496
+
497
+ 调用该接口删除迁移任务。
498
+ 正在运行的任务不允许删除,如果删除会返回失败;若要删除,请先行暂停任务。
499
+
500
+ Please refer to HUAWEI cloud API Explorer for details.
501
+
502
+
503
+ :param request: Request instance for DeleteTask
504
+ :type request: :class:`huaweicloudsdkoms.v2.DeleteTaskRequest`
505
+ :rtype: :class:`huaweicloudsdkoms.v2.DeleteTaskResponse`
506
+ """
507
+ http_info = self._delete_task_http_info(request)
508
+ return self._call_api(**http_info)
509
+
510
+ def delete_task_async_invoker(self, request):
511
+ http_info = self._delete_task_http_info(request)
512
+ return AsyncInvoker(self, http_info)
513
+
514
+ def _delete_task_http_info(self, request):
515
+ http_info = {
516
+ "method": "DELETE",
517
+ "resource_path": "/v2/{project_id}/tasks/{task_id}",
518
+ "request_type": request.__class__.__name__,
519
+ "response_type": "DeleteTaskResponse"
520
+ }
521
+
522
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
523
+
524
+ cname = None
525
+
526
+ collection_formats = {}
527
+
528
+ path_params = {}
529
+ if 'task_id' in local_var_params:
530
+ path_params['task_id'] = local_var_params['task_id']
531
+
532
+ query_params = []
533
+
534
+ header_params = {}
535
+
536
+ form_params = {}
537
+
538
+ body = None
539
+ if isinstance(request, SdkStreamRequest):
540
+ body = request.get_file_stream()
541
+
542
+ response_headers = []
543
+
544
+ header_params['Content-Type'] = http_utils.select_header_content_type(
545
+ ['application/json'])
546
+
547
+ auth_settings = []
548
+
549
+ http_info["cname"] = cname
550
+ http_info["collection_formats"] = collection_formats
551
+ http_info["path_params"] = path_params
552
+ http_info["query_params"] = query_params
553
+ http_info["header_params"] = header_params
554
+ http_info["post_params"] = form_params
555
+ http_info["body"] = body
556
+ http_info["response_headers"] = response_headers
557
+
558
+ return http_info
559
+
560
+ def delete_task_group_async(self, request):
561
+ r"""删除指定id的迁移任务组
562
+
563
+ 删除指定的迁移任务组.
564
+ 创建任务中、监控中、暂停中状态的任务不允许删除,如果删除会返回失败;若要删除,请先行暂停任务。
565
+
566
+ Please refer to HUAWEI cloud API Explorer for details.
567
+
568
+
569
+ :param request: Request instance for DeleteTaskGroup
570
+ :type request: :class:`huaweicloudsdkoms.v2.DeleteTaskGroupRequest`
571
+ :rtype: :class:`huaweicloudsdkoms.v2.DeleteTaskGroupResponse`
572
+ """
573
+ http_info = self._delete_task_group_http_info(request)
574
+ return self._call_api(**http_info)
575
+
576
+ def delete_task_group_async_invoker(self, request):
577
+ http_info = self._delete_task_group_http_info(request)
578
+ return AsyncInvoker(self, http_info)
579
+
580
+ def _delete_task_group_http_info(self, request):
581
+ http_info = {
582
+ "method": "DELETE",
583
+ "resource_path": "/v2/{project_id}/taskgroups/{group_id}",
584
+ "request_type": request.__class__.__name__,
585
+ "response_type": "DeleteTaskGroupResponse"
586
+ }
587
+
588
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
589
+
590
+ cname = None
591
+
592
+ collection_formats = {}
593
+
594
+ path_params = {}
595
+ if 'group_id' in local_var_params:
596
+ path_params['group_id'] = local_var_params['group_id']
597
+
598
+ query_params = []
599
+
600
+ header_params = {}
601
+
602
+ form_params = {}
603
+
604
+ body = None
605
+ if isinstance(request, SdkStreamRequest):
606
+ body = request.get_file_stream()
607
+
608
+ response_headers = []
609
+
610
+ header_params['Content-Type'] = http_utils.select_header_content_type(
611
+ ['application/json'])
612
+
613
+ auth_settings = []
614
+
615
+ http_info["cname"] = cname
616
+ http_info["collection_formats"] = collection_formats
617
+ http_info["path_params"] = path_params
618
+ http_info["query_params"] = query_params
619
+ http_info["header_params"] = header_params
620
+ http_info["post_params"] = form_params
621
+ http_info["body"] = body
622
+ http_info["response_headers"] = response_headers
623
+
624
+ return http_info
625
+
626
+ def list_sync_task_statistic_async(self, request):
627
+ r"""查询指定ID的同步任务统计数据
628
+
629
+ 查询指定ID同步任务的接收同步请求对象数、同步成功对象数、同步失败对象数、同步跳过对象数、同步成功对象容量统计数据(目前只支持华北-北京四、华东-上海一地区)。
630
+
631
+ Please refer to HUAWEI cloud API Explorer for details.
632
+
633
+
634
+ :param request: Request instance for ListSyncTaskStatistic
635
+ :type request: :class:`huaweicloudsdkoms.v2.ListSyncTaskStatisticRequest`
636
+ :rtype: :class:`huaweicloudsdkoms.v2.ListSyncTaskStatisticResponse`
637
+ """
638
+ http_info = self._list_sync_task_statistic_http_info(request)
639
+ return self._call_api(**http_info)
640
+
641
+ def list_sync_task_statistic_async_invoker(self, request):
642
+ http_info = self._list_sync_task_statistic_http_info(request)
643
+ return AsyncInvoker(self, http_info)
644
+
645
+ def _list_sync_task_statistic_http_info(self, request):
646
+ http_info = {
647
+ "method": "GET",
648
+ "resource_path": "/v2/{project_id}/sync-tasks/{sync_task_id}/statistics",
649
+ "request_type": request.__class__.__name__,
650
+ "response_type": "ListSyncTaskStatisticResponse"
651
+ }
652
+
653
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
654
+
655
+ cname = None
656
+
657
+ collection_formats = {}
658
+
659
+ path_params = {}
660
+ if 'sync_task_id' in local_var_params:
661
+ path_params['sync_task_id'] = local_var_params['sync_task_id']
662
+
663
+ query_params = []
664
+ if 'data_type' in local_var_params:
665
+ query_params.append(('data_type', local_var_params['data_type']))
666
+ if 'start_time' in local_var_params:
667
+ query_params.append(('start_time', local_var_params['start_time']))
668
+ if 'end_time' in local_var_params:
669
+ query_params.append(('end_time', local_var_params['end_time']))
670
+
671
+ header_params = {}
672
+
673
+ form_params = {}
674
+
675
+ body = None
676
+ if isinstance(request, SdkStreamRequest):
677
+ body = request.get_file_stream()
678
+
679
+ response_headers = []
680
+
681
+ header_params['Content-Type'] = http_utils.select_header_content_type(
682
+ ['application/json'])
683
+
684
+ auth_settings = []
685
+
686
+ http_info["cname"] = cname
687
+ http_info["collection_formats"] = collection_formats
688
+ http_info["path_params"] = path_params
689
+ http_info["query_params"] = query_params
690
+ http_info["header_params"] = header_params
691
+ http_info["post_params"] = form_params
692
+ http_info["body"] = body
693
+ http_info["response_headers"] = response_headers
694
+
695
+ return http_info
696
+
697
+ def list_sync_tasks_async(self, request):
698
+ r"""查询同步任务列表
699
+
700
+ 查询用户名下所有同步任务信息
701
+
702
+ Please refer to HUAWEI cloud API Explorer for details.
703
+
704
+
705
+ :param request: Request instance for ListSyncTasks
706
+ :type request: :class:`huaweicloudsdkoms.v2.ListSyncTasksRequest`
707
+ :rtype: :class:`huaweicloudsdkoms.v2.ListSyncTasksResponse`
708
+ """
709
+ http_info = self._list_sync_tasks_http_info(request)
710
+ return self._call_api(**http_info)
711
+
712
+ def list_sync_tasks_async_invoker(self, request):
713
+ http_info = self._list_sync_tasks_http_info(request)
714
+ return AsyncInvoker(self, http_info)
715
+
716
+ def _list_sync_tasks_http_info(self, request):
717
+ http_info = {
718
+ "method": "GET",
719
+ "resource_path": "/v2/{project_id}/sync-tasks",
720
+ "request_type": request.__class__.__name__,
721
+ "response_type": "ListSyncTasksResponse"
722
+ }
723
+
724
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
725
+
726
+ cname = None
727
+
728
+ collection_formats = {}
729
+
730
+ path_params = {}
731
+
732
+ query_params = []
733
+ if 'limit' in local_var_params:
734
+ query_params.append(('limit', local_var_params['limit']))
735
+ if 'offset' in local_var_params:
736
+ query_params.append(('offset', local_var_params['offset']))
737
+ if 'status' in local_var_params:
738
+ query_params.append(('status', local_var_params['status']))
739
+
740
+ header_params = {}
741
+
742
+ form_params = {}
743
+
744
+ body = None
745
+ if isinstance(request, SdkStreamRequest):
746
+ body = request.get_file_stream()
747
+
748
+ response_headers = []
749
+
750
+ header_params['Content-Type'] = http_utils.select_header_content_type(
751
+ ['application/json'])
752
+
753
+ auth_settings = []
754
+
755
+ http_info["cname"] = cname
756
+ http_info["collection_formats"] = collection_formats
757
+ http_info["path_params"] = path_params
758
+ http_info["query_params"] = query_params
759
+ http_info["header_params"] = header_params
760
+ http_info["post_params"] = form_params
761
+ http_info["body"] = body
762
+ http_info["response_headers"] = response_headers
763
+
764
+ return http_info
765
+
766
+ def list_task_group_async(self, request):
767
+ r"""查询迁移任务组列表
768
+
769
+ 查询用户账户下的任务组信息
770
+
771
+ Please refer to HUAWEI cloud API Explorer for details.
772
+
773
+
774
+ :param request: Request instance for ListTaskGroup
775
+ :type request: :class:`huaweicloudsdkoms.v2.ListTaskGroupRequest`
776
+ :rtype: :class:`huaweicloudsdkoms.v2.ListTaskGroupResponse`
777
+ """
778
+ http_info = self._list_task_group_http_info(request)
779
+ return self._call_api(**http_info)
780
+
781
+ def list_task_group_async_invoker(self, request):
782
+ http_info = self._list_task_group_http_info(request)
783
+ return AsyncInvoker(self, http_info)
784
+
785
+ def _list_task_group_http_info(self, request):
786
+ http_info = {
787
+ "method": "GET",
788
+ "resource_path": "/v2/{project_id}/taskgroups",
789
+ "request_type": request.__class__.__name__,
790
+ "response_type": "ListTaskGroupResponse"
791
+ }
792
+
793
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
794
+
795
+ cname = None
796
+
797
+ collection_formats = {}
798
+
799
+ path_params = {}
800
+
801
+ query_params = []
802
+ if 'limit' in local_var_params:
803
+ query_params.append(('limit', local_var_params['limit']))
804
+ if 'offset' in local_var_params:
805
+ query_params.append(('offset', local_var_params['offset']))
806
+ if 'status' in local_var_params:
807
+ query_params.append(('status', local_var_params['status']))
808
+
809
+ header_params = {}
810
+
811
+ form_params = {}
812
+
813
+ body = None
814
+ if isinstance(request, SdkStreamRequest):
815
+ body = request.get_file_stream()
816
+
817
+ response_headers = []
818
+
819
+ header_params['Content-Type'] = http_utils.select_header_content_type(
820
+ ['application/json'])
821
+
822
+ auth_settings = []
823
+
824
+ http_info["cname"] = cname
825
+ http_info["collection_formats"] = collection_formats
826
+ http_info["path_params"] = path_params
827
+ http_info["query_params"] = query_params
828
+ http_info["header_params"] = header_params
829
+ http_info["post_params"] = form_params
830
+ http_info["body"] = body
831
+ http_info["response_headers"] = response_headers
832
+
833
+ return http_info
834
+
835
+ def list_tasks_async(self, request):
836
+ r"""查询迁移任务列表
837
+
838
+ 查询用户账户下的所有任务信息。
839
+
840
+ Please refer to HUAWEI cloud API Explorer for details.
841
+
842
+
843
+ :param request: Request instance for ListTasks
844
+ :type request: :class:`huaweicloudsdkoms.v2.ListTasksRequest`
845
+ :rtype: :class:`huaweicloudsdkoms.v2.ListTasksResponse`
846
+ """
847
+ http_info = self._list_tasks_http_info(request)
848
+ return self._call_api(**http_info)
849
+
850
+ def list_tasks_async_invoker(self, request):
851
+ http_info = self._list_tasks_http_info(request)
852
+ return AsyncInvoker(self, http_info)
853
+
854
+ def _list_tasks_http_info(self, request):
855
+ http_info = {
856
+ "method": "GET",
857
+ "resource_path": "/v2/{project_id}/tasks",
858
+ "request_type": request.__class__.__name__,
859
+ "response_type": "ListTasksResponse"
860
+ }
861
+
862
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
863
+
864
+ cname = None
865
+
866
+ collection_formats = {}
867
+
868
+ path_params = {}
869
+
870
+ query_params = []
871
+ if 'group_id' in local_var_params:
872
+ query_params.append(('group_id', local_var_params['group_id']))
873
+ if 'limit' in local_var_params:
874
+ query_params.append(('limit', local_var_params['limit']))
875
+ if 'offset' in local_var_params:
876
+ query_params.append(('offset', local_var_params['offset']))
877
+ if 'status' in local_var_params:
878
+ query_params.append(('status', local_var_params['status']))
879
+
880
+ header_params = {}
881
+
882
+ form_params = {}
883
+
884
+ body = None
885
+ if isinstance(request, SdkStreamRequest):
886
+ body = request.get_file_stream()
887
+
888
+ response_headers = []
889
+
890
+ header_params['Content-Type'] = http_utils.select_header_content_type(
891
+ ['application/json'])
892
+
893
+ auth_settings = []
894
+
895
+ http_info["cname"] = cname
896
+ http_info["collection_formats"] = collection_formats
897
+ http_info["path_params"] = path_params
898
+ http_info["query_params"] = query_params
899
+ http_info["header_params"] = header_params
900
+ http_info["post_params"] = form_params
901
+ http_info["body"] = body
902
+ http_info["response_headers"] = response_headers
903
+
904
+ return http_info
905
+
906
+ def retry_task_group_async(self, request):
907
+ r"""对已经失败的指定id迁移任务组进行重启
908
+
909
+ 当迁移任务组处于迁移失败状态时,调用该接口重启指定id的迁移任务组。
910
+
911
+ Please refer to HUAWEI cloud API Explorer for details.
912
+
913
+
914
+ :param request: Request instance for RetryTaskGroup
915
+ :type request: :class:`huaweicloudsdkoms.v2.RetryTaskGroupRequest`
916
+ :rtype: :class:`huaweicloudsdkoms.v2.RetryTaskGroupResponse`
917
+ """
918
+ http_info = self._retry_task_group_http_info(request)
919
+ return self._call_api(**http_info)
920
+
921
+ def retry_task_group_async_invoker(self, request):
922
+ http_info = self._retry_task_group_http_info(request)
923
+ return AsyncInvoker(self, http_info)
924
+
925
+ def _retry_task_group_http_info(self, request):
926
+ http_info = {
927
+ "method": "PUT",
928
+ "resource_path": "/v2/{project_id}/taskgroups/{group_id}/retry",
929
+ "request_type": request.__class__.__name__,
930
+ "response_type": "RetryTaskGroupResponse"
931
+ }
932
+
933
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
934
+
935
+ cname = None
936
+
937
+ collection_formats = {}
938
+
939
+ path_params = {}
940
+ if 'group_id' in local_var_params:
941
+ path_params['group_id'] = local_var_params['group_id']
942
+
943
+ query_params = []
944
+
945
+ header_params = {}
946
+
947
+ form_params = {}
948
+
949
+ body = None
950
+ if 'body' in local_var_params:
951
+ body = local_var_params['body']
952
+ if isinstance(request, SdkStreamRequest):
953
+ body = request.get_file_stream()
954
+
955
+ response_headers = []
956
+
957
+ header_params['Content-Type'] = http_utils.select_header_content_type(
958
+ ['application/json;charset=UTF-8'])
959
+
960
+ auth_settings = []
961
+
962
+ http_info["cname"] = cname
963
+ http_info["collection_formats"] = collection_formats
964
+ http_info["path_params"] = path_params
965
+ http_info["query_params"] = query_params
966
+ http_info["header_params"] = header_params
967
+ http_info["post_params"] = form_params
968
+ http_info["body"] = body
969
+ http_info["response_headers"] = response_headers
970
+
971
+ return http_info
972
+
973
+ def show_bucket_list_async(self, request):
974
+ r"""查询桶列表
975
+
976
+ 查询桶列表
977
+
978
+ Please refer to HUAWEI cloud API Explorer for details.
979
+
980
+
981
+ :param request: Request instance for ShowBucketList
982
+ :type request: :class:`huaweicloudsdkoms.v2.ShowBucketListRequest`
983
+ :rtype: :class:`huaweicloudsdkoms.v2.ShowBucketListResponse`
984
+ """
985
+ http_info = self._show_bucket_list_http_info(request)
986
+ return self._call_api(**http_info)
987
+
988
+ def show_bucket_list_async_invoker(self, request):
989
+ http_info = self._show_bucket_list_http_info(request)
990
+ return AsyncInvoker(self, http_info)
991
+
992
+ def _show_bucket_list_http_info(self, request):
993
+ http_info = {
994
+ "method": "POST",
995
+ "resource_path": "/v2/{project_id}/objectstorage/buckets",
996
+ "request_type": request.__class__.__name__,
997
+ "response_type": "ShowBucketListResponse"
998
+ }
999
+
1000
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1001
+
1002
+ cname = None
1003
+
1004
+ collection_formats = {}
1005
+
1006
+ path_params = {}
1007
+
1008
+ query_params = []
1009
+
1010
+ header_params = {}
1011
+
1012
+ form_params = {}
1013
+
1014
+ body = None
1015
+ if 'body' in local_var_params:
1016
+ body = local_var_params['body']
1017
+ if isinstance(request, SdkStreamRequest):
1018
+ body = request.get_file_stream()
1019
+
1020
+ response_headers = []
1021
+
1022
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1023
+ ['application/json;charset=UTF-8'])
1024
+
1025
+ auth_settings = []
1026
+
1027
+ http_info["cname"] = cname
1028
+ http_info["collection_formats"] = collection_formats
1029
+ http_info["path_params"] = path_params
1030
+ http_info["query_params"] = query_params
1031
+ http_info["header_params"] = header_params
1032
+ http_info["post_params"] = form_params
1033
+ http_info["body"] = body
1034
+ http_info["response_headers"] = response_headers
1035
+
1036
+ return http_info
1037
+
1038
+ def show_bucket_objects_async(self, request):
1039
+ r"""查询桶对象列表
1040
+
1041
+ 查询桶对象列表
1042
+
1043
+ Please refer to HUAWEI cloud API Explorer for details.
1044
+
1045
+
1046
+ :param request: Request instance for ShowBucketObjects
1047
+ :type request: :class:`huaweicloudsdkoms.v2.ShowBucketObjectsRequest`
1048
+ :rtype: :class:`huaweicloudsdkoms.v2.ShowBucketObjectsResponse`
1049
+ """
1050
+ http_info = self._show_bucket_objects_http_info(request)
1051
+ return self._call_api(**http_info)
1052
+
1053
+ def show_bucket_objects_async_invoker(self, request):
1054
+ http_info = self._show_bucket_objects_http_info(request)
1055
+ return AsyncInvoker(self, http_info)
1056
+
1057
+ def _show_bucket_objects_http_info(self, request):
1058
+ http_info = {
1059
+ "method": "POST",
1060
+ "resource_path": "/v2/{project_id}/objectstorage/buckets/objects",
1061
+ "request_type": request.__class__.__name__,
1062
+ "response_type": "ShowBucketObjectsResponse"
1063
+ }
1064
+
1065
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1066
+
1067
+ cname = None
1068
+
1069
+ collection_formats = {}
1070
+
1071
+ path_params = {}
1072
+
1073
+ query_params = []
1074
+
1075
+ header_params = {}
1076
+
1077
+ form_params = {}
1078
+
1079
+ body = None
1080
+ if 'body' in local_var_params:
1081
+ body = local_var_params['body']
1082
+ if isinstance(request, SdkStreamRequest):
1083
+ body = request.get_file_stream()
1084
+
1085
+ response_headers = []
1086
+
1087
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1088
+ ['application/json;charset=UTF-8'])
1089
+
1090
+ auth_settings = []
1091
+
1092
+ http_info["cname"] = cname
1093
+ http_info["collection_formats"] = collection_formats
1094
+ http_info["path_params"] = path_params
1095
+ http_info["query_params"] = query_params
1096
+ http_info["header_params"] = header_params
1097
+ http_info["post_params"] = form_params
1098
+ http_info["body"] = body
1099
+ http_info["response_headers"] = response_headers
1100
+
1101
+ return http_info
1102
+
1103
+ def show_bucket_region_async(self, request):
1104
+ r"""查询桶对应的region
1105
+
1106
+ 查询桶对应的region
1107
+
1108
+ Please refer to HUAWEI cloud API Explorer for details.
1109
+
1110
+
1111
+ :param request: Request instance for ShowBucketRegion
1112
+ :type request: :class:`huaweicloudsdkoms.v2.ShowBucketRegionRequest`
1113
+ :rtype: :class:`huaweicloudsdkoms.v2.ShowBucketRegionResponse`
1114
+ """
1115
+ http_info = self._show_bucket_region_http_info(request)
1116
+ return self._call_api(**http_info)
1117
+
1118
+ def show_bucket_region_async_invoker(self, request):
1119
+ http_info = self._show_bucket_region_http_info(request)
1120
+ return AsyncInvoker(self, http_info)
1121
+
1122
+ def _show_bucket_region_http_info(self, request):
1123
+ http_info = {
1124
+ "method": "POST",
1125
+ "resource_path": "/v2/{project_id}/objectstorage/buckets/regions",
1126
+ "request_type": request.__class__.__name__,
1127
+ "response_type": "ShowBucketRegionResponse"
1128
+ }
1129
+
1130
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1131
+
1132
+ cname = None
1133
+
1134
+ collection_formats = {}
1135
+
1136
+ path_params = {}
1137
+
1138
+ query_params = []
1139
+
1140
+ header_params = {}
1141
+
1142
+ form_params = {}
1143
+
1144
+ body = None
1145
+ if 'body' in local_var_params:
1146
+ body = local_var_params['body']
1147
+ if isinstance(request, SdkStreamRequest):
1148
+ body = request.get_file_stream()
1149
+
1150
+ response_headers = []
1151
+
1152
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1153
+ ['application/json;charset=UTF-8'])
1154
+
1155
+ auth_settings = []
1156
+
1157
+ http_info["cname"] = cname
1158
+ http_info["collection_formats"] = collection_formats
1159
+ http_info["path_params"] = path_params
1160
+ http_info["query_params"] = query_params
1161
+ http_info["header_params"] = header_params
1162
+ http_info["post_params"] = form_params
1163
+ http_info["body"] = body
1164
+ http_info["response_headers"] = response_headers
1165
+
1166
+ return http_info
1167
+
1168
+ def show_cdn_info_async(self, request):
1169
+ r"""查桶对应的CDN信息
1170
+
1171
+ 查桶对应的CDN信息
1172
+
1173
+ Please refer to HUAWEI cloud API Explorer for details.
1174
+
1175
+
1176
+ :param request: Request instance for ShowCdnInfo
1177
+ :type request: :class:`huaweicloudsdkoms.v2.ShowCdnInfoRequest`
1178
+ :rtype: :class:`huaweicloudsdkoms.v2.ShowCdnInfoResponse`
1179
+ """
1180
+ http_info = self._show_cdn_info_http_info(request)
1181
+ return self._call_api(**http_info)
1182
+
1183
+ def show_cdn_info_async_invoker(self, request):
1184
+ http_info = self._show_cdn_info_http_info(request)
1185
+ return AsyncInvoker(self, http_info)
1186
+
1187
+ def _show_cdn_info_http_info(self, request):
1188
+ http_info = {
1189
+ "method": "POST",
1190
+ "resource_path": "/v2/{project_id}/objectstorage/buckets/cdn-info",
1191
+ "request_type": request.__class__.__name__,
1192
+ "response_type": "ShowCdnInfoResponse"
1193
+ }
1194
+
1195
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1196
+
1197
+ cname = None
1198
+
1199
+ collection_formats = {}
1200
+
1201
+ path_params = {}
1202
+
1203
+ query_params = []
1204
+
1205
+ header_params = {}
1206
+
1207
+ form_params = {}
1208
+
1209
+ body = None
1210
+ if 'body' in local_var_params:
1211
+ body = local_var_params['body']
1212
+ if isinstance(request, SdkStreamRequest):
1213
+ body = request.get_file_stream()
1214
+
1215
+ response_headers = []
1216
+
1217
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1218
+ ['application/json;charset=UTF-8'])
1219
+
1220
+ auth_settings = []
1221
+
1222
+ http_info["cname"] = cname
1223
+ http_info["collection_formats"] = collection_formats
1224
+ http_info["path_params"] = path_params
1225
+ http_info["query_params"] = query_params
1226
+ http_info["header_params"] = header_params
1227
+ http_info["post_params"] = form_params
1228
+ http_info["body"] = body
1229
+ http_info["response_headers"] = response_headers
1230
+
1231
+ return http_info
1232
+
1233
+ def show_cloud_type_async(self, request):
1234
+ r"""查询所有支持的云厂商
1235
+
1236
+ 查询所有支持的云厂商
1237
+
1238
+ Please refer to HUAWEI cloud API Explorer for details.
1239
+
1240
+
1241
+ :param request: Request instance for ShowCloudType
1242
+ :type request: :class:`huaweicloudsdkoms.v2.ShowCloudTypeRequest`
1243
+ :rtype: :class:`huaweicloudsdkoms.v2.ShowCloudTypeResponse`
1244
+ """
1245
+ http_info = self._show_cloud_type_http_info(request)
1246
+ return self._call_api(**http_info)
1247
+
1248
+ def show_cloud_type_async_invoker(self, request):
1249
+ http_info = self._show_cloud_type_http_info(request)
1250
+ return AsyncInvoker(self, http_info)
1251
+
1252
+ def _show_cloud_type_http_info(self, request):
1253
+ http_info = {
1254
+ "method": "GET",
1255
+ "resource_path": "/v2/{project_id}/objectstorage/cloud-type",
1256
+ "request_type": request.__class__.__name__,
1257
+ "response_type": "ShowCloudTypeResponse"
1258
+ }
1259
+
1260
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1261
+
1262
+ cname = None
1263
+
1264
+ collection_formats = {}
1265
+
1266
+ path_params = {}
1267
+
1268
+ query_params = []
1269
+ if 'type' in local_var_params:
1270
+ query_params.append(('type', local_var_params['type']))
1271
+
1272
+ header_params = {}
1273
+
1274
+ form_params = {}
1275
+
1276
+ body = None
1277
+ if isinstance(request, SdkStreamRequest):
1278
+ body = request.get_file_stream()
1279
+
1280
+ response_headers = []
1281
+
1282
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1283
+ ['application/json'])
1284
+
1285
+ auth_settings = []
1286
+
1287
+ http_info["cname"] = cname
1288
+ http_info["collection_formats"] = collection_formats
1289
+ http_info["path_params"] = path_params
1290
+ http_info["query_params"] = query_params
1291
+ http_info["header_params"] = header_params
1292
+ http_info["post_params"] = form_params
1293
+ http_info["body"] = body
1294
+ http_info["response_headers"] = response_headers
1295
+
1296
+ return http_info
1297
+
1298
+ def show_region_info_async(self, request):
1299
+ r"""查询云厂商支持的reigon
1300
+
1301
+ 查询云厂商支持的reigon
1302
+
1303
+ Please refer to HUAWEI cloud API Explorer for details.
1304
+
1305
+
1306
+ :param request: Request instance for ShowRegionInfo
1307
+ :type request: :class:`huaweicloudsdkoms.v2.ShowRegionInfoRequest`
1308
+ :rtype: :class:`huaweicloudsdkoms.v2.ShowRegionInfoResponse`
1309
+ """
1310
+ http_info = self._show_region_info_http_info(request)
1311
+ return self._call_api(**http_info)
1312
+
1313
+ def show_region_info_async_invoker(self, request):
1314
+ http_info = self._show_region_info_http_info(request)
1315
+ return AsyncInvoker(self, http_info)
1316
+
1317
+ def _show_region_info_http_info(self, request):
1318
+ http_info = {
1319
+ "method": "GET",
1320
+ "resource_path": "/v2/{project_id}/objectstorage/data-center",
1321
+ "request_type": request.__class__.__name__,
1322
+ "response_type": "ShowRegionInfoResponse"
1323
+ }
1324
+
1325
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1326
+
1327
+ cname = None
1328
+
1329
+ collection_formats = {}
1330
+
1331
+ path_params = {}
1332
+
1333
+ query_params = []
1334
+
1335
+ header_params = {}
1336
+
1337
+ form_params = {}
1338
+
1339
+ body = None
1340
+ if isinstance(request, SdkStreamRequest):
1341
+ body = request.get_file_stream()
1342
+
1343
+ response_headers = []
1344
+
1345
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1346
+ ['application/json'])
1347
+
1348
+ auth_settings = []
1349
+
1350
+ http_info["cname"] = cname
1351
+ http_info["collection_formats"] = collection_formats
1352
+ http_info["path_params"] = path_params
1353
+ http_info["query_params"] = query_params
1354
+ http_info["header_params"] = header_params
1355
+ http_info["post_params"] = form_params
1356
+ http_info["body"] = body
1357
+ http_info["response_headers"] = response_headers
1358
+
1359
+ return http_info
1360
+
1361
+ def show_sync_task_async(self, request):
1362
+ r"""查询指定ID的同步任务详情
1363
+
1364
+ 查询指定ID的同步任务详情。
1365
+
1366
+ Please refer to HUAWEI cloud API Explorer for details.
1367
+
1368
+
1369
+ :param request: Request instance for ShowSyncTask
1370
+ :type request: :class:`huaweicloudsdkoms.v2.ShowSyncTaskRequest`
1371
+ :rtype: :class:`huaweicloudsdkoms.v2.ShowSyncTaskResponse`
1372
+ """
1373
+ http_info = self._show_sync_task_http_info(request)
1374
+ return self._call_api(**http_info)
1375
+
1376
+ def show_sync_task_async_invoker(self, request):
1377
+ http_info = self._show_sync_task_http_info(request)
1378
+ return AsyncInvoker(self, http_info)
1379
+
1380
+ def _show_sync_task_http_info(self, request):
1381
+ http_info = {
1382
+ "method": "GET",
1383
+ "resource_path": "/v2/{project_id}/sync-tasks/{sync_task_id}",
1384
+ "request_type": request.__class__.__name__,
1385
+ "response_type": "ShowSyncTaskResponse"
1386
+ }
1387
+
1388
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1389
+
1390
+ cname = None
1391
+
1392
+ collection_formats = {}
1393
+
1394
+ path_params = {}
1395
+ if 'sync_task_id' in local_var_params:
1396
+ path_params['sync_task_id'] = local_var_params['sync_task_id']
1397
+
1398
+ query_params = []
1399
+ if 'query_time' in local_var_params:
1400
+ query_params.append(('query_time', local_var_params['query_time']))
1401
+
1402
+ header_params = {}
1403
+
1404
+ form_params = {}
1405
+
1406
+ body = None
1407
+ if isinstance(request, SdkStreamRequest):
1408
+ body = request.get_file_stream()
1409
+
1410
+ response_headers = []
1411
+
1412
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1413
+ ['application/json'])
1414
+
1415
+ auth_settings = []
1416
+
1417
+ http_info["cname"] = cname
1418
+ http_info["collection_formats"] = collection_formats
1419
+ http_info["path_params"] = path_params
1420
+ http_info["query_params"] = query_params
1421
+ http_info["header_params"] = header_params
1422
+ http_info["post_params"] = form_params
1423
+ http_info["body"] = body
1424
+ http_info["response_headers"] = response_headers
1425
+
1426
+ return http_info
1427
+
1428
+ def show_task_async(self, request):
1429
+ r"""查询指定ID的任务详情
1430
+
1431
+ 查询指定ID的任务详情。
1432
+
1433
+ Please refer to HUAWEI cloud API Explorer for details.
1434
+
1435
+
1436
+ :param request: Request instance for ShowTask
1437
+ :type request: :class:`huaweicloudsdkoms.v2.ShowTaskRequest`
1438
+ :rtype: :class:`huaweicloudsdkoms.v2.ShowTaskResponse`
1439
+ """
1440
+ http_info = self._show_task_http_info(request)
1441
+ return self._call_api(**http_info)
1442
+
1443
+ def show_task_async_invoker(self, request):
1444
+ http_info = self._show_task_http_info(request)
1445
+ return AsyncInvoker(self, http_info)
1446
+
1447
+ def _show_task_http_info(self, request):
1448
+ http_info = {
1449
+ "method": "GET",
1450
+ "resource_path": "/v2/{project_id}/tasks/{task_id}",
1451
+ "request_type": request.__class__.__name__,
1452
+ "response_type": "ShowTaskResponse"
1453
+ }
1454
+
1455
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1456
+
1457
+ cname = None
1458
+
1459
+ collection_formats = {}
1460
+
1461
+ path_params = {}
1462
+ if 'task_id' in local_var_params:
1463
+ path_params['task_id'] = local_var_params['task_id']
1464
+
1465
+ query_params = []
1466
+
1467
+ header_params = {}
1468
+
1469
+ form_params = {}
1470
+
1471
+ body = None
1472
+ if isinstance(request, SdkStreamRequest):
1473
+ body = request.get_file_stream()
1474
+
1475
+ response_headers = []
1476
+
1477
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1478
+ ['application/json'])
1479
+
1480
+ auth_settings = []
1481
+
1482
+ http_info["cname"] = cname
1483
+ http_info["collection_formats"] = collection_formats
1484
+ http_info["path_params"] = path_params
1485
+ http_info["query_params"] = query_params
1486
+ http_info["header_params"] = header_params
1487
+ http_info["post_params"] = form_params
1488
+ http_info["body"] = body
1489
+ http_info["response_headers"] = response_headers
1490
+
1491
+ return http_info
1492
+
1493
+ def show_task_group_async(self, request):
1494
+ r"""获取指定id的taskgroup信息
1495
+
1496
+ 获取指定id的taskgroup信息
1497
+
1498
+ Please refer to HUAWEI cloud API Explorer for details.
1499
+
1500
+
1501
+ :param request: Request instance for ShowTaskGroup
1502
+ :type request: :class:`huaweicloudsdkoms.v2.ShowTaskGroupRequest`
1503
+ :rtype: :class:`huaweicloudsdkoms.v2.ShowTaskGroupResponse`
1504
+ """
1505
+ http_info = self._show_task_group_http_info(request)
1506
+ return self._call_api(**http_info)
1507
+
1508
+ def show_task_group_async_invoker(self, request):
1509
+ http_info = self._show_task_group_http_info(request)
1510
+ return AsyncInvoker(self, http_info)
1511
+
1512
+ def _show_task_group_http_info(self, request):
1513
+ http_info = {
1514
+ "method": "GET",
1515
+ "resource_path": "/v2/{project_id}/taskgroups/{group_id}",
1516
+ "request_type": request.__class__.__name__,
1517
+ "response_type": "ShowTaskGroupResponse"
1518
+ }
1519
+
1520
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1521
+
1522
+ cname = None
1523
+
1524
+ collection_formats = {}
1525
+
1526
+ path_params = {}
1527
+ if 'group_id' in local_var_params:
1528
+ path_params['group_id'] = local_var_params['group_id']
1529
+
1530
+ query_params = []
1531
+
1532
+ header_params = {}
1533
+
1534
+ form_params = {}
1535
+
1536
+ body = None
1537
+ if isinstance(request, SdkStreamRequest):
1538
+ body = request.get_file_stream()
1539
+
1540
+ response_headers = []
1541
+
1542
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1543
+ ['application/json'])
1544
+
1545
+ auth_settings = []
1546
+
1547
+ http_info["cname"] = cname
1548
+ http_info["collection_formats"] = collection_formats
1549
+ http_info["path_params"] = path_params
1550
+ http_info["query_params"] = query_params
1551
+ http_info["header_params"] = header_params
1552
+ http_info["post_params"] = form_params
1553
+ http_info["body"] = body
1554
+ http_info["response_headers"] = response_headers
1555
+
1556
+ return http_info
1557
+
1558
+ def start_sync_task_async(self, request):
1559
+ r"""启动同步任务
1560
+
1561
+ 同步任务停止后,调用该接口以启动同步任务(目前只支持华北-北京四、华东-上海一地区)。
1562
+
1563
+ Please refer to HUAWEI cloud API Explorer for details.
1564
+
1565
+
1566
+ :param request: Request instance for StartSyncTask
1567
+ :type request: :class:`huaweicloudsdkoms.v2.StartSyncTaskRequest`
1568
+ :rtype: :class:`huaweicloudsdkoms.v2.StartSyncTaskResponse`
1569
+ """
1570
+ http_info = self._start_sync_task_http_info(request)
1571
+ return self._call_api(**http_info)
1572
+
1573
+ def start_sync_task_async_invoker(self, request):
1574
+ http_info = self._start_sync_task_http_info(request)
1575
+ return AsyncInvoker(self, http_info)
1576
+
1577
+ def _start_sync_task_http_info(self, request):
1578
+ http_info = {
1579
+ "method": "POST",
1580
+ "resource_path": "/v2/{project_id}/sync-tasks/{sync_task_id}/start",
1581
+ "request_type": request.__class__.__name__,
1582
+ "response_type": "StartSyncTaskResponse"
1583
+ }
1584
+
1585
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1586
+
1587
+ cname = None
1588
+
1589
+ collection_formats = {}
1590
+
1591
+ path_params = {}
1592
+ if 'sync_task_id' in local_var_params:
1593
+ path_params['sync_task_id'] = local_var_params['sync_task_id']
1594
+
1595
+ query_params = []
1596
+
1597
+ header_params = {}
1598
+
1599
+ form_params = {}
1600
+
1601
+ body = None
1602
+ if 'body' in local_var_params:
1603
+ body = local_var_params['body']
1604
+ if isinstance(request, SdkStreamRequest):
1605
+ body = request.get_file_stream()
1606
+
1607
+ response_headers = []
1608
+
1609
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1610
+ ['application/json;charset=UTF-8'])
1611
+
1612
+ auth_settings = []
1613
+
1614
+ http_info["cname"] = cname
1615
+ http_info["collection_formats"] = collection_formats
1616
+ http_info["path_params"] = path_params
1617
+ http_info["query_params"] = query_params
1618
+ http_info["header_params"] = header_params
1619
+ http_info["post_params"] = form_params
1620
+ http_info["body"] = body
1621
+ http_info["response_headers"] = response_headers
1622
+
1623
+ return http_info
1624
+
1625
+ def start_task_async(self, request):
1626
+ r"""启动迁移任务
1627
+
1628
+ 迁移任务暂停或失败后,调用该接口以启动任务。
1629
+
1630
+ Please refer to HUAWEI cloud API Explorer for details.
1631
+
1632
+
1633
+ :param request: Request instance for StartTask
1634
+ :type request: :class:`huaweicloudsdkoms.v2.StartTaskRequest`
1635
+ :rtype: :class:`huaweicloudsdkoms.v2.StartTaskResponse`
1636
+ """
1637
+ http_info = self._start_task_http_info(request)
1638
+ return self._call_api(**http_info)
1639
+
1640
+ def start_task_async_invoker(self, request):
1641
+ http_info = self._start_task_http_info(request)
1642
+ return AsyncInvoker(self, http_info)
1643
+
1644
+ def _start_task_http_info(self, request):
1645
+ http_info = {
1646
+ "method": "POST",
1647
+ "resource_path": "/v2/{project_id}/tasks/{task_id}/start",
1648
+ "request_type": request.__class__.__name__,
1649
+ "response_type": "StartTaskResponse"
1650
+ }
1651
+
1652
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1653
+
1654
+ cname = None
1655
+
1656
+ collection_formats = {}
1657
+
1658
+ path_params = {}
1659
+ if 'task_id' in local_var_params:
1660
+ path_params['task_id'] = local_var_params['task_id']
1661
+
1662
+ query_params = []
1663
+
1664
+ header_params = {}
1665
+
1666
+ form_params = {}
1667
+
1668
+ body = None
1669
+ if 'body' in local_var_params:
1670
+ body = local_var_params['body']
1671
+ if isinstance(request, SdkStreamRequest):
1672
+ body = request.get_file_stream()
1673
+
1674
+ response_headers = []
1675
+
1676
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1677
+ ['application/json;charset=UTF-8'])
1678
+
1679
+ auth_settings = []
1680
+
1681
+ http_info["cname"] = cname
1682
+ http_info["collection_formats"] = collection_formats
1683
+ http_info["path_params"] = path_params
1684
+ http_info["query_params"] = query_params
1685
+ http_info["header_params"] = header_params
1686
+ http_info["post_params"] = form_params
1687
+ http_info["body"] = body
1688
+ http_info["response_headers"] = response_headers
1689
+
1690
+ return http_info
1691
+
1692
+ def start_task_group_async(self, request):
1693
+ r"""恢复指定id的迁移任务组
1694
+
1695
+ 当迁移任务组处于暂停状态时,调用该接口启动指定id的迁移任务组。
1696
+
1697
+ Please refer to HUAWEI cloud API Explorer for details.
1698
+
1699
+
1700
+ :param request: Request instance for StartTaskGroup
1701
+ :type request: :class:`huaweicloudsdkoms.v2.StartTaskGroupRequest`
1702
+ :rtype: :class:`huaweicloudsdkoms.v2.StartTaskGroupResponse`
1703
+ """
1704
+ http_info = self._start_task_group_http_info(request)
1705
+ return self._call_api(**http_info)
1706
+
1707
+ def start_task_group_async_invoker(self, request):
1708
+ http_info = self._start_task_group_http_info(request)
1709
+ return AsyncInvoker(self, http_info)
1710
+
1711
+ def _start_task_group_http_info(self, request):
1712
+ http_info = {
1713
+ "method": "PUT",
1714
+ "resource_path": "/v2/{project_id}/taskgroups/{group_id}/start",
1715
+ "request_type": request.__class__.__name__,
1716
+ "response_type": "StartTaskGroupResponse"
1717
+ }
1718
+
1719
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1720
+
1721
+ cname = None
1722
+
1723
+ collection_formats = {}
1724
+
1725
+ path_params = {}
1726
+ if 'group_id' in local_var_params:
1727
+ path_params['group_id'] = local_var_params['group_id']
1728
+
1729
+ query_params = []
1730
+
1731
+ header_params = {}
1732
+
1733
+ form_params = {}
1734
+
1735
+ body = None
1736
+ if 'body' in local_var_params:
1737
+ body = local_var_params['body']
1738
+ if isinstance(request, SdkStreamRequest):
1739
+ body = request.get_file_stream()
1740
+
1741
+ response_headers = []
1742
+
1743
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1744
+ ['application/json;charset=UTF-8'])
1745
+
1746
+ auth_settings = []
1747
+
1748
+ http_info["cname"] = cname
1749
+ http_info["collection_formats"] = collection_formats
1750
+ http_info["path_params"] = path_params
1751
+ http_info["query_params"] = query_params
1752
+ http_info["header_params"] = header_params
1753
+ http_info["post_params"] = form_params
1754
+ http_info["body"] = body
1755
+ http_info["response_headers"] = response_headers
1756
+
1757
+ return http_info
1758
+
1759
+ def stop_sync_task_async(self, request):
1760
+ r"""暂停同步任务
1761
+
1762
+ 当同步任务处于同步中时,调用该接口停止任务(目前只支持华北-北京四、华东-上海一地区)。
1763
+
1764
+ Please refer to HUAWEI cloud API Explorer for details.
1765
+
1766
+
1767
+ :param request: Request instance for StopSyncTask
1768
+ :type request: :class:`huaweicloudsdkoms.v2.StopSyncTaskRequest`
1769
+ :rtype: :class:`huaweicloudsdkoms.v2.StopSyncTaskResponse`
1770
+ """
1771
+ http_info = self._stop_sync_task_http_info(request)
1772
+ return self._call_api(**http_info)
1773
+
1774
+ def stop_sync_task_async_invoker(self, request):
1775
+ http_info = self._stop_sync_task_http_info(request)
1776
+ return AsyncInvoker(self, http_info)
1777
+
1778
+ def _stop_sync_task_http_info(self, request):
1779
+ http_info = {
1780
+ "method": "POST",
1781
+ "resource_path": "/v2/{project_id}/sync-tasks/{sync_task_id}/stop",
1782
+ "request_type": request.__class__.__name__,
1783
+ "response_type": "StopSyncTaskResponse"
1784
+ }
1785
+
1786
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1787
+
1788
+ cname = None
1789
+
1790
+ collection_formats = {}
1791
+
1792
+ path_params = {}
1793
+ if 'sync_task_id' in local_var_params:
1794
+ path_params['sync_task_id'] = local_var_params['sync_task_id']
1795
+
1796
+ query_params = []
1797
+
1798
+ header_params = {}
1799
+
1800
+ form_params = {}
1801
+
1802
+ body = None
1803
+ if isinstance(request, SdkStreamRequest):
1804
+ body = request.get_file_stream()
1805
+
1806
+ response_headers = []
1807
+
1808
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1809
+ ['application/json'])
1810
+
1811
+ auth_settings = []
1812
+
1813
+ http_info["cname"] = cname
1814
+ http_info["collection_formats"] = collection_formats
1815
+ http_info["path_params"] = path_params
1816
+ http_info["query_params"] = query_params
1817
+ http_info["header_params"] = header_params
1818
+ http_info["post_params"] = form_params
1819
+ http_info["body"] = body
1820
+ http_info["response_headers"] = response_headers
1821
+
1822
+ return http_info
1823
+
1824
+ def stop_task_async(self, request):
1825
+ r"""暂停迁移任务
1826
+
1827
+ 当迁移任务处于迁移中时,调用该接口停止任务。
1828
+
1829
+ Please refer to HUAWEI cloud API Explorer for details.
1830
+
1831
+
1832
+ :param request: Request instance for StopTask
1833
+ :type request: :class:`huaweicloudsdkoms.v2.StopTaskRequest`
1834
+ :rtype: :class:`huaweicloudsdkoms.v2.StopTaskResponse`
1835
+ """
1836
+ http_info = self._stop_task_http_info(request)
1837
+ return self._call_api(**http_info)
1838
+
1839
+ def stop_task_async_invoker(self, request):
1840
+ http_info = self._stop_task_http_info(request)
1841
+ return AsyncInvoker(self, http_info)
1842
+
1843
+ def _stop_task_http_info(self, request):
1844
+ http_info = {
1845
+ "method": "POST",
1846
+ "resource_path": "/v2/{project_id}/tasks/{task_id}/stop",
1847
+ "request_type": request.__class__.__name__,
1848
+ "response_type": "StopTaskResponse"
1849
+ }
1850
+
1851
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1852
+
1853
+ cname = None
1854
+
1855
+ collection_formats = {}
1856
+
1857
+ path_params = {}
1858
+ if 'task_id' in local_var_params:
1859
+ path_params['task_id'] = local_var_params['task_id']
1860
+
1861
+ query_params = []
1862
+
1863
+ header_params = {}
1864
+
1865
+ form_params = {}
1866
+
1867
+ body = None
1868
+ if isinstance(request, SdkStreamRequest):
1869
+ body = request.get_file_stream()
1870
+
1871
+ response_headers = []
1872
+
1873
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1874
+ ['application/json'])
1875
+
1876
+ auth_settings = []
1877
+
1878
+ http_info["cname"] = cname
1879
+ http_info["collection_formats"] = collection_formats
1880
+ http_info["path_params"] = path_params
1881
+ http_info["query_params"] = query_params
1882
+ http_info["header_params"] = header_params
1883
+ http_info["post_params"] = form_params
1884
+ http_info["body"] = body
1885
+ http_info["response_headers"] = response_headers
1886
+
1887
+ return http_info
1888
+
1889
+ def stop_task_group_async(self, request):
1890
+ r"""暂停指定id的迁移任务组
1891
+
1892
+ 当迁移任务组处于创建任务中或监控中时,调用该接口暂停指定迁移任务组。
1893
+
1894
+ Please refer to HUAWEI cloud API Explorer for details.
1895
+
1896
+
1897
+ :param request: Request instance for StopTaskGroup
1898
+ :type request: :class:`huaweicloudsdkoms.v2.StopTaskGroupRequest`
1899
+ :rtype: :class:`huaweicloudsdkoms.v2.StopTaskGroupResponse`
1900
+ """
1901
+ http_info = self._stop_task_group_http_info(request)
1902
+ return self._call_api(**http_info)
1903
+
1904
+ def stop_task_group_async_invoker(self, request):
1905
+ http_info = self._stop_task_group_http_info(request)
1906
+ return AsyncInvoker(self, http_info)
1907
+
1908
+ def _stop_task_group_http_info(self, request):
1909
+ http_info = {
1910
+ "method": "PUT",
1911
+ "resource_path": "/v2/{project_id}/taskgroups/{group_id}/stop",
1912
+ "request_type": request.__class__.__name__,
1913
+ "response_type": "StopTaskGroupResponse"
1914
+ }
1915
+
1916
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1917
+
1918
+ cname = None
1919
+
1920
+ collection_formats = {}
1921
+
1922
+ path_params = {}
1923
+ if 'group_id' in local_var_params:
1924
+ path_params['group_id'] = local_var_params['group_id']
1925
+
1926
+ query_params = []
1927
+
1928
+ header_params = {}
1929
+
1930
+ form_params = {}
1931
+
1932
+ body = None
1933
+ if isinstance(request, SdkStreamRequest):
1934
+ body = request.get_file_stream()
1935
+
1936
+ response_headers = []
1937
+
1938
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1939
+ ['application/json'])
1940
+
1941
+ auth_settings = []
1942
+
1943
+ http_info["cname"] = cname
1944
+ http_info["collection_formats"] = collection_formats
1945
+ http_info["path_params"] = path_params
1946
+ http_info["query_params"] = query_params
1947
+ http_info["header_params"] = header_params
1948
+ http_info["post_params"] = form_params
1949
+ http_info["body"] = body
1950
+ http_info["response_headers"] = response_headers
1951
+
1952
+ return http_info
1953
+
1954
+ def update_bandwidth_policy_async(self, request):
1955
+ r"""更新任务带宽策略
1956
+
1957
+ 当迁移任务未执行完成时,修改迁移任务的流量控制策略。
1958
+
1959
+ Please refer to HUAWEI cloud API Explorer for details.
1960
+
1961
+
1962
+ :param request: Request instance for UpdateBandwidthPolicy
1963
+ :type request: :class:`huaweicloudsdkoms.v2.UpdateBandwidthPolicyRequest`
1964
+ :rtype: :class:`huaweicloudsdkoms.v2.UpdateBandwidthPolicyResponse`
1965
+ """
1966
+ http_info = self._update_bandwidth_policy_http_info(request)
1967
+ return self._call_api(**http_info)
1968
+
1969
+ def update_bandwidth_policy_async_invoker(self, request):
1970
+ http_info = self._update_bandwidth_policy_http_info(request)
1971
+ return AsyncInvoker(self, http_info)
1972
+
1973
+ def _update_bandwidth_policy_http_info(self, request):
1974
+ http_info = {
1975
+ "method": "PUT",
1976
+ "resource_path": "/v2/{project_id}/tasks/{task_id}/bandwidth-policy",
1977
+ "request_type": request.__class__.__name__,
1978
+ "response_type": "UpdateBandwidthPolicyResponse"
1979
+ }
1980
+
1981
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1982
+
1983
+ cname = None
1984
+
1985
+ collection_formats = {}
1986
+
1987
+ path_params = {}
1988
+ if 'task_id' in local_var_params:
1989
+ path_params['task_id'] = local_var_params['task_id']
1990
+
1991
+ query_params = []
1992
+
1993
+ header_params = {}
1994
+
1995
+ form_params = {}
1996
+
1997
+ body = None
1998
+ if 'body' in local_var_params:
1999
+ body = local_var_params['body']
2000
+ if isinstance(request, SdkStreamRequest):
2001
+ body = request.get_file_stream()
2002
+
2003
+ response_headers = []
2004
+
2005
+ header_params['Content-Type'] = http_utils.select_header_content_type(
2006
+ ['application/json;charset=UTF-8'])
2007
+
2008
+ auth_settings = []
2009
+
2010
+ http_info["cname"] = cname
2011
+ http_info["collection_formats"] = collection_formats
2012
+ http_info["path_params"] = path_params
2013
+ http_info["query_params"] = query_params
2014
+ http_info["header_params"] = header_params
2015
+ http_info["post_params"] = form_params
2016
+ http_info["body"] = body
2017
+ http_info["response_headers"] = response_headers
2018
+
2019
+ return http_info
2020
+
2021
+ def update_task_group_async(self, request):
2022
+ r"""更新指定id的迁移任务组的流控策略
2023
+
2024
+ 当迁移任务组未执行完成时,修改迁移任务组的流量控制策略。
2025
+
2026
+ Please refer to HUAWEI cloud API Explorer for details.
2027
+
2028
+
2029
+ :param request: Request instance for UpdateTaskGroup
2030
+ :type request: :class:`huaweicloudsdkoms.v2.UpdateTaskGroupRequest`
2031
+ :rtype: :class:`huaweicloudsdkoms.v2.UpdateTaskGroupResponse`
2032
+ """
2033
+ http_info = self._update_task_group_http_info(request)
2034
+ return self._call_api(**http_info)
2035
+
2036
+ def update_task_group_async_invoker(self, request):
2037
+ http_info = self._update_task_group_http_info(request)
2038
+ return AsyncInvoker(self, http_info)
2039
+
2040
+ def _update_task_group_http_info(self, request):
2041
+ http_info = {
2042
+ "method": "PUT",
2043
+ "resource_path": "/v2/{project_id}/taskgroups/{group_id}/update",
2044
+ "request_type": request.__class__.__name__,
2045
+ "response_type": "UpdateTaskGroupResponse"
2046
+ }
2047
+
2048
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
2049
+
2050
+ cname = None
2051
+
2052
+ collection_formats = {}
2053
+
2054
+ path_params = {}
2055
+ if 'group_id' in local_var_params:
2056
+ path_params['group_id'] = local_var_params['group_id']
2057
+
2058
+ query_params = []
2059
+
2060
+ header_params = {}
2061
+
2062
+ form_params = {}
2063
+
2064
+ body = None
2065
+ if 'body' in local_var_params:
2066
+ body = local_var_params['body']
2067
+ if isinstance(request, SdkStreamRequest):
2068
+ body = request.get_file_stream()
2069
+
2070
+ response_headers = []
2071
+
2072
+ header_params['Content-Type'] = http_utils.select_header_content_type(
2073
+ ['application/json;charset=UTF-8'])
2074
+
2075
+ auth_settings = []
2076
+
2077
+ http_info["cname"] = cname
2078
+ http_info["collection_formats"] = collection_formats
2079
+ http_info["path_params"] = path_params
2080
+ http_info["query_params"] = query_params
2081
+ http_info["header_params"] = header_params
2082
+ http_info["post_params"] = form_params
2083
+ http_info["body"] = body
2084
+ http_info["response_headers"] = response_headers
2085
+
2086
+ return http_info
2087
+
2088
+ def list_api_versions_async(self, request):
2089
+ r"""查询API版本信息列表
2090
+
2091
+ 查询对象存储迁移服务的API版本信息。
2092
+
2093
+ Please refer to HUAWEI cloud API Explorer for details.
2094
+
2095
+
2096
+ :param request: Request instance for ListApiVersions
2097
+ :type request: :class:`huaweicloudsdkoms.v2.ListApiVersionsRequest`
2098
+ :rtype: :class:`huaweicloudsdkoms.v2.ListApiVersionsResponse`
2099
+ """
2100
+ http_info = self._list_api_versions_http_info(request)
2101
+ return self._call_api(**http_info)
2102
+
2103
+ def list_api_versions_async_invoker(self, request):
2104
+ http_info = self._list_api_versions_http_info(request)
2105
+ return AsyncInvoker(self, http_info)
2106
+
2107
+ def _list_api_versions_http_info(self, request):
2108
+ http_info = {
2109
+ "method": "GET",
2110
+ "resource_path": "/",
2111
+ "request_type": request.__class__.__name__,
2112
+ "response_type": "ListApiVersionsResponse"
2113
+ }
2114
+
2115
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
2116
+
2117
+ cname = None
2118
+
2119
+ collection_formats = {}
2120
+
2121
+ path_params = {}
2122
+
2123
+ query_params = []
2124
+
2125
+ header_params = {}
2126
+
2127
+ form_params = {}
2128
+
2129
+ body = None
2130
+ if isinstance(request, SdkStreamRequest):
2131
+ body = request.get_file_stream()
2132
+
2133
+ response_headers = []
2134
+
2135
+ header_params['Content-Type'] = http_utils.select_header_content_type(
2136
+ ['application/json'])
2137
+
2138
+ auth_settings = []
2139
+
2140
+ http_info["cname"] = cname
2141
+ http_info["collection_formats"] = collection_formats
2142
+ http_info["path_params"] = path_params
2143
+ http_info["query_params"] = query_params
2144
+ http_info["header_params"] = header_params
2145
+ http_info["post_params"] = form_params
2146
+ http_info["body"] = body
2147
+ http_info["response_headers"] = response_headers
2148
+
2149
+ return http_info
2150
+
2151
+ def show_api_info_async(self, request):
2152
+ r"""查询指定API版本信息
2153
+
2154
+ 查询对象存储迁移服务指定API版本信息。
2155
+
2156
+ Please refer to HUAWEI cloud API Explorer for details.
2157
+
2158
+
2159
+ :param request: Request instance for ShowApiInfo
2160
+ :type request: :class:`huaweicloudsdkoms.v2.ShowApiInfoRequest`
2161
+ :rtype: :class:`huaweicloudsdkoms.v2.ShowApiInfoResponse`
2162
+ """
2163
+ http_info = self._show_api_info_http_info(request)
2164
+ return self._call_api(**http_info)
2165
+
2166
+ def show_api_info_async_invoker(self, request):
2167
+ http_info = self._show_api_info_http_info(request)
2168
+ return AsyncInvoker(self, http_info)
2169
+
2170
+ def _show_api_info_http_info(self, request):
2171
+ http_info = {
2172
+ "method": "GET",
2173
+ "resource_path": "/{version}",
2174
+ "request_type": request.__class__.__name__,
2175
+ "response_type": "ShowApiInfoResponse"
2176
+ }
2177
+
2178
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
2179
+
2180
+ cname = None
2181
+
2182
+ collection_formats = {}
2183
+
2184
+ path_params = {}
2185
+ if 'version' in local_var_params:
2186
+ path_params['version'] = local_var_params['version']
2187
+
2188
+ query_params = []
2189
+
2190
+ header_params = {}
2191
+
2192
+ form_params = {}
2193
+
2194
+ body = None
2195
+ if isinstance(request, SdkStreamRequest):
2196
+ body = request.get_file_stream()
2197
+
2198
+ response_headers = []
2199
+
2200
+ header_params['Content-Type'] = http_utils.select_header_content_type(
2201
+ ['application/json'])
2202
+
2203
+ auth_settings = []
2204
+
2205
+ http_info["cname"] = cname
2206
+ http_info["collection_formats"] = collection_formats
2207
+ http_info["path_params"] = path_params
2208
+ http_info["query_params"] = query_params
2209
+ http_info["header_params"] = header_params
2210
+ http_info["post_params"] = form_params
2211
+ http_info["body"] = body
2212
+ http_info["response_headers"] = response_headers
2213
+
2214
+ return http_info
2215
+
2216
+ def _call_api(self, **kwargs):
2217
+ try:
2218
+ kwargs["async_request"] = True
2219
+ return self.do_http_request(**kwargs)
2220
+ except TypeError:
2221
+ import inspect
2222
+ params = inspect.signature(self.do_http_request).parameters
2223
+ http_info = {param_name: kwargs.get(param_name) for param_name in params if param_name in kwargs}
2224
+ return self.do_http_request(**http_info)
2225
+
2226
+ def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None,
2227
+ post_params=None, cname=None, response_type=None, response_headers=None, auth_settings=None,
2228
+ collection_formats=None, request_type=None):
2229
+ """Makes the HTTP request and returns deserialized data.
2230
+
2231
+ :param resource_path: Path to method endpoint.
2232
+ :param method: Method to call.
2233
+ :param path_params: Path parameters in the url.
2234
+ :param query_params: Query parameters in the url.
2235
+ :param header_params: Header parameters to be
2236
+ placed in the request header.
2237
+ :param body: Request body.
2238
+ :param post_params: Request post form parameters,
2239
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
2240
+ :param cname: Used for obs endpoint.
2241
+ :param auth_settings: Auth Settings names for the request.
2242
+ :param response_type: Response data type.
2243
+ :param response_headers: Header should be added to response data.
2244
+ :param collection_formats: dict of collection formats for path, query,
2245
+ header, and post parameters.
2246
+ :param request_type: Request data type.
2247
+ :return:
2248
+ Return the response directly.
2249
+ """
2250
+ return self.do_http_request(
2251
+ method=method,
2252
+ resource_path=resource_path,
2253
+ path_params=path_params,
2254
+ query_params=query_params,
2255
+ header_params=header_params,
2256
+ body=body,
2257
+ post_params=post_params,
2258
+ cname=cname,
2259
+ response_type=response_type,
2260
+ response_headers=response_headers,
2261
+ collection_formats=collection_formats,
2262
+ request_type=request_type,
2263
+ async_request=True)