tccli 3.0.1041.1__py2.py3-none-any.whl → 3.0.1043.1__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/examples/cloudaudit/v20190319/DeleteAuditTrack.md +1 -1
  3. tccli/examples/cloudaudit/v20190319/DescribeAuditTrack.md +1 -1
  4. tccli/examples/cloudaudit/v20190319/DescribeAuditTracks.md +1 -1
  5. tccli/examples/cloudaudit/v20190319/DescribeEvents.md +2 -2
  6. tccli/examples/cloudaudit/v20190319/ModifyAuditTrack.md +1 -1
  7. tccli/examples/tdid/v20210519/CheckNewPurchase.md +18 -0
  8. tccli/examples/tdid/v20210519/CreateTDidByHost.md +25 -0
  9. tccli/examples/tdid/v20210519/CreateTDidByPubKey.md +28 -0
  10. tccli/examples/tdid/v20210519/DeactivateTDid.md +52 -0
  11. tccli/examples/tdid/v20210519/GetCredentialState.md +33 -0
  12. tccli/examples/tdid/v20210519/GetTDidDocument.md +22 -0
  13. tccli/examples/tdid/v20210519/IssueCredential.md +25 -0
  14. tccli/examples/tdid/v20210519/UpdateCredentialState.md +57 -0
  15. tccli/examples/tdid/v20210519/VerifyCredentials.md +24 -0
  16. tccli/services/car/v20220110/api.json +2 -2
  17. tccli/services/cloudaudit/v20190319/api.json +61 -27
  18. tccli/services/cloudaudit/v20190319/examples.json +6 -6
  19. tccli/services/essbasic/v20210526/api.json +1 -1
  20. tccli/services/tdid/tdid_client.py +36 -248
  21. tccli/services/tdid/v20210519/api.json +346 -712
  22. tccli/services/tdid/v20210519/examples.json +44 -76
  23. tccli/services/trtc/v20190722/api.json +1 -1
  24. {tccli-3.0.1041.1.dist-info → tccli-3.0.1043.1.dist-info}/METADATA +2 -2
  25. {tccli-3.0.1041.1.dist-info → tccli-3.0.1043.1.dist-info}/RECORD +28 -19
  26. {tccli-3.0.1041.1.dist-info → tccli-3.0.1043.1.dist-info}/WHEEL +0 -0
  27. {tccli-3.0.1041.1.dist-info → tccli-3.0.1043.1.dist-info}/entry_points.txt +0 -0
  28. {tccli-3.0.1041.1.dist-info → tccli-3.0.1043.1.dist-info}/license_files/LICENSE +0 -0
@@ -29,7 +29,7 @@
29
29
  "document": "",
30
30
  "input": "POST / HTTP/1.1\nHost: cloudaudit.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DeleteAuditTrack\n<公共请求参数>\n\n{\n \"TrackId\": 1\n}",
31
31
  "output": "{\n \"Response\": {\n \"RequestId\": \"2d4a7fba-bba8-452e-a99e-ccf11fdaa583\"\n }\n}",
32
- "title": "删除云审计跟踪集"
32
+ "title": "删除操作审计跟踪集"
33
33
  }
34
34
  ],
35
35
  "DescribeAudit": [
@@ -45,7 +45,7 @@
45
45
  "document": "",
46
46
  "input": "POST / HTTP/1.1\nHost: cloudaudit.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeAuditTrack\n<公共请求参数>\n\n{\n \"TrackId\": 1\n}",
47
47
  "output": "{\n \"Response\": {\n \"Name\": \"audit\",\n \"ActionType\": \"Read\",\n \"ResourceType\": \"audit\",\n \"EventNames\": [\n \"LookUpEvents\"\n ],\n \"Storage\": {\n \"StorageName\": \"audit-cos\",\n \"StoragePrefix\": \"test\",\n \"StorageRegion\": \"ap-guangzhou\",\n \"StorageType\": \"cos\"\n },\n \"TrackForAllMembers\": 1,\n \"Status\": 1,\n \"CreateTime\": \"2021-01-14 14:43:38\",\n \"RequestId\": \"2d4a7fba-bba8-452e-a99e-ccf11fdaa583\"\n }\n}",
48
- "title": "查询云审计跟踪集详情"
48
+ "title": "查询操作审计跟踪集详情"
49
49
  }
