bce-python-sdk 0.9.72__py3-none-any.whl → 0.9.79__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.
baidubce/__init__.py CHANGED
@@ -18,7 +18,7 @@ from builtins import bytes
18
18
  from . import protocol
19
19
 
20
20
 
21
- SDK_VERSION = b'0.9.72'
21
+ SDK_VERSION = b'0.9.79'
22
22
  DEFAULT_SERVICE_DOMAIN = b'bcebos.com'
23
23
  URL_PREFIX = b'/v1'
24
24
  DEFAULT_ENCODING = 'UTF-8'
@@ -25,7 +25,6 @@ class JobClient(AIHCBaseClient):
25
25
  def DescribeJobs(
26
26
  self,
27
27
  resourcePoolId,
28
- queueID=None,
29
28
  queue=None,
30
29
  status=None,
31
30
  keywordType=None,
@@ -42,7 +41,6 @@ class JobClient(AIHCBaseClient):
42
41
 
43
42
  Args:
44
43
  resourcePoolId: 注意区分资源池类型,自运维资源池传递资源池唯一标识(示例:cce-1uji3ib5),托管资源池固定传递 aihc-serverless(必填)
45
- queueID: 托管资源池需传入该参数,为队列Id(可选,Query参数)
46
44
  queue: 训练任务所属队列,通用资源池须填入队列名称,不填时返回所有。托管资源池须填入队列Id(可选,Body参数)
47
45
  status: 基于状态筛选任务(可选,Body参数)
48
46
  keywordType: 筛选关键字类型(可选,Body参数)
@@ -64,8 +62,6 @@ class JobClient(AIHCBaseClient):
64
62
  'action': 'DescribeJobs',
65
63
  'resourcePoolId': resourcePoolId,
66
64
  }
67
- if queueID:
68
- params['queueID'] = queueID
69
65
 
70
66
  body = {}
71
67
  if queue is not None:
@@ -130,7 +126,7 @@ class JobClient(AIHCBaseClient):
130
126
  body['needDetail'] = needDetail
131
127
  return self._send_job_request(http_methods.POST, path, body=json.dumps(body), params=params)
132
128
 
133
- def DeleteJob(self, resourcePoolId, jobId):
129
+ def DeleteJob(self, resourcePoolId, queueID, jobId):
134
130
  """
135
131
  删除训练任务。
136
132
 
@@ -138,8 +134,8 @@ class JobClient(AIHCBaseClient):
138
134
 
139
135
  Args:
140
136
  resourcePoolId: 注意区分资源池类型,自运维资源池传递资源池唯一标识(示例:cce-1uji3ib5),托管资源池固定传递 aihc-serverless(必填)
137
+ queueID: 训练任务所属队列,自运维资源池须填入队列名称,托管资源池须填入队列Id(必填,Query参数)
141
138
  jobId: 训练任务ID(必填,Body参数)
142
- jobId: string
143
139
 
144
140
  Returns:
145
141
  baidubce.bce_response.BceResponse: 删除任务结果
@@ -152,13 +148,14 @@ class JobClient(AIHCBaseClient):
152
148
  params = {
153
149
  'action': 'DeleteJob',
154
150
  'resourcePoolId': resourcePoolId,
151
+ 'queueID': queueID,
155
152
  }
156
153
  body = {
157
154
  'jobId': jobId,
158
155
  }
159
156
  return self._send_job_request(http_methods.POST, path, body=json.dumps(body), params=params)
160
157
 
161
- def ModifyJob(self, resourcePoolId, jobId, priority):
158
+ def ModifyJob(self, resourcePoolId, queueID, jobId, priority):
162
159
  """
163
160
  更新训练任务。
164
161
 
@@ -166,6 +163,7 @@ class JobClient(AIHCBaseClient):
166
163
 
167
164
  Args:
168
165
  resourcePoolId: 注意区分资源池类型,自运维资源池传递资源池唯一标识(示例:cce-1uji3ib5),托管资源池固定传递 aihc-serverless(必填)
166
+ queueID: 训练任务所属队列,自运维资源池须填入队列名称,托管资源池须填入队列Id(必填,Query参数)
169
167
  jobId: 训练任务ID(必填,Body参数)
170
168
  priority: 优先级(必填,Body参数),如 "normal"
171
169
 
@@ -180,6 +178,7 @@ class JobClient(AIHCBaseClient):
180
178
  params = {
181
179
  'action': 'ModifyJob',
182
180
  'resourcePoolId': resourcePoolId,
181
+ 'queueID': queueID,
183
182
  }
