huaweicloudsdkdwr 3.1.151__py2.py3-none-any.whl → 3.1.153__py2.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.

Potentially problematic release.


This version of huaweicloudsdkdwr might be problematic. Click here for more details.

Files changed (96) hide show
  1. huaweicloudsdkdwr/v1/__init__.py +91 -0
  2. huaweicloudsdkdwr/v1/dwr_async_client.py +1519 -0
  3. huaweicloudsdkdwr/v1/dwr_client.py +1516 -0
  4. huaweicloudsdkdwr/v1/model/__init__.py +88 -0
  5. huaweicloudsdkdwr/v1/model/build_progress.py +231 -0
  6. huaweicloudsdkdwr/v1/model/charge_info.py +230 -0
  7. huaweicloudsdkdwr/v1/model/collection_base_info.py +142 -0
  8. huaweicloudsdkdwr/v1/model/create_collection_body.py +281 -0
  9. huaweicloudsdkdwr/v1/model/create_collection_request.py +111 -0
  10. huaweicloudsdkdwr/v1/model/create_collection_response.py +145 -0
  11. huaweicloudsdkdwr/v1/model/create_index_body.py +166 -0
  12. huaweicloudsdkdwr/v1/model/create_index_request.py +111 -0
  13. huaweicloudsdkdwr/v1/model/create_index_response.py +145 -0
  14. huaweicloudsdkdwr/v1/model/create_store_body.py +248 -0
  15. huaweicloudsdkdwr/v1/model/create_store_data.py +335 -0
  16. huaweicloudsdkdwr/v1/model/create_store_request.py +111 -0
  17. huaweicloudsdkdwr/v1/model/create_store_response.py +170 -0
  18. huaweicloudsdkdwr/v1/model/decribe_collection_data.py +315 -0
  19. huaweicloudsdkdwr/v1/model/delete_collection_request.py +111 -0
  20. huaweicloudsdkdwr/v1/model/delete_collection_response.py +145 -0
  21. huaweicloudsdkdwr/v1/model/delete_entities_body.py +170 -0
  22. huaweicloudsdkdwr/v1/model/delete_entities_request.py +111 -0
  23. huaweicloudsdkdwr/v1/model/delete_entities_response.py +145 -0
  24. huaweicloudsdkdwr/v1/model/delete_index_body.py +170 -0
  25. huaweicloudsdkdwr/v1/model/delete_index_request.py +111 -0
  26. huaweicloudsdkdwr/v1/model/delete_index_response.py +145 -0
  27. huaweicloudsdkdwr/v1/model/delete_store_data.py +114 -0
  28. huaweicloudsdkdwr/v1/model/delete_store_request.py +111 -0
  29. huaweicloudsdkdwr/v1/model/delete_store_response.py +170 -0
  30. huaweicloudsdkdwr/v1/model/describe_collection_request.py +111 -0
  31. huaweicloudsdkdwr/v1/model/describe_collection_response.py +170 -0
  32. huaweicloudsdkdwr/v1/model/describe_index_body.py +170 -0
  33. huaweicloudsdkdwr/v1/model/describe_index_request.py +111 -0
  34. huaweicloudsdkdwr/v1/model/describe_index_response.py +170 -0
  35. huaweicloudsdkdwr/v1/model/describe_index_respose_data.py +171 -0
  36. huaweicloudsdkdwr/v1/model/describe_job_body.py +114 -0
  37. huaweicloudsdkdwr/v1/model/describe_job_request.py +111 -0
  38. huaweicloudsdkdwr/v1/model/describe_job_response.py +170 -0
  39. huaweicloudsdkdwr/v1/model/describe_store_data.py +364 -0
  40. huaweicloudsdkdwr/v1/model/describe_store_request.py +111 -0
  41. huaweicloudsdkdwr/v1/model/describe_store_response.py +170 -0
  42. huaweicloudsdkdwr/v1/model/field.py +229 -0
  43. huaweicloudsdkdwr/v1/model/field_data.py +198 -0
  44. huaweicloudsdkdwr/v1/model/flavor.py +142 -0
  45. huaweicloudsdkdwr/v1/model/get_index_progress_body.py +170 -0
  46. huaweicloudsdkdwr/v1/model/get_index_progress_response_data.py +167 -0
  47. huaweicloudsdkdwr/v1/model/get_progress_request.py +111 -0
  48. huaweicloudsdkdwr/v1/model/get_progress_response.py +170 -0
  49. huaweicloudsdkdwr/v1/model/hybrid_search_body.py +278 -0
  50. huaweicloudsdkdwr/v1/model/hybrid_search_request.py +111 -0
  51. huaweicloudsdkdwr/v1/model/hybrid_search_response.py +174 -0
  52. huaweicloudsdkdwr/v1/model/index_desc.py +200 -0
  53. huaweicloudsdkdwr/v1/model/index_params.py +171 -0
  54. huaweicloudsdkdwr/v1/model/insert_entities_body.py +170 -0
  55. huaweicloudsdkdwr/v1/model/insert_entities_request.py +111 -0
  56. huaweicloudsdkdwr/v1/model/insert_entities_response.py +170 -0
  57. huaweicloudsdkdwr/v1/model/insert_entities_response_data.py +143 -0
  58. huaweicloudsdkdwr/v1/model/job_data.py +316 -0
  59. huaweicloudsdkdwr/v1/model/list_collection_data.py +143 -0
  60. huaweicloudsdkdwr/v1/model/list_collection_details.py +260 -0
  61. huaweicloudsdkdwr/v1/model/list_collections_body.py +143 -0
  62. huaweicloudsdkdwr/v1/model/list_collections_request.py +111 -0
  63. huaweicloudsdkdwr/v1/model/list_collections_response.py +170 -0
  64. huaweicloudsdkdwr/v1/model/list_jobs_data.py +115 -0
  65. huaweicloudsdkdwr/v1/model/list_jobs_request.py +231 -0
  66. huaweicloudsdkdwr/v1/model/list_jobs_response.py +170 -0
  67. huaweicloudsdkdwr/v1/model/list_stores_request.py +84 -0
  68. huaweicloudsdkdwr/v1/model/list_stores_response.py +174 -0
  69. huaweicloudsdkdwr/v1/model/load_collection_body.py +142 -0
  70. huaweicloudsdkdwr/v1/model/load_collection_request.py +111 -0
  71. huaweicloudsdkdwr/v1/model/load_collection_response.py +145 -0
  72. huaweicloudsdkdwr/v1/model/primary_field.py +142 -0
  73. huaweicloudsdkdwr/v1/model/query_entities_body.py +257 -0
  74. huaweicloudsdkdwr/v1/model/query_entities_request.py +111 -0
  75. huaweicloudsdkdwr/v1/model/query_entities_response.py +174 -0
  76. huaweicloudsdkdwr/v1/model/release_collection_request.py +111 -0
  77. huaweicloudsdkdwr/v1/model/release_collection_response.py +145 -0
  78. huaweicloudsdkdwr/v1/model/rerank.py +143 -0
  79. huaweicloudsdkdwr/v1/model/search_entities_body.py +343 -0
  80. huaweicloudsdkdwr/v1/model/search_entities_request.py +111 -0
  81. huaweicloudsdkdwr/v1/model/search_entities_response.py +174 -0
  82. huaweicloudsdkdwr/v1/model/store_info.py +114 -0
  83. huaweicloudsdkdwr/v1/model/sub_search.py +258 -0
  84. huaweicloudsdkdwr/v1/model/upsert_entities_body.py +170 -0
  85. huaweicloudsdkdwr/v1/model/upsert_entities_request.py +111 -0
  86. huaweicloudsdkdwr/v1/model/upsert_entities_response.py +170 -0
  87. huaweicloudsdkdwr/v1/model/upsert_entities_response_data.py +143 -0
  88. huaweicloudsdkdwr/v1/region/__init__.py +0 -0
  89. huaweicloudsdkdwr/v1/region/dwr_region.py +37 -0
  90. huaweicloudsdkdwr/v3/region/dwr_region.py +6 -0
  91. {huaweicloudsdkdwr-3.1.151.dist-info → huaweicloudsdkdwr-3.1.153.dist-info}/METADATA +2 -2
  92. huaweicloudsdkdwr-3.1.153.dist-info/RECORD +169 -0
  93. huaweicloudsdkdwr-3.1.151.dist-info/RECORD +0 -80
  94. {huaweicloudsdkdwr-3.1.151.dist-info → huaweicloudsdkdwr-3.1.153.dist-info}/LICENSE +0 -0
  95. {huaweicloudsdkdwr-3.1.151.dist-info → huaweicloudsdkdwr-3.1.153.dist-info}/WHEEL +0 -0
  96. {huaweicloudsdkdwr-3.1.151.dist-info → huaweicloudsdkdwr-3.1.153.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,1519 @@
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 'huaweicloudsdkdwr'")
16
+
17
+
18
+ class DwrAsyncClient(Client):
19
+ def __init__(self):
20
+ super(DwrAsyncClient, self).__init__()
21
+ self.model_package = importlib.import_module("huaweicloudsdkdwr.v1.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__ != "DwrAsyncClient":
29
+ raise TypeError("client type error, support client type is DwrAsyncClient")
30
+ client_builder = ClientBuilder(clazz)
31
+
32
+
33
+
34
+ return client_builder
35
+
36
+ def create_collection_async(self, request):
37
+ r"""创建collection
38
+
39
+ 在知识仓实例下创建collection。
40
+
41
+ Please refer to HUAWEI cloud API Explorer for details.
42
+
43
+
44
+ :param request: Request instance for CreateCollection
45
+ :type request: :class:`huaweicloudsdkdwr.v1.CreateCollectionRequest`
46
+ :rtype: :class:`huaweicloudsdkdwr.v1.CreateCollectionResponse`
47
+ """
48
+ http_info = self._create_collection_http_info(request)
49
+ return self._call_api(**http_info)
50
+
51
+ def create_collection_async_invoker(self, request):
52
+ http_info = self._create_collection_http_info(request)
53
+ return AsyncInvoker(self, http_info)
54
+
55
+ def _create_collection_http_info(self, request):
56
+ http_info = {
57
+ "method": "POST",
58
+ "resource_path": "/v1/collections/create",
59
+ "request_type": request.__class__.__name__,
60
+ "response_type": "CreateCollectionResponse"
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'])
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 delete_collection_async(self, request):
102
+ r"""删除collection
103
+
104
+ 在知识仓实例下删除指定的collection。
105
+
106
+ Please refer to HUAWEI cloud API Explorer for details.
107
+
108
+
109
+ :param request: Request instance for DeleteCollection
110
+ :type request: :class:`huaweicloudsdkdwr.v1.DeleteCollectionRequest`
111
+ :rtype: :class:`huaweicloudsdkdwr.v1.DeleteCollectionResponse`
112
+ """
113
+ http_info = self._delete_collection_http_info(request)
114
+ return self._call_api(**http_info)
115
+
116
+ def delete_collection_async_invoker(self, request):
117
+ http_info = self._delete_collection_http_info(request)
118
+ return AsyncInvoker(self, http_info)
119
+
120
+ def _delete_collection_http_info(self, request):
121
+ http_info = {
122
+ "method": "POST",
123
+ "resource_path": "/v1/collections/delete",
124
+ "request_type": request.__class__.__name__,
125
+ "response_type": "DeleteCollectionResponse"
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'])
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 describe_collection_async(self, request):
167
+ r"""查询collection
168
+
169
+ 在知识仓实例下查询指定的collection的信息。
170
+
171
+ Please refer to HUAWEI cloud API Explorer for details.
172
+
173
+
174
+ :param request: Request instance for DescribeCollection
175
+ :type request: :class:`huaweicloudsdkdwr.v1.DescribeCollectionRequest`
176
+ :rtype: :class:`huaweicloudsdkdwr.v1.DescribeCollectionResponse`
177
+ """
178
+ http_info = self._describe_collection_http_info(request)
179
+ return self._call_api(**http_info)
180
+
181
+ def describe_collection_async_invoker(self, request):
182
+ http_info = self._describe_collection_http_info(request)
183
+ return AsyncInvoker(self, http_info)
184
+
185
+ def _describe_collection_http_info(self, request):
186
+ http_info = {
187
+ "method": "POST",
188
+ "resource_path": "/v1/collections/describe",
189
+ "request_type": request.__class__.__name__,
190
+ "response_type": "DescribeCollectionResponse"
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
+
201
+ query_params = []
202
+
203
+ header_params = {}
204
+
205
+ form_params = {}
206
+
207
+ body = None
208
+ if 'body' in local_var_params:
209
+ body = local_var_params['body']
210
+ if isinstance(request, SdkStreamRequest):
211
+ body = request.get_file_stream()
212
+
213
+ response_headers = []
214
+
215
+ header_params['Content-Type'] = http_utils.select_header_content_type(
216
+ ['application/json'])
217
+
218
+ auth_settings = []
219
+
220
+ http_info["cname"] = cname
221
+ http_info["collection_formats"] = collection_formats
222
+ http_info["path_params"] = path_params
223
+ http_info["query_params"] = query_params
224
+ http_info["header_params"] = header_params
225
+ http_info["post_params"] = form_params
226
+ http_info["body"] = body
227
+ http_info["response_headers"] = response_headers
228
+
229
+ return http_info
230
+
231
+ def list_collections_async(self, request):
232
+ r"""列举collection
233
+
234
+ 列举指定知识仓实例中所有的collections。
235
+
236
+ Please refer to HUAWEI cloud API Explorer for details.
237
+
238
+
239
+ :param request: Request instance for ListCollections
240
+ :type request: :class:`huaweicloudsdkdwr.v1.ListCollectionsRequest`
241
+ :rtype: :class:`huaweicloudsdkdwr.v1.ListCollectionsResponse`
242
+ """
243
+ http_info = self._list_collections_http_info(request)
244
+ return self._call_api(**http_info)
245
+
246
+ def list_collections_async_invoker(self, request):
247
+ http_info = self._list_collections_http_info(request)
248
+ return AsyncInvoker(self, http_info)
249
+
250
+ def _list_collections_http_info(self, request):
251
+ http_info = {
252
+ "method": "POST",
253
+ "resource_path": "/v1/collections/list",
254
+ "request_type": request.__class__.__name__,
255
+ "response_type": "ListCollectionsResponse"
256
+ }
257
+
258
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
259
+
260
+ cname = None
261
+
262
+ collection_formats = {}
263
+
264
+ path_params = {}
265
+
266
+ query_params = []
267
+
268
+ header_params = {}
269
+
270
+ form_params = {}
271
+
272
+ body = None
273
+ if 'body' in local_var_params:
274
+ body = local_var_params['body']
275
+ if isinstance(request, SdkStreamRequest):
276
+ body = request.get_file_stream()
277
+
278
+ response_headers = []
279
+
280
+ header_params['Content-Type'] = http_utils.select_header_content_type(
281
+ ['application/json'])
282
+
283
+ auth_settings = []
284
+
285
+ http_info["cname"] = cname
286
+ http_info["collection_formats"] = collection_formats
287
+ http_info["path_params"] = path_params
288
+ http_info["query_params"] = query_params
289
+ http_info["header_params"] = header_params
290
+ http_info["post_params"] = form_params
291
+ http_info["body"] = body
292
+ http_info["response_headers"] = response_headers
293
+
294
+ return http_info
295
+
296
+ def load_collection_async(self, request):
297
+ r"""加载collection
298
+
299
+ 加载指定collection的数据。加载成功后,才能执行查询操作。
300
+
301
+ Please refer to HUAWEI cloud API Explorer for details.
302
+
303
+
304
+ :param request: Request instance for LoadCollection
305
+ :type request: :class:`huaweicloudsdkdwr.v1.LoadCollectionRequest`
306
+ :rtype: :class:`huaweicloudsdkdwr.v1.LoadCollectionResponse`
307
+ """
308
+ http_info = self._load_collection_http_info(request)
309
+ return self._call_api(**http_info)
310
+
311
+ def load_collection_async_invoker(self, request):
312
+ http_info = self._load_collection_http_info(request)
313
+ return AsyncInvoker(self, http_info)
314
+
315
+ def _load_collection_http_info(self, request):
316
+ http_info = {
317
+ "method": "POST",
318
+ "resource_path": "/v1/collections/load",
319
+ "request_type": request.__class__.__name__,
320
+ "response_type": "LoadCollectionResponse"
321
+ }
322
+
323
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
324
+
325
+ cname = None
326
+
327
+ collection_formats = {}
328
+
329
+ path_params = {}
330
+
331
+ query_params = []
332
+
333
+ header_params = {}
334
+
335
+ form_params = {}
336
+
337
+ body = None
338
+ if 'body' in local_var_params:
339
+ body = local_var_params['body']
340
+ if isinstance(request, SdkStreamRequest):
341
+ body = request.get_file_stream()
342
+
343
+ response_headers = []
344
+
345
+ header_params['Content-Type'] = http_utils.select_header_content_type(
346
+ ['application/json'])
347
+
348
+ auth_settings = []
349
+
350
+ http_info["cname"] = cname
351
+ http_info["collection_formats"] = collection_formats
352
+ http_info["path_params"] = path_params
353
+ http_info["query_params"] = query_params
354
+ http_info["header_params"] = header_params
355
+ http_info["post_params"] = form_params
356
+ http_info["body"] = body
357
+ http_info["response_headers"] = response_headers
358
+
359
+ return http_info
360
+
361
+ def release_collection_async(self, request):
362
+ r"""卸载collection
363
+
364
+ 卸载已加载collection的数据。
365
+
366
+ Please refer to HUAWEI cloud API Explorer for details.
367
+
368
+
369
+ :param request: Request instance for ReleaseCollection
370
+ :type request: :class:`huaweicloudsdkdwr.v1.ReleaseCollectionRequest`
371
+ :rtype: :class:`huaweicloudsdkdwr.v1.ReleaseCollectionResponse`
372
+ """
373
+ http_info = self._release_collection_http_info(request)
374
+ return self._call_api(**http_info)
375
+
376
+ def release_collection_async_invoker(self, request):
377
+ http_info = self._release_collection_http_info(request)
378
+ return AsyncInvoker(self, http_info)
379
+
380
+ def _release_collection_http_info(self, request):
381
+ http_info = {
382
+ "method": "POST",
383
+ "resource_path": "/v1/collections/release",
384
+ "request_type": request.__class__.__name__,
385
+ "response_type": "ReleaseCollectionResponse"
386
+ }
387
+
388
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
389
+
390
+ cname = None
391
+
392
+ collection_formats = {}
393
+
394
+ path_params = {}
395
+
396
+ query_params = []
397
+
398
+ header_params = {}
399
+
400
+ form_params = {}
401
+
402
+ body = None
403
+ if 'body' in local_var_params:
404
+ body = local_var_params['body']
405
+ if isinstance(request, SdkStreamRequest):
406
+ body = request.get_file_stream()
407
+
408
+ response_headers = []
409
+
410
+ header_params['Content-Type'] = http_utils.select_header_content_type(
411
+ ['application/json'])
412
+
413
+ auth_settings = []
414
+
415
+ http_info["cname"] = cname
416
+ http_info["collection_formats"] = collection_formats
417
+ http_info["path_params"] = path_params
418
+ http_info["query_params"] = query_params
419
+ http_info["header_params"] = header_params
420
+ http_info["post_params"] = form_params
421
+ http_info["body"] = body
422
+ http_info["response_headers"] = response_headers
423
+
424
+ return http_info
425
+
426
+ def delete_entities_async(self, request):
427
+ r"""删除Entity
428
+
429
+ 在指定的collecton中删除一个或多个Entity。
430
+
431
+ Please refer to HUAWEI cloud API Explorer for details.
432
+
433
+
434
+ :param request: Request instance for DeleteEntities
435
+ :type request: :class:`huaweicloudsdkdwr.v1.DeleteEntitiesRequest`
436
+ :rtype: :class:`huaweicloudsdkdwr.v1.DeleteEntitiesResponse`
437
+ """
438
+ http_info = self._delete_entities_http_info(request)
439
+ return self._call_api(**http_info)
440
+
441
+ def delete_entities_async_invoker(self, request):
442
+ http_info = self._delete_entities_http_info(request)
443
+ return AsyncInvoker(self, http_info)
444
+
445
+ def _delete_entities_http_info(self, request):
446
+ http_info = {
447
+ "method": "POST",
448
+ "resource_path": "/v1/entities/delete",
449
+ "request_type": request.__class__.__name__,
450
+ "response_type": "DeleteEntitiesResponse"
451
+ }
452
+
453
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
454
+
455
+ cname = None
456
+
457
+ collection_formats = {}
458
+
459
+ path_params = {}
460
+
461
+ query_params = []
462
+
463
+ header_params = {}
464
+
465
+ form_params = {}
466
+
467
+ body = None
468
+ if 'body' in local_var_params:
469
+ body = local_var_params['body']
470
+ if isinstance(request, SdkStreamRequest):
471
+ body = request.get_file_stream()
472
+
473
+ response_headers = []
474
+
475
+ header_params['Content-Type'] = http_utils.select_header_content_type(
476
+ ['application/json'])
477
+
478
+ auth_settings = []
479
+
480
+ http_info["cname"] = cname
481
+ http_info["collection_formats"] = collection_formats
482
+ http_info["path_params"] = path_params
483
+ http_info["query_params"] = query_params
484
+ http_info["header_params"] = header_params
485
+ http_info["post_params"] = form_params
486
+ http_info["body"] = body
487
+ http_info["response_headers"] = response_headers
488
+
489
+ return http_info
490
+
491
+ def hybrid_search_async(self, request):
492
+ r"""混合搜索
493
+
494
+ 基于相似度匹配的查询方式,用于查找与给定多个向量进行相似性搜索,支持密集向量,稀疏向量等多路召回,并对结果进行重排处理,最终返回指定的 Top K 个最相似的 Entity。
495
+
496
+ Please refer to HUAWEI cloud API Explorer for details.
497
+
498
+
499
+ :param request: Request instance for HybridSearch
500
+ :type request: :class:`huaweicloudsdkdwr.v1.HybridSearchRequest`
501
+ :rtype: :class:`huaweicloudsdkdwr.v1.HybridSearchResponse`
502
+ """
503
+ http_info = self._hybrid_search_http_info(request)
504
+ return self._call_api(**http_info)
505
+
506
+ def hybrid_search_async_invoker(self, request):
507
+ http_info = self._hybrid_search_http_info(request)
508
+ return AsyncInvoker(self, http_info)
509
+
510
+ def _hybrid_search_http_info(self, request):
511
+ http_info = {
512
+ "method": "POST",
513
+ "resource_path": "/v1/entities/hybrid-search",
514
+ "request_type": request.__class__.__name__,
515
+ "response_type": "HybridSearchResponse"
516
+ }
517
+
518
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
519
+
520
+ cname = None
521
+
522
+ collection_formats = {}
523
+
524
+ path_params = {}
525
+
526
+ query_params = []
527
+
528
+ header_params = {}
529
+
530
+ form_params = {}
531
+
532
+ body = None
533
+ if 'body' in local_var_params:
534
+ body = local_var_params['body']
535
+ if isinstance(request, SdkStreamRequest):
536
+ body = request.get_file_stream()
537
+
538
+ response_headers = []
539
+
540
+ header_params['Content-Type'] = http_utils.select_header_content_type(
541
+ ['application/json'])
542
+
543
+ auth_settings = []
544
+
545
+ http_info["cname"] = cname
546
+ http_info["collection_formats"] = collection_formats
547
+ http_info["path_params"] = path_params
548
+ http_info["query_params"] = query_params
549
+ http_info["header_params"] = header_params
550
+ http_info["post_params"] = form_params
551
+ http_info["body"] = body
552
+ http_info["response_headers"] = response_headers
553
+
554
+ return http_info
555
+
556
+ def insert_entities_async(self, request):
557
+ r"""插入entity
558
+
559
+ 在指定的collection中插入一个或多个Entity。
560
+
561
+ Please refer to HUAWEI cloud API Explorer for details.
562
+
563
+
564
+ :param request: Request instance for InsertEntities
565
+ :type request: :class:`huaweicloudsdkdwr.v1.InsertEntitiesRequest`
566
+ :rtype: :class:`huaweicloudsdkdwr.v1.InsertEntitiesResponse`
567
+ """
568
+ http_info = self._insert_entities_http_info(request)
569
+ return self._call_api(**http_info)
570
+
571
+ def insert_entities_async_invoker(self, request):
572
+ http_info = self._insert_entities_http_info(request)
573
+ return AsyncInvoker(self, http_info)
574
+
575
+ def _insert_entities_http_info(self, request):
576
+ http_info = {
577
+ "method": "POST",
578
+ "resource_path": "/v1/entities/insert",
579
+ "request_type": request.__class__.__name__,
580
+ "response_type": "InsertEntitiesResponse"
581
+ }
582
+
583
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
584
+
585
+ cname = None
586
+
587
+ collection_formats = {}
588
+
589
+ path_params = {}
590
+
591
+ query_params = []
592
+
593
+ header_params = {}
594
+
595
+ form_params = {}
596
+
597
+ body = None
598
+ if 'body' in local_var_params:
599
+ body = local_var_params['body']
600
+ if isinstance(request, SdkStreamRequest):
601
+ body = request.get_file_stream()
602
+
603
+ response_headers = []
604
+
605
+ header_params['Content-Type'] = http_utils.select_header_content_type(
606
+ ['application/json'])
607
+
608
+ auth_settings = []
609
+
610
+ http_info["cname"] = cname
611
+ http_info["collection_formats"] = collection_formats
612
+ http_info["path_params"] = path_params
613
+ http_info["query_params"] = query_params
614
+ http_info["header_params"] = header_params
615
+ http_info["post_params"] = form_params
616
+ http_info["body"] = body
617
+ http_info["response_headers"] = response_headers
618
+
619
+ return http_info
620
+
621
+ def query_entities_async(self, request):
622
+ r"""标量查询
623
+
624
+ 接口用于精确查找与查询条件完全匹配的向量,此操作使用指定的布尔表达式对标量字段进行筛选。
625
+
626
+ Please refer to HUAWEI cloud API Explorer for details.
627
+
628
+
629
+ :param request: Request instance for QueryEntities
630
+ :type request: :class:`huaweicloudsdkdwr.v1.QueryEntitiesRequest`
631
+ :rtype: :class:`huaweicloudsdkdwr.v1.QueryEntitiesResponse`
632
+ """
633
+ http_info = self._query_entities_http_info(request)
634
+ return self._call_api(**http_info)
635
+
636
+ def query_entities_async_invoker(self, request):
637
+ http_info = self._query_entities_http_info(request)
638
+ return AsyncInvoker(self, http_info)
639
+
640
+ def _query_entities_http_info(self, request):
641
+ http_info = {
642
+ "method": "POST",
643
+ "resource_path": "/v1/entities/query",
644
+ "request_type": request.__class__.__name__,
645
+ "response_type": "QueryEntitiesResponse"
646
+ }
647
+
648
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
649
+
650
+ cname = None
651
+
652
+ collection_formats = {}
653
+
654
+ path_params = {}
655
+
656
+ query_params = []
657
+
658
+ header_params = {}
659
+
660
+ form_params = {}
661
+
662
+ body = None
663
+ if 'body' in local_var_params:
664
+ body = local_var_params['body']
665
+ if isinstance(request, SdkStreamRequest):
666
+ body = request.get_file_stream()
667
+
668
+ response_headers = []
669
+
670
+ header_params['Content-Type'] = http_utils.select_header_content_type(
671
+ ['application/json'])
672
+
673
+ auth_settings = []
674
+
675
+ http_info["cname"] = cname
676
+ http_info["collection_formats"] = collection_formats
677
+ http_info["path_params"] = path_params
678
+ http_info["query_params"] = query_params
679
+ http_info["header_params"] = header_params
680
+ http_info["post_params"] = form_params
681
+ http_info["body"] = body
682
+ http_info["response_headers"] = response_headers
683
+
684
+ return http_info
685
+
686
+ def search_entities_async(self, request):
687
+ r"""向量查询
688
+
689
+ 基于相似度匹配的查询方式,用于查找与给定查询向量相似的向量。返回指定的 Top K 个最相似的 Entity。
690
+
691
+ Please refer to HUAWEI cloud API Explorer for details.
692
+
693
+
694
+ :param request: Request instance for SearchEntities
695
+ :type request: :class:`huaweicloudsdkdwr.v1.SearchEntitiesRequest`
696
+ :rtype: :class:`huaweicloudsdkdwr.v1.SearchEntitiesResponse`
697
+ """
698
+ http_info = self._search_entities_http_info(request)
699
+ return self._call_api(**http_info)
700
+
701
+ def search_entities_async_invoker(self, request):
702
+ http_info = self._search_entities_http_info(request)
703
+ return AsyncInvoker(self, http_info)
704
+
705
+ def _search_entities_http_info(self, request):
706
+ http_info = {
707
+ "method": "POST",
708
+ "resource_path": "/v1/entities/search",
709
+ "request_type": request.__class__.__name__,
710
+ "response_type": "SearchEntitiesResponse"
711
+ }
712
+
713
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
714
+
715
+ cname = None
716
+
717
+ collection_formats = {}
718
+
719
+ path_params = {}
720
+
721
+ query_params = []
722
+
723
+ header_params = {}
724
+
725
+ form_params = {}
726
+
727
+ body = None
728
+ if 'body' in local_var_params:
729
+ body = local_var_params['body']
730
+ if isinstance(request, SdkStreamRequest):
731
+ body = request.get_file_stream()
732
+
733
+ response_headers = []
734
+
735
+ header_params['Content-Type'] = http_utils.select_header_content_type(
736
+ ['application/json'])
737
+
738
+ auth_settings = []
739
+
740
+ http_info["cname"] = cname
741
+ http_info["collection_formats"] = collection_formats
742
+ http_info["path_params"] = path_params
743
+ http_info["query_params"] = query_params
744
+ http_info["header_params"] = header_params
745
+ http_info["post_params"] = form_params
746
+ http_info["body"] = body
747
+ http_info["response_headers"] = response_headers
748
+
749
+ return http_info
750
+
751
+ def upsert_entities_async(self, request):
752
+ r"""更新entity
753
+
754
+ 在指定collection中更新Entity。如果pk列中值存在,则更新Entity,如果不存在,则插入Entity。
755
+
756
+ Please refer to HUAWEI cloud API Explorer for details.
757
+
758
+
759
+ :param request: Request instance for UpsertEntities
760
+ :type request: :class:`huaweicloudsdkdwr.v1.UpsertEntitiesRequest`
761
+ :rtype: :class:`huaweicloudsdkdwr.v1.UpsertEntitiesResponse`
762
+ """
763
+ http_info = self._upsert_entities_http_info(request)
764
+ return self._call_api(**http_info)
765
+
766
+ def upsert_entities_async_invoker(self, request):
767
+ http_info = self._upsert_entities_http_info(request)
768
+ return AsyncInvoker(self, http_info)
769
+
770
+ def _upsert_entities_http_info(self, request):
771
+ http_info = {
772
+ "method": "POST",
773
+ "resource_path": "/v1/entities/upsert",
774
+ "request_type": request.__class__.__name__,
775
+ "response_type": "UpsertEntitiesResponse"
776
+ }
777
+
778
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
779
+
780
+ cname = None
781
+
782
+ collection_formats = {}
783
+
784
+ path_params = {}
785
+
786
+ query_params = []
787
+
788
+ header_params = {}
789
+
790
+ form_params = {}
791
+
792
+ body = None
793
+ if 'body' in local_var_params:
794
+ body = local_var_params['body']
795
+ if isinstance(request, SdkStreamRequest):
796
+ body = request.get_file_stream()
797
+
798
+ response_headers = []
799
+
800
+ header_params['Content-Type'] = http_utils.select_header_content_type(
801
+ ['application/json'])
802
+
803
+ auth_settings = []
804
+
805
+ http_info["cname"] = cname
806
+ http_info["collection_formats"] = collection_formats
807
+ http_info["path_params"] = path_params
808
+ http_info["query_params"] = query_params
809
+ http_info["header_params"] = header_params
810
+ http_info["post_params"] = form_params
811
+ http_info["body"] = body
812
+ http_info["response_headers"] = response_headers
813
+
814
+ return http_info
815
+
816
+ def create_index_async(self, request):
817
+ r"""创建索引
818
+
819
+ 在指定的collection中,按照参数创建索引。
820
+
821
+ Please refer to HUAWEI cloud API Explorer for details.
822
+
823
+
824
+ :param request: Request instance for CreateIndex
825
+ :type request: :class:`huaweicloudsdkdwr.v1.CreateIndexRequest`
826
+ :rtype: :class:`huaweicloudsdkdwr.v1.CreateIndexResponse`
827
+ """
828
+ http_info = self._create_index_http_info(request)
829
+ return self._call_api(**http_info)
830
+
831
+ def create_index_async_invoker(self, request):
832
+ http_info = self._create_index_http_info(request)
833
+ return AsyncInvoker(self, http_info)
834
+
835
+ def _create_index_http_info(self, request):
836
+ http_info = {
837
+ "method": "POST",
838
+ "resource_path": "/v1/indexes/create",
839
+ "request_type": request.__class__.__name__,
840
+ "response_type": "CreateIndexResponse"
841
+ }
842
+
843
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
844
+
845
+ cname = None
846
+
847
+ collection_formats = {}
848
+
849
+ path_params = {}
850
+
851
+ query_params = []
852
+
853
+ header_params = {}
854
+
855
+ form_params = {}
856
+
857
+ body = None
858
+ if 'body' in local_var_params:
859
+ body = local_var_params['body']
860
+ if isinstance(request, SdkStreamRequest):
861
+ body = request.get_file_stream()
862
+
863
+ response_headers = []
864
+
865
+ header_params['Content-Type'] = http_utils.select_header_content_type(
866
+ ['application/json'])
867
+
868
+ auth_settings = []
869
+
870
+ http_info["cname"] = cname
871
+ http_info["collection_formats"] = collection_formats
872
+ http_info["path_params"] = path_params
873
+ http_info["query_params"] = query_params
874
+ http_info["header_params"] = header_params
875
+ http_info["post_params"] = form_params
876
+ http_info["body"] = body
877
+ http_info["response_headers"] = response_headers
878
+
879
+ return http_info
880
+
881
+ def delete_index_async(self, request):
882
+ r"""删除索引
883
+
884
+ 删除指定索引。
885
+
886
+ Please refer to HUAWEI cloud API Explorer for details.
887
+
888
+
889
+ :param request: Request instance for DeleteIndex
890
+ :type request: :class:`huaweicloudsdkdwr.v1.DeleteIndexRequest`
891
+ :rtype: :class:`huaweicloudsdkdwr.v1.DeleteIndexResponse`
892
+ """
893
+ http_info = self._delete_index_http_info(request)
894
+ return self._call_api(**http_info)
895
+
896
+ def delete_index_async_invoker(self, request):
897
+ http_info = self._delete_index_http_info(request)
898
+ return AsyncInvoker(self, http_info)
899
+
900
+ def _delete_index_http_info(self, request):
901
+ http_info = {
902
+ "method": "POST",
903
+ "resource_path": "/v1/indexes/delete",
904
+ "request_type": request.__class__.__name__,
905
+ "response_type": "DeleteIndexResponse"
906
+ }
907
+
908
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
909
+
910
+ cname = None
911
+
912
+ collection_formats = {}
913
+
914
+ path_params = {}
915
+
916
+ query_params = []
917
+
918
+ header_params = {}
919
+
920
+ form_params = {}
921
+
922
+ body = None
923
+ if 'body' in local_var_params:
924
+ body = local_var_params['body']
925
+ if isinstance(request, SdkStreamRequest):
926
+ body = request.get_file_stream()
927
+
928
+ response_headers = []
929
+
930
+ header_params['Content-Type'] = http_utils.select_header_content_type(
931
+ ['application/json'])
932
+
933
+ auth_settings = []
934
+
935
+ http_info["cname"] = cname
936
+ http_info["collection_formats"] = collection_formats
937
+ http_info["path_params"] = path_params
938
+ http_info["query_params"] = query_params
939
+ http_info["header_params"] = header_params
940
+ http_info["post_params"] = form_params
941
+ http_info["body"] = body
942
+ http_info["response_headers"] = response_headers
943
+
944
+ return http_info
945
+
946
+ def describe_index_async(self, request):
947
+ r"""查询索引
948
+
949
+ 查询指定索引的详细信息。
950
+
951
+ Please refer to HUAWEI cloud API Explorer for details.
952
+
953
+
954
+ :param request: Request instance for DescribeIndex
955
+ :type request: :class:`huaweicloudsdkdwr.v1.DescribeIndexRequest`
956
+ :rtype: :class:`huaweicloudsdkdwr.v1.DescribeIndexResponse`
957
+ """
958
+ http_info = self._describe_index_http_info(request)
959
+ return self._call_api(**http_info)
960
+
961
+ def describe_index_async_invoker(self, request):
962
+ http_info = self._describe_index_http_info(request)
963
+ return AsyncInvoker(self, http_info)
964
+
965
+ def _describe_index_http_info(self, request):
966
+ http_info = {
967
+ "method": "POST",
968
+ "resource_path": "/v1/indexes/describe",
969
+ "request_type": request.__class__.__name__,
970
+ "response_type": "DescribeIndexResponse"
971
+ }
972
+
973
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
974
+
975
+ cname = None
976
+
977
+ collection_formats = {}
978
+
979
+ path_params = {}
980
+
981
+ query_params = []
982
+
983
+ header_params = {}
984
+
985
+ form_params = {}
986
+
987
+ body = None
988
+ if 'body' in local_var_params:
989
+ body = local_var_params['body']
990
+ if isinstance(request, SdkStreamRequest):
991
+ body = request.get_file_stream()
992
+
993
+ response_headers = []
994
+
995
+ header_params['Content-Type'] = http_utils.select_header_content_type(
996
+ ['application/json'])
997
+
998
+ auth_settings = []
999
+
1000
+ http_info["cname"] = cname
1001
+ http_info["collection_formats"] = collection_formats
1002
+ http_info["path_params"] = path_params
1003
+ http_info["query_params"] = query_params
1004
+ http_info["header_params"] = header_params
1005
+ http_info["post_params"] = form_params
1006
+ http_info["body"] = body
1007
+ http_info["response_headers"] = response_headers
1008
+
1009
+ return http_info
1010
+
1011
+ def get_progress_async(self, request):
1012
+ r"""查询索引构建进度
1013
+
1014
+ 查询指定索引的构建进度。
1015
+
1016
+ Please refer to HUAWEI cloud API Explorer for details.
1017
+
1018
+
1019
+ :param request: Request instance for GetProgress
1020
+ :type request: :class:`huaweicloudsdkdwr.v1.GetProgressRequest`
1021
+ :rtype: :class:`huaweicloudsdkdwr.v1.GetProgressResponse`
1022
+ """
1023
+ http_info = self._get_progress_http_info(request)
1024
+ return self._call_api(**http_info)
1025
+
1026
+ def get_progress_async_invoker(self, request):
1027
+ http_info = self._get_progress_http_info(request)
1028
+ return AsyncInvoker(self, http_info)
1029
+
1030
+ def _get_progress_http_info(self, request):
1031
+ http_info = {
1032
+ "method": "POST",
1033
+ "resource_path": "/v1/indexes/get-progress",
1034
+ "request_type": request.__class__.__name__,
1035
+ "response_type": "GetProgressResponse"
1036
+ }
1037
+
1038
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1039
+
1040
+ cname = None
1041
+
1042
+ collection_formats = {}
1043
+
1044
+ path_params = {}
1045
+
1046
+ query_params = []
1047
+
1048
+ header_params = {}
1049
+
1050
+ form_params = {}
1051
+
1052
+ body = None
1053
+ if 'body' in local_var_params:
1054
+ body = local_var_params['body']
1055
+ if isinstance(request, SdkStreamRequest):
1056
+ body = request.get_file_stream()
1057
+
1058
+ response_headers = []
1059
+
1060
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1061
+ ['application/json'])
1062
+
1063
+ auth_settings = []
1064
+
1065
+ http_info["cname"] = cname
1066
+ http_info["collection_formats"] = collection_formats
1067
+ http_info["path_params"] = path_params
1068
+ http_info["query_params"] = query_params
1069
+ http_info["header_params"] = header_params
1070
+ http_info["post_params"] = form_params
1071
+ http_info["body"] = body
1072
+ http_info["response_headers"] = response_headers
1073
+
1074
+ return http_info
1075
+
1076
+ def describe_job_async(self, request):
1077
+ r"""获取指定ID任务信息
1078
+
1079
+ 根据指定的jobid查询任务信息。用于在创建和删除知识仓实例操作执行成功后,通过响应中返回的job_id,来查询创建和删除知识仓实例执行的具体结果。
1080
+
1081
+ Please refer to HUAWEI cloud API Explorer for details.
1082
+
1083
+
1084
+ :param request: Request instance for DescribeJob
1085
+ :type request: :class:`huaweicloudsdkdwr.v1.DescribeJobRequest`
1086
+ :rtype: :class:`huaweicloudsdkdwr.v1.DescribeJobResponse`
1087
+ """
1088
+ http_info = self._describe_job_http_info(request)
1089
+ return self._call_api(**http_info)
1090
+
1091
+ def describe_job_async_invoker(self, request):
1092
+ http_info = self._describe_job_http_info(request)
1093
+ return AsyncInvoker(self, http_info)
1094
+
1095
+ def _describe_job_http_info(self, request):
1096
+ http_info = {
1097
+ "method": "POST",
1098
+ "resource_path": "/v1/jobs/describe",
1099
+ "request_type": request.__class__.__name__,
1100
+ "response_type": "DescribeJobResponse"
1101
+ }
1102
+
1103
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1104
+
1105
+ cname = None
1106
+
1107
+ collection_formats = {}
1108
+
1109
+ path_params = {}
1110
+
1111
+ query_params = []
1112
+
1113
+ header_params = {}
1114
+
1115
+ form_params = {}
1116
+
1117
+ body = None
1118
+ if 'body' in local_var_params:
1119
+ body = local_var_params['body']
1120
+ if isinstance(request, SdkStreamRequest):
1121
+ body = request.get_file_stream()
1122
+
1123
+ response_headers = []
1124
+
1125
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1126
+ ['application/json'])
1127
+
1128
+ auth_settings = []
1129
+
1130
+ http_info["cname"] = cname
1131
+ http_info["collection_formats"] = collection_formats
1132
+ http_info["path_params"] = path_params
1133
+ http_info["query_params"] = query_params
1134
+ http_info["header_params"] = header_params
1135
+ http_info["post_params"] = form_params
1136
+ http_info["body"] = body
1137
+ http_info["response_headers"] = response_headers
1138
+
1139
+ return http_info
1140
+
1141
+ def list_jobs_async(self, request):
1142
+ r"""查询任务列表
1143
+
1144
+ 根据指定条件查询列举任务的详情。
1145
+
1146
+ Please refer to HUAWEI cloud API Explorer for details.
1147
+
1148
+
1149
+ :param request: Request instance for ListJobs
1150
+ :type request: :class:`huaweicloudsdkdwr.v1.ListJobsRequest`
1151
+ :rtype: :class:`huaweicloudsdkdwr.v1.ListJobsResponse`
1152
+ """
1153
+ http_info = self._list_jobs_http_info(request)
1154
+ return self._call_api(**http_info)
1155
+
1156
+ def list_jobs_async_invoker(self, request):
1157
+ http_info = self._list_jobs_http_info(request)
1158
+ return AsyncInvoker(self, http_info)
1159
+
1160
+ def _list_jobs_http_info(self, request):
1161
+ http_info = {
1162
+ "method": "POST",
1163
+ "resource_path": "/v1/jobs/list",
1164
+ "request_type": request.__class__.__name__,
1165
+ "response_type": "ListJobsResponse"
1166
+ }
1167
+
1168
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1169
+
1170
+ cname = None
1171
+
1172
+ collection_formats = {}
1173
+
1174
+ path_params = {}
1175
+
1176
+ query_params = []
1177
+ if 'start_time' in local_var_params:
1178
+ query_params.append(('start_time', local_var_params['start_time']))
1179
+ if 'end_time' in local_var_params:
1180
+ query_params.append(('end_time', local_var_params['end_time']))
1181
+ if 'status' in local_var_params:
1182
+ query_params.append(('status', local_var_params['status']))
1183
+ if 'offset' in local_var_params:
1184
+ query_params.append(('offset', local_var_params['offset']))
1185
+ if 'limit' in local_var_params:
1186
+ query_params.append(('limit', local_var_params['limit']))
1187
+
1188
+ header_params = {}
1189
+
1190
+ form_params = {}
1191
+
1192
+ body = None
1193
+ if isinstance(request, SdkStreamRequest):
1194
+ body = request.get_file_stream()
1195
+
1196
+ response_headers = []
1197
+
1198
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1199
+ ['application/json'])
1200
+
1201
+ auth_settings = []
1202
+
1203
+ http_info["cname"] = cname
1204
+ http_info["collection_formats"] = collection_formats
1205
+ http_info["path_params"] = path_params
1206
+ http_info["query_params"] = query_params
1207
+ http_info["header_params"] = header_params
1208
+ http_info["post_params"] = form_params
1209
+ http_info["body"] = body
1210
+ http_info["response_headers"] = response_headers
1211
+
1212
+ return http_info
1213
+
1214
+ def create_store_async(self, request):
1215
+ r"""创建知识仓实例
1216
+
1217
+ 创建知识仓实例。知识仓实例名称全局域一。
1218
+
1219
+ Please refer to HUAWEI cloud API Explorer for details.
1220
+
1221
+
1222
+ :param request: Request instance for CreateStore
1223
+ :type request: :class:`huaweicloudsdkdwr.v1.CreateStoreRequest`
1224
+ :rtype: :class:`huaweicloudsdkdwr.v1.CreateStoreResponse`
1225
+ """
1226
+ http_info = self._create_store_http_info(request)
1227
+ return self._call_api(**http_info)
1228
+
1229
+ def create_store_async_invoker(self, request):
1230
+ http_info = self._create_store_http_info(request)
1231
+ return AsyncInvoker(self, http_info)
1232
+
1233
+ def _create_store_http_info(self, request):
1234
+ http_info = {
1235
+ "method": "POST",
1236
+ "resource_path": "/v1/stores/create",
1237
+ "request_type": request.__class__.__name__,
1238
+ "response_type": "CreateStoreResponse"
1239
+ }
1240
+
1241
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1242
+
1243
+ cname = None
1244
+
1245
+ collection_formats = {}
1246
+
1247
+ path_params = {}
1248
+
1249
+ query_params = []
1250
+
1251
+ header_params = {}
1252
+
1253
+ form_params = {}
1254
+
1255
+ body = None
1256
+ if 'body' in local_var_params:
1257
+ body = local_var_params['body']
1258
+ if isinstance(request, SdkStreamRequest):
1259
+ body = request.get_file_stream()
1260
+
1261
+ response_headers = []
1262
+
1263
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1264
+ ['application/json'])
1265
+
1266
+ auth_settings = []
1267
+
1268
+ http_info["cname"] = cname
1269
+ http_info["collection_formats"] = collection_formats
1270
+ http_info["path_params"] = path_params
1271
+ http_info["query_params"] = query_params
1272
+ http_info["header_params"] = header_params
1273
+ http_info["post_params"] = form_params
1274
+ http_info["body"] = body
1275
+ http_info["response_headers"] = response_headers
1276
+
1277
+ return http_info
1278
+
1279
+ def delete_store_async(self, request):
1280
+ r"""删除知识仓实例
1281
+
1282
+ 删除指定的知识仓实例。
1283
+
1284
+ Please refer to HUAWEI cloud API Explorer for details.
1285
+
1286
+
1287
+ :param request: Request instance for DeleteStore
1288
+ :type request: :class:`huaweicloudsdkdwr.v1.DeleteStoreRequest`
1289
+ :rtype: :class:`huaweicloudsdkdwr.v1.DeleteStoreResponse`
1290
+ """
1291
+ http_info = self._delete_store_http_info(request)
1292
+ return self._call_api(**http_info)
1293
+
1294
+ def delete_store_async_invoker(self, request):
1295
+ http_info = self._delete_store_http_info(request)
1296
+ return AsyncInvoker(self, http_info)
1297
+
1298
+ def _delete_store_http_info(self, request):
1299
+ http_info = {
1300
+ "method": "POST",
1301
+ "resource_path": "/v1/stores/delete",
1302
+ "request_type": request.__class__.__name__,
1303
+ "response_type": "DeleteStoreResponse"
1304
+ }
1305
+
1306
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1307
+
1308
+ cname = None
1309
+
1310
+ collection_formats = {}
1311
+
1312
+ path_params = {}
1313
+
1314
+ query_params = []
1315
+
1316
+ header_params = {}
1317
+
1318
+ form_params = {}
1319
+
1320
+ body = None
1321
+ if 'body' in local_var_params:
1322
+ body = local_var_params['body']
1323
+ if isinstance(request, SdkStreamRequest):
1324
+ body = request.get_file_stream()
1325
+
1326
+ response_headers = []
1327
+
1328
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1329
+ ['application/json'])
1330
+
1331
+ auth_settings = []
1332
+
1333
+ http_info["cname"] = cname
1334
+ http_info["collection_formats"] = collection_formats
1335
+ http_info["path_params"] = path_params
1336
+ http_info["query_params"] = query_params
1337
+ http_info["header_params"] = header_params
1338
+ http_info["post_params"] = form_params
1339
+ http_info["body"] = body
1340
+ http_info["response_headers"] = response_headers
1341
+
1342
+ return http_info
1343
+
1344
+ def describe_store_async(self, request):
1345
+ r"""查询知识仓实例
1346
+
1347
+ 查询指定知识仓实例的详细信息。
1348
+
1349
+ Please refer to HUAWEI cloud API Explorer for details.
1350
+
1351
+
1352
+ :param request: Request instance for DescribeStore
1353
+ :type request: :class:`huaweicloudsdkdwr.v1.DescribeStoreRequest`
1354
+ :rtype: :class:`huaweicloudsdkdwr.v1.DescribeStoreResponse`
1355
+ """
1356
+ http_info = self._describe_store_http_info(request)
1357
+ return self._call_api(**http_info)
1358
+
1359
+ def describe_store_async_invoker(self, request):
1360
+ http_info = self._describe_store_http_info(request)
1361
+ return AsyncInvoker(self, http_info)
1362
+
1363
+ def _describe_store_http_info(self, request):
1364
+ http_info = {
1365
+ "method": "POST",
1366
+ "resource_path": "/v1/stores/describe",
1367
+ "request_type": request.__class__.__name__,
1368
+ "response_type": "DescribeStoreResponse"
1369
+ }
1370
+
1371
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1372
+
1373
+ cname = None
1374
+
1375
+ collection_formats = {}
1376
+
1377
+ path_params = {}
1378
+
1379
+ query_params = []
1380
+
1381
+ header_params = {}
1382
+
1383
+ form_params = {}
1384
+
1385
+ body = None
1386
+ if 'body' in local_var_params:
1387
+ body = local_var_params['body']
1388
+ if isinstance(request, SdkStreamRequest):
1389
+ body = request.get_file_stream()
1390
+
1391
+ response_headers = []
1392
+
1393
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1394
+ ['application/json'])
1395
+
1396
+ auth_settings = []
1397
+
1398
+ http_info["cname"] = cname
1399
+ http_info["collection_formats"] = collection_formats
1400
+ http_info["path_params"] = path_params
1401
+ http_info["query_params"] = query_params
1402
+ http_info["header_params"] = header_params
1403
+ http_info["post_params"] = form_params
1404
+ http_info["body"] = body
1405
+ http_info["response_headers"] = response_headers
1406
+
1407
+ return http_info
1408
+
1409
+ def list_stores_async(self, request):
1410
+ r"""列举知识仓实例
1411
+
1412
+ 列举租户所有的知识仓实例。
1413
+
1414
+ Please refer to HUAWEI cloud API Explorer for details.
1415
+
1416
+
1417
+ :param request: Request instance for ListStores
1418
+ :type request: :class:`huaweicloudsdkdwr.v1.ListStoresRequest`
1419
+ :rtype: :class:`huaweicloudsdkdwr.v1.ListStoresResponse`
1420
+ """
1421
+ http_info = self._list_stores_http_info(request)
1422
+ return self._call_api(**http_info)
1423
+
1424
+ def list_stores_async_invoker(self, request):
1425
+ http_info = self._list_stores_http_info(request)
1426
+ return AsyncInvoker(self, http_info)
1427
+
1428
+ def _list_stores_http_info(self, request):
1429
+ http_info = {
1430
+ "method": "POST",
1431
+ "resource_path": "/v1/stores/list",
1432
+ "request_type": request.__class__.__name__,
1433
+ "response_type": "ListStoresResponse"
1434
+ }
1435
+
1436
+ local_var_params = {attr: getattr(request, attr) for attr in request.attribute_map if hasattr(request, attr)}
1437
+
1438
+ cname = None
1439
+
1440
+ collection_formats = {}
1441
+
1442
+ path_params = {}
1443
+
1444
+ query_params = []
1445
+
1446
+ header_params = {}
1447
+
1448
+ form_params = {}
1449
+
1450
+ body = None
1451
+ if isinstance(request, SdkStreamRequest):
1452
+ body = request.get_file_stream()
1453
+
1454
+ response_headers = []
1455
+
1456
+ header_params['Content-Type'] = http_utils.select_header_content_type(
1457
+ ['application/json'])
1458
+
1459
+ auth_settings = []
1460
+
1461
+ http_info["cname"] = cname
1462
+ http_info["collection_formats"] = collection_formats
1463
+ http_info["path_params"] = path_params
1464
+ http_info["query_params"] = query_params
1465
+ http_info["header_params"] = header_params
1466
+ http_info["post_params"] = form_params
1467
+ http_info["body"] = body
1468
+ http_info["response_headers"] = response_headers
1469
+
1470
+ return http_info
1471
+
1472
+ def _call_api(self, **kwargs):
1473
+ try:
1474
+ kwargs["async_request"] = True
1475
+ return self.do_http_request(**kwargs)
1476
+ except TypeError:
1477
+ import inspect
1478
+ params = inspect.signature(self.do_http_request).parameters
1479
+ http_info = {param_name: kwargs.get(param_name) for param_name in params if param_name in kwargs}
1480
+ return self.do_http_request(**http_info)
1481
+
1482
+ def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None,
1483
+ post_params=None, cname=None, response_type=None, response_headers=None, auth_settings=None,
1484
+ collection_formats=None, request_type=None):
1485
+ """Makes the HTTP request and returns deserialized data.
1486
+
1487
+ :param resource_path: Path to method endpoint.
1488
+ :param method: Method to call.
1489
+ :param path_params: Path parameters in the url.
1490
+ :param query_params: Query parameters in the url.
1491
+ :param header_params: Header parameters to be
1492
+ placed in the request header.
1493
+ :param body: Request body.
1494
+ :param post_params: Request post form parameters,
1495
+ for `application/x-www-form-urlencoded`, `multipart/form-data`.
1496
+ :param cname: Used for obs endpoint.
1497
+ :param auth_settings: Auth Settings names for the request.
1498
+ :param response_type: Response data type.
1499
+ :param response_headers: Header should be added to response data.
1500
+ :param collection_formats: dict of collection formats for path, query,
1501
+ header, and post parameters.
1502
+ :param request_type: Request data type.
1503
+ :return:
1504
+ Return the response directly.
1505
+ """
1506
+ return self.do_http_request(
1507
+ method=method,
1508
+ resource_path=resource_path,
1509
+ path_params=path_params,
1510
+ query_params=query_params,
1511
+ header_params=header_params,
1512
+ body=body,
1513
+ post_params=post_params,
1514
+ cname=cname,
1515
+ response_type=response_type,
1516
+ response_headers=response_headers,
1517
+ collection_formats=collection_formats,
1518
+ request_type=request_type,
1519
+ async_request=True)