50
50
  ],
51
51
  "DescribeAuditTracks": [
@@ -53,15 +53,15 @@
53
53
  "document": "在控制台或者使用接口,查看已经创建的跟踪集列表",
54
54
  "input": "POST / HTTP/1.1\nHost: cloudaudit.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeAuditTracks\n<公共请求参数>\n\n{\n \"PageNumber\": 1,\n \"PageSize\": 10\n}",
55
55
  "output": "{\n \"Response\": {\n \"Tracks\": [\n {\n \"TrackId\": 1,\n \"Name\": \"audit\",\n \"ActionType\": \"Read\",\n \"ResourceType\": \"audit\",\n \"EventNames\": [\n \"LookUpEvents\"\n ],\n \"Storage\": {\n \"StorageName\": \"audit-cos\",\n \"StoragePrefix\": \"test\",\n \"StorageRegion\": \"ap-guangzhou\",\n \"StorageType\": \"cos\"\n },\n \"Status\": 1,\n \"CreateTime\": \"2021-01-14 14:43:38\"\n }\n ],\n \"TotalCount\": 1,\n \"RequestId\": \"2d4a7fba-bba8-452e-a99e-ccf11fdaa583\"\n }\n}",
56
- "title": "查询云审计跟踪集列表"
56
+ "title": "查询操作审计跟踪集列表"
57
57
  }
58
58
  ],