184
183
  body = {
185
184
  'jobId': jobId,
@@ -190,6 +189,7 @@ class JobClient(AIHCBaseClient):
190
189
  def DescribeJobEvents(
191
190
  self,
192
191
  resourcePoolId,
192
+ queueID,
193
193
  jobId,
194
194
  startTime=None,
195
195
  endTime=None
@@ -201,6 +201,7 @@ class JobClient(AIHCBaseClient):
201
201
 
202
202
  Args:
203
203
  resourcePoolId: 注意区分资源池类型,自运维资源池传递资源池唯一标识(示例:cce-1uji3ib5),托管资源池固定传递 aihc-serverless(必填)
204
+ queueID: 训练任务所属队列,自运维资源池须填入队列名称,托管资源池须填入队列Id(必填,Query参数)
204
205
  jobId: 训练任务ID(必填,Body参数)
205
206
  startTime: 获取任务事件的起始时间(可选,Body参数)
206
207
  endTime: 获取任务事件的结束时间(可选,Body参数)
@@ -216,6 +217,7 @@ class JobClient(AIHCBaseClient):
216
217
  params = {
217
218
  'action': 'DescribeJobEvents',
218
219
  'resourcePoolId': resourcePoolId,
220
+ 'queueID': queueID,
219
221
  }
220
222
  body = {
221
223
  'jobId': jobId,
@@ -229,6 +231,7 @@ class JobClient(AIHCBaseClient):
229
231
  def DescribeJobLogs(
230
232
  self,
231
233
  resourcePoolId,
234
+ queueID,
232
235
  jobId,
233
236
  podName,
234
237
  keywords=None,
@@ -245,6 +248,7 @@ class JobClient(AIHCBaseClient):
245
248
 
246
249
  Args:
247
250
  resourcePoolId: 注意区分资源池类型,自运维资源池传递资源池唯一标识(示例:cce-1uji3ib5),托管资源池固定传递 aihc-serverless(必填)
251
+ queueID: 训练任务所属队列,自运维资源池须填入队列名称,托管资源池须填入队列Id(必填,Query参数)
248
252
  jobId: 训练任务ID(必填,Body参数)
249
253
  podName: Pod名称(必填,Body参数)
250
254
  keywords: 日志查询关键字(可选,Body参数)
@@ -265,6 +269,7 @@ class JobClient(AIHCBaseClient):
265
269
  params = {
266
270
  'action': 'DescribeJobLogs',
267
271
  'resourcePoolId': resourcePoolId,
272
+ 'queueID': queueID,
268
273
  }
269
274
  body = {
270
275
  'jobId': jobId,
@@ -294,6 +299,7 @@ class JobClient(AIHCBaseClient):
294
299
  def DescribeJobPodEvents(
295
300
  self,
296
301
  resourcePoolId,
302
+ queueID,
297
303
  jobId,
298
304
  podName,
299
305
  startTime=None,
@@ -306,6 +312,7 @@ class JobClient(AIHCBaseClient):
306
312
 
307
313
  Args:
308
314
  resourcePoolId: 注意区分资源池类型,自运维资源池传递资源池唯一标识(示例:cce-1uji3ib5),托管资源池固定传递 aihc-serverless(必填)
315
+ queueID: 训练任务所属队列,自运维资源池须填入队列名称,托管资源池须填入队列Id(必填,Query参数)
309
316
  jobId: 训练任务ID(必填,Body参数)
310
317
  podName: 训练任务节点名称(必填,Body参数)
311
318
  startTime: 事件起始时间,Unix时间格式(可选,Body参数)
@@ -322,6 +329,7 @@ class JobClient(AIHCBaseClient):
322
329
  params = {
323
330
  'action': 'DescribePodEvents',
324
331
  'resourcePoolId': resourcePoolId,
332
+ 'queueID': queueID,
325
333
  }
326
334
  body = {
327
335
  'jobId': jobId,
@@ -339,7 +347,7 @@ class JobClient(AIHCBaseClient):
339
347
  params=params
340
348
  )
341
349
 
342
- def StopJob(self, resourcePoolId, jobId):
350
+ def StopJob(self, resourcePoolId, queueID, jobId):
343
351
  """
344
352
  停止训练任务。
345
353
 
@@ -347,6 +355,7 @@ class JobClient(AIHCBaseClient):
347
355
 
348
356
  Args:
349
357
  resourcePoolId: 注意区分资源池类型,自运维资源池传递资源池唯一标识(示例:cce-1uji3ib5),托管资源池固定传递 aihc-serverless(必填)
358
+ queueID: 训练任务所属队列,自运维资源池须填入队列名称,托管资源池须填入队列Id(必填,Query参数)
350
359
  jobId: 训练任务ID(必填,Body参数)
351
360
 
352
361
  Returns:
@@ -360,6 +369,7 @@ class JobClient(AIHCBaseClient):
360
369
  params = {
361
370
  'action': 'StopJob',
362
371
  'resourcePoolId': resourcePoolId,
372
+ 'queueID': queueID,
363
373
  }
364
374
  body = {
365
375
  'jobId': jobId,
@@ -371,7 +381,7 @@ class JobClient(AIHCBaseClient):
371
381
  params=params
372
382
  )
373
383
 
374
- def DescribeJobNodes(self, resourcePoolId, jobId):
384
+ def DescribeJobNodes(self, resourcePoolId, queueID, jobId):
375
385
  """
376
386
  查询训练任务所在节点列表。
377
387
 
@@ -379,6 +389,7 @@ class JobClient(AIHCBaseClient):
379
389
 
380
390
  Args:
381
391
  resourcePoolId: 注意区分资源池类型,自运维资源池传递资源池唯一标识(示例:cce-1uji3ib5),托管资源池固定传递 aihc-serverless(必填)
392
+ queueID: 训练任务所属队列,自运维资源池须填入队列名称,托管资源池须填入队列Id(必填,Query参数)
382
393
  jobId: 训练任务ID(必填,Body参数)
383
394
 
384
395
  Returns:
@@ -392,6 +403,7 @@ class JobClient(AIHCBaseClient):
392
403
  params = {
393
404
  'action': 'DescribeJobNodes',
394
405
  'resourcePoolId': resourcePoolId,
406
+ 'queueID': queueID,
395
407
  }
396
408
  body = {
397
409
  'jobId': jobId,
@@ -406,6 +418,7 @@ class JobClient(AIHCBaseClient):
406
418
  def DescribeJobWebterminal(
407
419
  self,
408
420
  resourcePoolId,
421
+ queueID,
409
422
  jobId,
410
423
  podName,
411
424
  handshakeTimeoutSecond=None,
@@ -418,6 +431,7 @@ class JobClient(AIHCBaseClient):
418
431
 
419
432
  Args:
420
433
  resourcePoolId: 注意区分资源池类型,自运维资源池传递资源池唯一标识(示例:cce-1uji3ib5),托管资源池固定传递 aihc-serverless(必填)
434
+ queueID: 训练任务所属队列,自运维资源池须填入队列名称,托管资源池须填入队列Id(必填,Query参数)
421
435
  jobId: 训练任务ID(必填,Body参数)
422
436
  podName: 训练任务节点名称(必填,Body参数)
423
437
  handshakeTimeoutSecond: 连接超时参数,单位秒(可选,Body参数)
@@ -434,6 +448,7 @@ class JobClient(AIHCBaseClient):
434
448
  params = {
435
449
  'action': 'DescribeJobWebterminal',
436
450
  'resourcePoolId': resourcePoolId,
451
+ 'queueID': queueID,
437
452
  }
438
453
  body = {
439
454
  'jobId': jobId,
@@ -1915,7 +1915,7 @@ class BccClient(bce_base_client.BceBaseClient):
1915
1915
 
1916
1916
  @required(instance_id=(bytes, str),
1917
1917
  tags=list)
1918
- def bind_instance_to_tags(self, instance_id, tags, attachRelatedResourceTag, config=None):
1918
+ def bind_instance_to_tags(self, instance_id, tags, attachRelatedResourceTag=None, config=None):
1919
1919
  """
1920
1920
  :param instance_id:
1921
1921
  :param tags:
@@ -1927,9 +1927,10 @@ class BccClient(bce_base_client.BceBaseClient):
1927
1927
  path = b'/instance/%s/tag' % instance_id
1928
1928
  tag_list = [tag.__dict__ for tag in tags]
1929
1929
  body = {
1930
- 'changeTags': tag_list,
1931
- 'attachRelatedResourceTag': attachRelatedResourceTag
1930
+ 'changeTags': tag_list
1932
1931
  }
1932
+ if attachRelatedResourceTag is not None:
1933
+ body['attachRelatedResourceTag'] = attachRelatedResourceTag
1933
1934
  params = {
1934
1935
  'bind': None
1935
1936
  }
@@ -1938,7 +1939,7 @@ class BccClient(bce_base_client.BceBaseClient):
1938
1939
 
1939
1940
  @required(instance_id=(bytes, str),
1940
1941
  tags=list)
1941
- def unbind_instance_from_tags(self, instance_id, tags, attachRelatedResourceTag, config=None):
1942
+ def unbind_instance_from_tags(self, instance_id, tags, attachRelatedResourceTag=None, config=None):
1942
1943
  """
1943
1944
  :param instance_id:
1944
1945
  :param tags:
@@ -1950,9 +1951,10 @@ class BccClient(bce_base_client.BceBaseClient):
1950
1951
  path = b'/instance/%s/tag' % instance_id
1951
1952
  tag_list = [tag.__dict__ for tag in tags]
1952
1953
  body = {
1953
- 'changeTags': tag_list,
1954
- 'attachRelatedResourceTag': attachRelatedResourceTag
1954
+ 'changeTags': tag_list
1955
1955
  }
1956
+ if attachRelatedResourceTag is not None:
1957
+ body['attachRelatedResourceTag'] = attachRelatedResourceTag
1956
1958
  params = {
1957
1959
  'unbind': None
1958
1960
  }
@@ -3239,6 +3241,172 @@ class BccClient(bce_base_client.BceBaseClient):
3239
3241
  path = b'/snapshot/%s' % snapshot_id
3240
3242
  return self._send_request(http_methods.DELETE, path, config=config)
3241
3243
 
3244
+ @required(instance_id=(bytes, str), # ***Unicode***
3245
+ name=(bytes, str)) # ***Unicode***
3246
+ def create_instance_snapshot(self,
3247
+ instance_id,
3248
+ name,
3249
+ desc=None,
3250
+ volumes=None,
3251
+ retention_in_days=None,
3252
+ res_group_id=None,
3253
+ tags=None,
3254
+ config=None):
3255
+ """
3256
+ Creating an instance snapshot (a consistent snapshot group) for the specified instance.
3257
+ All the parameters are carried by the JSON request body instead of the query string.
3258
+ This is an asynchronous interface,
3259
+ you can get the latest status by BccClient.list_instance_snapshot.
3260
+
3261
+ :param instance_id:
3262
+ The id of the instance which the instance snapshot will be created from.
3263
+ :type instance_id: string
3264
+
3265
+ :param name:
3266
+ The name for the instance snapshot that will be created.
3267
+ :type name: string
3268
+
3269
+ :param desc:
3270
+ The optional parameter to describe the information of the new instance snapshot.
3271
+ :type desc: string
3272
+
3273
+ :param volumes:
3274
+ The optional list of the volume id to be included in the instance snapshot.
3275
+ If it's not specified, all the volumes of the instance will be included.
3276
+ :type volumes: list<string>
3277
+
3278
+ :param retention_in_days:
3279
+ The optional parameter to specify how many days the instance snapshot will be retained.
3280
+ :type retention_in_days: int
3281
+
3282
+ :param res_group_id:
3283
+ The optional parameter to specify the id of the resource group.
3284
+ :type res_group_id: string
3285
+
3286
+ :param tags:
3287
+ The optional list of tag to be bonded.
3288
+ :type tags: list<bcc_model.TagModel>
3289
+
3290
+ :return:
3291
+ The response body contains inSnapshotId(string) and snapshotIds(list<string>).
3292
+ :rtype baidubce.bce_response.BceResponse
3293
+ """
3294
+ path = b'/snapshot/insnap/create'
3295
+ body = {
3296
+ 'instanceId': instance_id,
3297
+ 'name': name
3298
+ }
3299
+ if desc is not None:
3300
+ body['desc'] = desc
3301
+ if volumes is not None:
3302
+ body['volumes'] = volumes
3303
+ if retention_in_days is not None:
3304
+ body['retentionInDays'] = retention_in_days
3305
+ if res_group_id is not None:
3306
+ body['resGroupId'] = res_group_id
3307
+ if tags is not None:
3308
+ tag_list = [tag if isinstance(tag, dict) else tag.__dict__ for tag in tags]
3309
+ body['tags'] = tag_list
3310
+ return self._send_request(http_methods.POST, path, json.dumps(body), config=config)
3311
+
3312
+ @required(delete_insnap_ids=list)
3313
+ def delete_instance_snapshot(self, delete_insnap_ids, config=None):
3314
+ """
3315
+ Deleting the specified instance snapshots.
3316
+ All the parameters are carried by the JSON request body instead of the query string.
3317
+ There is no response body for this interface.
3318
+
3319
+ :param delete_insnap_ids:
3320
+ The list of the instance snapshot id which will be deleted.
3321
+ :type delete_insnap_ids: list<string>
3322
+
3323
+ :return:
3324
+ :rtype baidubce.bce_response.BceResponse
3325
+ """
3326
+ path = b'/snapshot/insnap/delete'
3327
+ body = {
3328
+ 'deleteInsnapIds': delete_insnap_ids
3329
+ }
3330
+ return self._send_request(http_methods.POST, path, json.dumps(body), config=config)
3331
+
3332
+ @required(name=(bytes, str)) # ***Unicode***
3333
+ def rename_instance_snapshot(self, insnap_ids, name, config=None):
3334
+ """
3335
+ Renaming the specified instance snapshots.
3336
+ All the parameters are carried by the JSON request body instead of the query string.
3337
+ There is no response body for this interface.
3338
+
3339
+ :param insnap_ids:
3340
+ The list of the instance snapshot id which will be renamed.
3341
+ :type insnap_ids: list<string>
3342
+
3343
+ :param name:
3344
+ The new name for the specified instance snapshots.
3345
+ :type name: string
3346
+
3347
+ :return:
3348
+ :rtype baidubce.bce_response.BceResponse
3349
+ """
3350
+ path = b'/snapshot/insnap/rename'
3351
+ body = {
3352
+ 'name': name
3353
+ }
3354
+ if insnap_ids is not None:
3355
+ body['insnapIds'] = insnap_ids
3356
+ return self._send_request(http_methods.POST, path, json.dumps(body), config=config)
3357
+
3358
+ def list_instance_snapshot(self, marker=None, max_keys=None, instance_ids=None,
3359
+ instance_snapshot_ids=None, config=None):
3360
+ """
3361
+ Listing the instance snapshots owned by the authenticated user.
3362
+ All the parameters, including marker and maxKeys, are carried by the JSON
3363
+ request body instead of the query string.
3364
+
3365
+ :param marker:
3366
+ The optional parameter marker specified in the original request to specify
3367
+ where in the results to begin listing.
3368
+ Together with the marker, specifies the list result which listing should begin.
3369
+ If the marker is not specified, the list result will listing from the first one.
3370
+ :type marker: string
3371
+
3372
+ :param max_keys:
3373
+ The optional parameter to specifies the max number of list result to return.
3374
+ :type max_keys: int
3375
+
3376
+ :param instance_ids:
3377
+ The optional list of the instance id used to filter the result.
3378
+ :type instance_ids: list<string>
3379
+
3380
+ :param instance_snapshot_ids:
3381
+ The optional list of the instance snapshot id used to filter the result.
3382
+ :type instance_snapshot_ids: list<string>
3383
+
3384
+ :return:
3385
+ The response body contains marker(string), isTruncated(bool),
3386
+ nextMarker(string), maxKeys(int) and instanceSnapshots(list).
3387
+ Every item of instanceSnapshots contains instanceSnapshotId,
3388
+ instanceSnapshotName, instanceSnapshotSizeInGiB, createdTime,
3389
+ instanceSnapshotStatus, instanceId and snapshots(list).
3390
+ Every item of snapshots contains snapshotId, snapshotName,
3391
+ snapshotSizeInGiB, snapshotStatus, volumeId, instanceSnapshotId,
3392
+ creationMethod, description, createdTime, expiredTime, encrypted,
3393
+ imageId, includeDataVolumes, progress and tags. Attention:
3394
+ includeDataVolumes, progress and tags are always null because they are
3395
+ not returned by this interface.
3396
+ :rtype baidubce.bce_response.BceResponse
3397
+ """
3398
+ path = b'/snapshot/insnap/list'
3399
+ body = {}
3400
+ if marker is not None:
3401
+ body['marker'] = marker
3402
+ if max_keys is not None:
3403
+ body['maxKeys'] = max_keys
3404
+ if instance_ids is not None:
3405
+ body['instanceIds'] = instance_ids
3406
+ if instance_snapshot_ids is not None:
3407
+ body['instanceSnapshotIds'] = instance_snapshot_ids
3408
+ return self._send_request(http_methods.POST, path, json.dumps(body), config=config)
3409
+
3242
3410
  @required(name=(bytes, str), # ***Unicode***
3243
3411
  rules=list)
3244
3412
  def create_security_group(self,
@@ -207,3 +207,48 @@ class FileSystemModel(object):
207
207
  self.mountAds = mountAds
208
208
  self.path = path
209
209
  self.protocol = protocol
210
+
211
+
212
+ class InstanceSnapshotStatus(object):
213
+ """
214
+ This class define the status of an instance snapshot (consistent snapshot group).
215
+
216
+ Attention: it is a totally different enum from SnapshotStatus which is used by
217
+ the sub snapshots inside the group. This one keeps the raw lowercase values
218
+ returned by the server, and note that ERROR_DELETING is the only one spelled
219
+ with an underline.
220
+ """
221
+ CREATING = 'creating'
222
+ ACTIVE = 'active'
223
+ ROLLBACK = 'rollback'
224
+ ERROR_ROLLBACK = 'errorRollback'
225
+ DELETING = 'deleting'
226
+ ERROR_DELETING = 'error_deleting'
227
+ ERROR_DELETE = 'errorDelete'
228
+ DELETED = 'deleted'
229
+ ERROR = 'error'
230
+ UNKNOWN = 'unknown'
231
+
232
+
233
+ class SnapshotStatus(object):
234
+ """
235
+ This class define the status of a single volume snapshot, which is used by the
236
+ sub snapshots (the "snapshots" field) inside an instance snapshot group.
237
+
238
+ Attention: the values are capitalized, they do NOT overlap with
239
+ InstanceSnapshotStatus.
240
+ """
241
+ AVAILABLE = 'Available'
242
+ CREATING = 'Creating'
243
+ NOT_AVAILABLE = 'NotAvailable'
244
+ CREATED_FAILED = 'CreatedFailed'
245
+
246
+
247
+ class SnapshotCreationMethod(object):
248
+ """
249
+ This class define how a snapshot was created.
250
+ """
251
+ MANUAL = 'MANUAL'
252
+ AUTO = 'AUTO'
253
+ MIGRATION = 'MIGRATION'
254
+ UNKNOWN = 'UNKNOWN'
@@ -324,6 +324,7 @@ csn_apis = {
324
324
  "method": http_methods.PUT,
325
325
  "path": "/v1/csn/[csnId]/tgw/[tgwId]",
326
326
  "queries": {
327
+ "client_token": None
327
328
  },
328
329
  "headers": {
329
330
  }
@@ -1065,7 +1065,7 @@ class CsnClient(bce_base_client.BceBaseClient):
1065
1065
  return self._send_request(api_config["method"], quote(api_config["path"]).encode("utf8"), api_config["headers"],
1066
1066
  api_config["queries"], json.dumps(body))
1067
1067
 
1068
- def update_tgw(self, csn_id=None, tgw_id=None, update_tgw_request=None):
1068
+ def update_tgw(self, csn_id=None, tgw_id=None, update_tgw_request=None, client_token=None):
1069
1069
  """
1070
1070
  更新TGW的名称、描述。
1071
1071
 
@@ -1081,6 +1081,10 @@ class CsnClient(bce_base_client.BceBaseClient):
1081
1081
  :desc
1082
1082
  :type update_tgw_request: json
1083
1083
 
1084
+ :param client_token:
1085
+ :desc 幂等性Token,是一个长度不超过64位的ASCII字符串,详见ClientToken幂等性
1086
+ :type client_token: str
1087
+
1084
1088
  :return:
1085
1089
  :rtype baidubce.bce_response.BceResponse
1086
1090
  """
@@ -1088,6 +1092,7 @@ class CsnClient(bce_base_client.BceBaseClient):
1088
1092
  api_config = self._get_config(csn_apis, "update_tgw")
1089
1093
  self._add_path_param(api_config, "csnId", csn_id)
1090
1094
  self._add_path_param(api_config, "tgwId", tgw_id)
1095
+ self._add_query(api_config, "clientToken", client_token)
1091
1096
 
1092
1097
  return self._send_request(api_config["method"], quote(api_config["path"]).encode("utf8"), api_config["headers"],
1093
1098
  api_config["queries"], json.dumps(update_tgw_request))
@@ -0,0 +1,14 @@
1
+ # Copyright 2026 Baidu, Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
4
+ # except in compliance with the License. You may obtain a copy of the License at
5
+ #
6
+ # http://www.apache.org/licenses/LICENSE-2.0
7
+ #
8
+ # Unless required by applicable law or agreed to in writing, software distributed under the
9
+ # License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
10
+ # either express or implied. See the License for the specific language governing permissions
11
+ # and limitations under the License.
12
+ """
13
+ DuMemory (Cloud Memory) service package.
14
+ """