59
59
  "DescribeEvents": [
60
60
  {
61
- "document": "查询云审计日志",
61
+ "document": "查询操作审计日志",
62
62
  "input": "POST / HTTP/1.1\nHost: cloudaudit.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeEvents\n<公共请求参数>\n\n{\n \"StartTime\": 1610613170,\n \"EndTime\": 1610699570,\n \"MaxResults\": 1\n}",
63
63
  "output": "{\n \"Response\": {\n \"ListOver\": true,\n \"Events\": [\n {\n \"CloudAuditEvent\": \"{\\\"userIdentity\\\":{\\\"principalId\\\":\\\"1000000000\\\",\\\"accountId\\\":\\\"1000000000\\\",\\\"secretId\\\":\\\"xxx\\\",\\\"sessionContext\\\":\\\"{\\\\\\\"token\\\\\\\": \\\\\\\"xxx--Jqr7dXvw3EBEXWNcJljzbZeJeoIrQx9gafWtHV1Lg9zu7hSpY91LAF414n21D41bpodncbz8u12C-xxx\\\\\\\", \\\\\\\"ua\\\\\\\": \\\\\\\"xxx\\\\\\\", \\\\\\\"userIp\\\\\\\": \\\\\\\"111.111.11.111\\\\\\\", \\\\\\\"uin\\\\\\\": 1000000000, \\\\\\\"ownerUin\\\\\\\": 1000000000, \\\\\\\"appId\\\\\\\": 1256196555, \\\\\\\"expireTime\\\\\\\": \\\\\\\"2023-04-03 19:23:29\\\\\\\", \\\\\\\"mfa\\\\\\\": 1, \\\\\\\"mfaExpireTime\\\\\\\": \\\\\\\"0000-00-00 00:00:00\\\\\\\", \\\\\\\"interfaceName\\\\\\\": \\\\\\\"\\\\\\\", \\\\\\\"hasPolicyFilter\\\\\\\": 0, \\\\\\\"policyFilter\\\\\\\": \\\\\\\"\\\\\\\", \\\\\\\"extraInfo\\\\\\\": \\\\\\\"{\\\\\\\\\\\\\\\"dictId\\\\\\\\\\\\\\\":2208,\\\\\\\\\\\\\\\"mfaExpireTime\\\\\\\\\\\\\\\":\\\\\\\\\\\\\\\"3000-12-12 00:00:00\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"sessionUin\\\\\\\\\\\\\\\":5000}\\\\\\\"}\\\",\\\"type\\\":\\\"Root\\\",\\\"userName\\\":\\\"root\\\"},\\\"eventRegion\\\":\\\"ap-guangzhou\\\",\\\"eventVersion\\\":2,\\\"errorCode\\\":\\\"0\\\",\\\"errorMessage\\\":\\\"\\\",\\\"requestID\\\":\\\"008ef803-4549-41fe-a7e6-433122273683\\\",\\\"eventID\\\":\\\"008ef803-4549-41fe-a7e6-433122273683\\\",\\\"apiVersion\\\":\\\"3.0\\\",\\\"eventType\\\":\\\"ConsoleCall\\\",\\\"actionType\\\":\\\"Write\\\",\\\"httpMethod\\\":\\\"POST\\\",\\\"apiErrorCode\\\":0,\\\"apiErrorMessage\\\":\\\"\\\",\\\"userAgent\\\":\\\"SDK_NODEJS_0.2.1\\\",\\\"eventTime\\\":1680513809,\\\"sourceIPAddress\\\":\\\"111.111.111.111\\\",\\\"eventSource\\\":\\\"cloudaudit.ap-guangzhou.api.tencentyun.com\\\",\\\"resources\\\":\\\"[\\\\\\\"*\\\\\\\"]\\\",\\\"resourceName\\\":\\\"\\\",\\\"resourceSet\\\":[],\\\"requestParameters\\\":\\\"{\\\\\\\"ActionType\\\\\\\":\\\\\\\"Write\\\\\\\",\\\\\\\"EventNames\\\\\\\":[\\\\\\\"*\\\\\\\"],\\\\\\\"Name\\\\\\\":\\\\\\\"qweqwe\\\\\\\",\\\\\\\"ResourceType\\\\\\\":\\\\\\\"*\\\\\\\",\\\\\\\"Status\\\\\\\":1,\\\\\\\"Storage\\\\\\\":{\\\\\\\"StorageName\\\\\\\":\\\\\\\"d0f00ec9-5643-4a11-9022-187621d38714\\\\\\\",\\\\\\\"StoragePrefix\\\\\\\":\\\\\\\"cloudaudit\\\\\\\",\\\\\\\"StorageRegion\\\\\\\":\\\\\\\"ap-guangzhou\\\\\\\",\\\\\\\"StorageType\\\\\\\":\\\\\\\"cls\\\\\\\"},\\\\\\\"Version\\\\\\\":\\\\\\\"2019-03-19\\\\\\\"}\\\",\\\"responseElements\\\":\\\"{\\\\\\\"TrackId\\\\\\\":21915,\\\\\\\"RequestId\\\\\\\":\\\\\\\"008ef803-4549-41fe-a7e6-433122273683\\\\\\\"}\\\",\\\"resourceType\\\":\\\"cloudaudit\\\",\\\"eventName\\\":\\\"CreateAuditTrack\\\",\\\"sensitiveAction\\\":\\\"1\\\",\\\"tags\\\":[\\\"\\\"]}\",\n \"EventName\": \"CreateAuditTrack\",\n \"EventTime\": \"1680513809\",\n \"SecretId\": \"xxxxxxx\",\n \"ErrorCode\": 0,\n \"RequestID\": \"008ef803-4549-41fe-a7e6-433122273683\",\n \"SourceIPAddress\": \"111.111.111.111\",\n \"EventSource\": \"cloudaudit.ap-guangzhou.api.tencentyun.com\",\n \"EventRegion\": \"ap-guangzhou\",\n \"Resources\": {\n \"ResourceName\": \"\",\n \"ResourceType\": \"cloudaudit\"\n },\n \"Username\": \"root\",\n \"AccountID\": 100004293724,\n \"Location\": \"中国 广东省 深圳市 中国电信\",\n \"ResourceTypeCn\": \"云审计\",\n \"EventNameCn\": \"创建云审计跟踪集\",\n \"ResourceRegion\": \"\"\n }\n ],\n \"TotalCount\": 1,\n \"NextToken\": 16805138109322956,\n \"RequestId\": \"42a0e189-2869-488f-aa34-8bffd0814322\"\n }\n}",
64
- "title": "查询云审计日志"
64
+ "title": "查询操作审计日志"
65
65
  }
66
66
  ],
67
67
  "GetAttributeKey": [
@@ -125,7 +125,7 @@
125
125
  "document": "",
126
126
  "input": "POST / HTTP/1.1\nHost: cloudaudit.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyAuditTrack\n<公共请求参数>\n\n{\n \"TrackId\": 1,\n \"Name\": \"audit\",\n \"ActionType\": \"Read\",\n \"ResourceType\": \"audit\",\n \"Status\": 0,\n \"TrackForAllMembers\": 1,\n \"EventNames\": [\n \"LookUpEvents\",\n \"DeleteAudit\"\n ],\n \"Storage\": {\n \"StorageType\": \"cos\",\n \"StorageRegion\": \"ap-guangzhou\",\n \"StorageName\": \"audit-cos\",\n \"StoragePrefix\": \"test\"\n }\n}",
127
127
  "output": "{\n \"Response\": {\n \"RequestId\": \"2d4a7fba-bba8-452e-a99e-ccf11fdaa583\"\n }\n}",
128
- "title": "修改云审计跟踪"
128
+ "title": "修改操作审计跟踪"
129
129
  }
130
130
  ],
131
131
  "StartLogging": [
@@ -5782,7 +5782,7 @@
5782
5782
  },
5783
5783
  {
5784
5784
  "disabled": false,
5785
- "document": "变更链接类型:\n<ul>\n<li>**WEIXINAPP** : 创建变更短链。需要在移动端打开,会跳转到微信腾讯电子签小程序进行更换。(默认)</li>\n<li>**APP** : 创建变更小程序链接,可从第三方App跳转到微信腾讯电子签小程序进行更换。</li>\n</ul>",
5785
+ "document": "变更链接类型:\n<ul>\n<li>**WEIXINAPP** : 创建变更短链。需要在移动端打开,会跳转到微信腾讯电子签小程序进行更换。(默认)</li>\n<li>**APP** : 创建变更小程序链接,可从第三方App或者小程序跳转到微信腾讯电子签小程序进行更换。</li>\n</ul>",
5786
5786
  "example": "无",
5787
5787
  "member": "string",
5788
5788
  "name": "Endpoint",
@@ -17,7 +17,7 @@ from tencentcloud.tdid.v20210519 import models as models_v20210519
17
17
  from jmespath import search
18
18
  import time
19
19
 
20
- def doCheckChain(args, parsed_globals):
20
+ def doVerifyCredentials(args, parsed_globals):
21
21
  g_param = parse_global_arg(parsed_globals)
22
22
 
23
23
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -46,11 +46,11 @@ def doCheckChain(args, parsed_globals):
46
46
  client = mod.TdidClient(cred, g_param[OptionsDefine.Region], profile)
47
47
  client._sdkVersion += ("_CLI_" + __version__)
48
48
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
49
- model = models.CheckChainRequest()
49
+ model = models.VerifyCredentialsRequest()
50
50
  model.from_json_string(json.dumps(args))
51
51
  start_time = time.time()
52
52
  while True:
53
- rsp = client.CheckChain(model)
53
+ rsp = client.VerifyCredentials(model)
54
54
  result = rsp.to_json_string()
55
55
  try:
56
56
  json_obj = json.loads(result)
@@ -69,7 +69,7 @@ def doCheckChain(args, parsed_globals):
69
69
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
70
70
 
71
71
 
72
- def doGetCptInfo(args, parsed_globals):
72
+ def doCreateTDidByHost(args, parsed_globals):
73
73
  g_param = parse_global_arg(parsed_globals)
74
74
 
75
75
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -98,11 +98,11 @@ def doGetCptInfo(args, parsed_globals):
98
98
  client = mod.TdidClient(cred, g_param[OptionsDefine.Region], profile)
99
99
  client._sdkVersion += ("_CLI_" + __version__)
100
100
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
101
- model = models.GetCptInfoRequest()
101
+ model = models.CreateTDidByHostRequest()
102
102
  model.from_json_string(json.dumps(args))
103
103
  start_time = time.time()
104
104
  while True:
105
- rsp = client.GetCptInfo(model)
105
+ rsp = client.CreateTDidByHost(model)
106
106
  result = rsp.to_json_string()
107
107
  try:
108
108
  json_obj = json.loads(result)
@@ -121,7 +121,7 @@ def doGetCptInfo(args, parsed_globals):
121
121
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
122
122
 
123
123
 
124
- def doGetDidDocument(args, parsed_globals):
124
+ def doCreateTDidByPubKey(args, parsed_globals):
125
125
  g_param = parse_global_arg(parsed_globals)
126
126
 
127
127
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -150,11 +150,11 @@ def doGetDidDocument(args, parsed_globals):
150
150
  client = mod.TdidClient(cred, g_param[OptionsDefine.Region], profile)
151
151
  client._sdkVersion += ("_CLI_" + __version__)
152
152
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
153
- model = models.GetDidDocumentRequest()
153
+ model = models.CreateTDidByPubKeyRequest()
154
154
  model.from_json_string(json.dumps(args))
155
155
  start_time = time.time()
156
156
  while True:
157
- rsp = client.GetDidDocument(model)
157
+ rsp = client.CreateTDidByPubKey(model)
158
158
  result = rsp.to_json_string()
159
159
  try:
160
160
  json_obj = json.loads(result)
@@ -173,7 +173,7 @@ def doGetDidDocument(args, parsed_globals):
173
173
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
174
174
 
175
175
 
176
- def doCreateSelectiveCredential(args, parsed_globals):
176
+ def doGetTDidDocument(args, parsed_globals):
177
177
  g_param = parse_global_arg(parsed_globals)
178
178
 
179
179
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -202,11 +202,11 @@ def doCreateSelectiveCredential(args, parsed_globals):
202
202
  client = mod.TdidClient(cred, g_param[OptionsDefine.Region], profile)
203
203
  client._sdkVersion += ("_CLI_" + __version__)
204
204
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
205
- model = models.CreateSelectiveCredentialRequest()
205
+ model = models.GetTDidDocumentRequest()
206
206
  model.from_json_string(json.dumps(args))
207
207
  start_time = time.time()
208
208
  while True:
209
- rsp = client.CreateSelectiveCredential(model)
209
+ rsp = client.GetTDidDocument(model)
210
210
  result = rsp.to_json_string()
211
211
  try:
212
212
  json_obj = json.loads(result)
@@ -225,7 +225,7 @@ def doCreateSelectiveCredential(args, parsed_globals):
225
225
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
226
226
 
227
227
 
228
- def doCreateCredential(args, parsed_globals):
228
+ def doUpdateCredentialState(args, parsed_globals):
229
229
  g_param = parse_global_arg(parsed_globals)
230
230
 
231
231
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -254,11 +254,11 @@ def doCreateCredential(args, parsed_globals):
254
254
  client = mod.TdidClient(cred, g_param[OptionsDefine.Region], profile)
255
255
  client._sdkVersion += ("_CLI_" + __version__)
256
256
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
257
- model = models.CreateCredentialRequest()
257
+ model = models.UpdateCredentialStateRequest()
258
258
  model.from_json_string(json.dumps(args))
259
259
  start_time = time.time()
260
260
  while True:
261
- rsp = client.CreateCredential(model)
261
+ rsp = client.UpdateCredentialState(model)
262
262
  result = rsp.to_json_string()
263
263
  try:
264
264
  json_obj = json.loads(result)
@@ -277,7 +277,7 @@ def doCreateCredential(args, parsed_globals):
277
277
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
278
278
 
279
279
 
280
- def doCreateTDidByPublicKey(args, parsed_globals):
280
+ def doDeactivateTDid(args, parsed_globals):
281
281
  g_param = parse_global_arg(parsed_globals)
282
282
 
283
283
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -306,11 +306,11 @@ def doCreateTDidByPublicKey(args, parsed_globals):
306
306
  client = mod.TdidClient(cred, g_param[OptionsDefine.Region], profile)
307
307
  client._sdkVersion += ("_CLI_" + __version__)
308
308
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
309
- model = models.CreateTDidByPublicKeyRequest()
309
+ model = models.DeactivateTDidRequest()
310
310
  model.from_json_string(json.dumps(args))
311
311
  start_time = time.time()
312
312
  while True:
313
- rsp = client.CreateTDidByPublicKey(model)
313
+ rsp = client.DeactivateTDid(model)
314
314
  result = rsp.to_json_string()
315
315
  try:
316
316
  json_obj = json.loads(result)
@@ -329,7 +329,7 @@ def doCreateTDidByPublicKey(args, parsed_globals):
329
329
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
330
330
 
331
331
 
332
- def doGetCredentialStatus(args, parsed_globals):
332
+ def doGetCredentialState(args, parsed_globals):
333
333
  g_param = parse_global_arg(parsed_globals)
334
334
 
335
335
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -358,11 +358,11 @@ def doGetCredentialStatus(args, parsed_globals):
358
358
  client = mod.TdidClient(cred, g_param[OptionsDefine.Region], profile)
359
359
  client._sdkVersion += ("_CLI_" + __version__)
360
360
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
361
- model = models.GetCredentialStatusRequest()
361
+ model = models.GetCredentialStateRequest()
362
362
  model.from_json_string(json.dumps(args))
363
363
  start_time = time.time()
364
364
  while True:
365
- rsp = client.GetCredentialStatus(model)
365
+ rsp = client.GetCredentialState(model)
366
366
  result = rsp.to_json_string()
367
367
  try:
368
368
  json_obj = json.loads(result)
@@ -381,7 +381,7 @@ def doGetCredentialStatus(args, parsed_globals):
381
381
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
382
382
 
383
383
 
384
- def doCreateTDidByPrivateKey(args, parsed_globals):
384
+ def doIssueCredential(args, parsed_globals):
385
385
  g_param = parse_global_arg(parsed_globals)
386
386
 
387
387
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -410,11 +410,11 @@ def doCreateTDidByPrivateKey(args, parsed_globals):
410
410
  client = mod.TdidClient(cred, g_param[OptionsDefine.Region], profile)
411
411
  client._sdkVersion += ("_CLI_" + __version__)
412
412
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
413
- model = models.CreateTDidByPrivateKeyRequest()
413
+ model = models.IssueCredentialRequest()
414
414
  model.from_json_string(json.dumps(args))
415
415
  start_time = time.time()
416
416
  while True:
417
- rsp = client.CreateTDidByPrivateKey(model)
417
+ rsp = client.IssueCredential(model)
418
418
  result = rsp.to_json_string()
419
419
  try:
420
420
  json_obj = json.loads(result)
@@ -433,7 +433,7 @@ def doCreateTDidByPrivateKey(args, parsed_globals):
433
433
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
434
434
 
435
435
 
436
- def doCreateTDid(args, parsed_globals):
436
+ def doCheckNewPurchase(args, parsed_globals):
437
437
  g_param = parse_global_arg(parsed_globals)
438
438
 
439
439
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -462,219 +462,11 @@ def doCreateTDid(args, parsed_globals):
462
462
  client = mod.TdidClient(cred, g_param[OptionsDefine.Region], profile)
463
463
  client._sdkVersion += ("_CLI_" + __version__)
464
464
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
465
- model = models.CreateTDidRequest()
465
+ model = models.CheckNewPurchaseRequest()
466
466
  model.from_json_string(json.dumps(args))
467
467
  start_time = time.time()
468
468
  while True:
469
- rsp = client.CreateTDid(model)
470
- result = rsp.to_json_string()
471
- try:
472
- json_obj = json.loads(result)
473
- except TypeError as e:
474
- json_obj = json.loads(result.decode('utf-8')) # python3.3
475
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
476
- break
477
- cur_time = time.time()
478
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
479
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
480
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
481
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
482
- else:
483
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
484
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
485
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
486
-
487
-
488
- def doRegisterCpt(args, parsed_globals):
489
- g_param = parse_global_arg(parsed_globals)
490
-
491
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
492
- cred = credential.CVMRoleCredential()
493
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
494
- cred = credential.STSAssumeRoleCredential(
495
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
496
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
497
- )
498
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
499
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
500
- else:
501
- cred = credential.Credential(
502
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
503
- )
504
- http_profile = HttpProfile(
505
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
506
- reqMethod="POST",
507
- endpoint=g_param[OptionsDefine.Endpoint],
508
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
509
- )
510
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
511
- if g_param[OptionsDefine.Language]:
512
- profile.language = g_param[OptionsDefine.Language]
513
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
514
- client = mod.TdidClient(cred, g_param[OptionsDefine.Region], profile)
515
- client._sdkVersion += ("_CLI_" + __version__)
516
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
517
- model = models.RegisterCptRequest()
518
- model.from_json_string(json.dumps(args))
519
- start_time = time.time()
520
- while True:
521
- rsp = client.RegisterCpt(model)
522
- result = rsp.to_json_string()
523
- try:
524
- json_obj = json.loads(result)
525
- except TypeError as e:
526
- json_obj = json.loads(result.decode('utf-8')) # python3.3
527
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
528
- break
529
- cur_time = time.time()
530
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
531
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
532
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
533
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
534
- else:
535
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
536
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
537
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
538
-
539
-
540
- def doVerifyCredential(args, parsed_globals):
541
- g_param = parse_global_arg(parsed_globals)
542
-
543
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
544
- cred = credential.CVMRoleCredential()
545
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
546
- cred = credential.STSAssumeRoleCredential(
547
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
548
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
549
- )
550
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
551
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
552
- else:
553
- cred = credential.Credential(
554
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
555
- )
556
- http_profile = HttpProfile(
557
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
558
- reqMethod="POST",
559
- endpoint=g_param[OptionsDefine.Endpoint],
560
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
561
- )
562
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
563
- if g_param[OptionsDefine.Language]:
564
- profile.language = g_param[OptionsDefine.Language]
565
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
566
- client = mod.TdidClient(cred, g_param[OptionsDefine.Region], profile)
567
- client._sdkVersion += ("_CLI_" + __version__)
568
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
569
- model = models.VerifyCredentialRequest()
570
- model.from_json_string(json.dumps(args))
571
- start_time = time.time()
572
- while True:
573
- rsp = client.VerifyCredential(model)
574
- result = rsp.to_json_string()
575
- try:
576
- json_obj = json.loads(result)
577
- except TypeError as e:
578
- json_obj = json.loads(result.decode('utf-8')) # python3.3
579
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
580
- break
581
- cur_time = time.time()
582
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
583
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
584
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
585
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
586
- else:
587
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
588
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
589
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
590
-
591
-
592
- def doGetAuthorityIssuer(args, parsed_globals):
593
- g_param = parse_global_arg(parsed_globals)
594
-
595
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
596
- cred = credential.CVMRoleCredential()
597
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
598
- cred = credential.STSAssumeRoleCredential(
599
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
600
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
601
- )
602
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
603
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
604
- else:
605
- cred = credential.Credential(
606
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
607
- )
608
- http_profile = HttpProfile(
609
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
610
- reqMethod="POST",
611
- endpoint=g_param[OptionsDefine.Endpoint],
612
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
613
- )
614
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
615
- if g_param[OptionsDefine.Language]:
616
- profile.language = g_param[OptionsDefine.Language]
617
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
618
- client = mod.TdidClient(cred, g_param[OptionsDefine.Region], profile)
619
- client._sdkVersion += ("_CLI_" + __version__)
620
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
621
- model = models.GetAuthorityIssuerRequest()
622
- model.from_json_string(json.dumps(args))
623
- start_time = time.time()
624
- while True:
625
- rsp = client.GetAuthorityIssuer(model)
626
- result = rsp.to_json_string()
627
- try:
628
- json_obj = json.loads(result)
629
- except TypeError as e:
630
- json_obj = json.loads(result.decode('utf-8')) # python3.3
631
- if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
632
- break
633
- cur_time = time.time()
634
- if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
635
- raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
636
- (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
637
- search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
638
- else:
639
- print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
640
- time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
641
- FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
642
-
643
-
644
- def doSetCredentialStatus(args, parsed_globals):
645
- g_param = parse_global_arg(parsed_globals)
646
-
647
- if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
648
- cred = credential.CVMRoleCredential()
649
- elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
650
- cred = credential.STSAssumeRoleCredential(
651
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
652
- g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
653
- )
654
- elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
655
- cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
656
- else:
657
- cred = credential.Credential(
658
- g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
659
- )
660
- http_profile = HttpProfile(
661
- reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
662
- reqMethod="POST",
663
- endpoint=g_param[OptionsDefine.Endpoint],
664
- proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
665
- )
666
- profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
667
- if g_param[OptionsDefine.Language]:
668
- profile.language = g_param[OptionsDefine.Language]
669
- mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
670
- client = mod.TdidClient(cred, g_param[OptionsDefine.Region], profile)
671
- client._sdkVersion += ("_CLI_" + __version__)
672
- models = MODELS_MAP[g_param[OptionsDefine.Version]]
673
- model = models.SetCredentialStatusRequest()
674
- model.from_json_string(json.dumps(args))
675
- start_time = time.time()
676
- while True:
677
- rsp = client.SetCredentialStatus(model)
469
+ rsp = client.CheckNewPurchase(model)
678
470
  result = rsp.to_json_string()
679
471
  try:
680
472
  json_obj = json.loads(result)
@@ -704,19 +496,15 @@ MODELS_MAP = {
704
496
  }
705
497
 
706
498
  ACTION_MAP = {
707
- "CheckChain": doCheckChain,
708
- "GetCptInfo": doGetCptInfo,
709
- "GetDidDocument": doGetDidDocument,
710
- "CreateSelectiveCredential": doCreateSelectiveCredential,
711
- "CreateCredential": doCreateCredential,
712
- "CreateTDidByPublicKey": doCreateTDidByPublicKey,
713
- "GetCredentialStatus": doGetCredentialStatus,
714
- "CreateTDidByPrivateKey": doCreateTDidByPrivateKey,
715
- "CreateTDid": doCreateTDid,
716
- "RegisterCpt": doRegisterCpt,
717
- "VerifyCredential": doVerifyCredential,
718
- "GetAuthorityIssuer": doGetAuthorityIssuer,
719
- "SetCredentialStatus": doSetCredentialStatus,
499
+ "VerifyCredentials": doVerifyCredentials,
500
+ "CreateTDidByHost": doCreateTDidByHost,
501
+ "CreateTDidByPubKey": doCreateTDidByPubKey,
502
+ "GetTDidDocument": doGetTDidDocument,
503
+ "UpdateCredentialState": doUpdateCredentialState,
504
+ "DeactivateTDid": doDeactivateTDid,
505
+ "GetCredentialState": doGetCredentialState,
506
+ "IssueCredential": doIssueCredential,
507
+ "CheckNewPurchase": doCheckNewPurchase,
720
508
 
721
509
  }
722
510