tccli 3.0.1183.1__py2.py3-none-any.whl → 3.0.1184.1__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.
@@ -173,6 +173,58 @@ def doDescribeHostCdnInstanceList(args, parsed_globals):
173
173
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
174
174
 
175
175
 
176
+ def doCancelAuditCertificate(args, parsed_globals):
177
+ g_param = parse_global_arg(parsed_globals)
178
+
179
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
180
+ cred = credential.CVMRoleCredential()
181
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
182
+ cred = credential.STSAssumeRoleCredential(
183
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
184
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
185
+ )
186
+ 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):
187
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
188
+ else:
189
+ cred = credential.Credential(
190
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
191
+ )
192
+ http_profile = HttpProfile(
193
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
194
+ reqMethod="POST",
195
+ endpoint=g_param[OptionsDefine.Endpoint],
196
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
197
+ )
198
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
199
+ if g_param[OptionsDefine.Language]:
200
+ profile.language = g_param[OptionsDefine.Language]
201
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
202
+ client = mod.SslClient(cred, g_param[OptionsDefine.Region], profile)
203
+ client._sdkVersion += ("_CLI_" + __version__)
204
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
205
+ model = models.CancelAuditCertificateRequest()
206
+ model.from_json_string(json.dumps(args))
207
+ start_time = time.time()
208
+ while True:
209
+ rsp = client.CancelAuditCertificate(model)
210
+ result = rsp.to_json_string()
211
+ try:
212
+ json_obj = json.loads(result)
213
+ except TypeError as e:
214
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
215
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
216
+ break
217
+ cur_time = time.time()
218
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
219
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
220
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
221
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
222
+ else:
223
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
224
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
225
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
226
+
227
+
176
228
  def doDescribeHostTkeInstanceList(args, parsed_globals):
177
229
  g_param = parse_global_arg(parsed_globals)
178
230
 
@@ -745,7 +797,7 @@ def doDescribeHostDdosInstanceList(args, parsed_globals):
745
797
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
746
798
 
747
799
 
748
- def doVerifyManager(args, parsed_globals):
800
+ def doCompleteCertificate(args, parsed_globals):
749
801
  g_param = parse_global_arg(parsed_globals)
750
802
 
751
803
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -774,11 +826,11 @@ def doVerifyManager(args, parsed_globals):
774
826
  client = mod.SslClient(cred, g_param[OptionsDefine.Region], profile)
775
827
  client._sdkVersion += ("_CLI_" + __version__)
776
828
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
777
- model = models.VerifyManagerRequest()
829
+ model = models.CompleteCertificateRequest()
778
830
  model.from_json_string(json.dumps(args))
779
831
  start_time = time.time()
780
832
  while True:
781
- rsp = client.VerifyManager(model)
833
+ rsp = client.CompleteCertificate(model)
782
834
  result = rsp.to_json_string()
783
835
  try:
784
836
  json_obj = json.loads(result)
@@ -1057,7 +1109,7 @@ def doDeleteCertificate(args, parsed_globals):
1057
1109
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1058
1110
 
1059
1111
 
1060
- def doCompleteCertificate(args, parsed_globals):
1112
+ def doVerifyManager(args, parsed_globals):
1061
1113
  g_param = parse_global_arg(parsed_globals)
1062
1114
 
1063
1115
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1086,11 +1138,11 @@ def doCompleteCertificate(args, parsed_globals):
1086
1138
  client = mod.SslClient(cred, g_param[OptionsDefine.Region], profile)
1087
1139
  client._sdkVersion += ("_CLI_" + __version__)
1088
1140
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1089
- model = models.CompleteCertificateRequest()
1141
+ model = models.VerifyManagerRequest()
1090
1142
  model.from_json_string(json.dumps(args))
1091
1143
  start_time = time.time()
1092
1144
  while True:
1093
- rsp = client.CompleteCertificate(model)
1145
+ rsp = client.VerifyManager(model)
1094
1146
  result = rsp.to_json_string()
1095
1147
  try:
1096
1148
  json_obj = json.loads(result)
@@ -1837,7 +1889,7 @@ def doDescribeCertificateBindResourceTaskResult(args, parsed_globals):
1837
1889
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1838
1890
 
1839
1891
 
1840
- def doCancelAuditCertificate(args, parsed_globals):
1892
+ def doCheckCertificateDomainVerification(args, parsed_globals):
1841
1893
  g_param = parse_global_arg(parsed_globals)
1842
1894
 
1843
1895
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1866,11 +1918,11 @@ def doCancelAuditCertificate(args, parsed_globals):
1866
1918
  client = mod.SslClient(cred, g_param[OptionsDefine.Region], profile)
1867
1919
  client._sdkVersion += ("_CLI_" + __version__)
1868
1920
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1869
- model = models.CancelAuditCertificateRequest()
1921
+ model = models.CheckCertificateDomainVerificationRequest()
1870
1922
  model.from_json_string(json.dumps(args))
1871
1923
  start_time = time.time()
1872
1924
  while True:
1873
- rsp = client.CancelAuditCertificate(model)
1925
+ rsp = client.CheckCertificateDomainVerification(model)
1874
1926
  result = rsp.to_json_string()
1875
1927
  try:
1876
1928
  json_obj = json.loads(result)
@@ -3099,6 +3151,7 @@ ACTION_MAP = {
3099
3151
  "DescribeHostCosInstanceList": doDescribeHostCosInstanceList,
3100
3152
  "DescribeCertificates": doDescribeCertificates,
3101
3153
  "DescribeHostCdnInstanceList": doDescribeHostCdnInstanceList,
3154
+ "CancelAuditCertificate": doCancelAuditCertificate,
3102
3155
  "DescribeHostTkeInstanceList": doDescribeHostTkeInstanceList,
3103
3156
  "UploadRevokeLetter": doUploadRevokeLetter,
3104
3157
  "DeleteManager": doDeleteManager,
@@ -3110,13 +3163,13 @@ ACTION_MAP = {
3110
3163
  "SubmitCertificateInformation": doSubmitCertificateInformation,
3111
3164
  "DeleteCertificates": doDeleteCertificates,
3112
3165
  "DescribeHostDdosInstanceList": doDescribeHostDdosInstanceList,
3113
- "VerifyManager": doVerifyManager,
3166
+ "CompleteCertificate": doCompleteCertificate,
3114
3167
  "DescribeHostClbInstanceList": doDescribeHostClbInstanceList,
3115
3168
  "DescribeHostTeoInstanceList": doDescribeHostTeoInstanceList,
3116
3169
  "CancelCertificateOrder": doCancelCertificateOrder,
3117
3170
  "DownloadCertificate": doDownloadCertificate,
3118
3171
  "DeleteCertificate": doDeleteCertificate,
3119
- "CompleteCertificate": doCompleteCertificate,
3172
+ "VerifyManager": doVerifyManager,
3120
3173
  "UpdateCertificateInstance": doUpdateCertificateInstance,
3121
3174
  "UploadCertificate": doUploadCertificate,
3122
3175
  "CheckCertificateChain": doCheckCertificateChain,
@@ -3131,7 +3184,7 @@ ACTION_MAP = {
3131
3184
  "DeployCertificateRecordRollback": doDeployCertificateRecordRollback,
3132
3185
  "DeployCertificateRecordRetry": doDeployCertificateRecordRetry,
3133
3186
  "DescribeCertificateBindResourceTaskResult": doDescribeCertificateBindResourceTaskResult,
3134
- "CancelAuditCertificate": doCancelAuditCertificate,
3187
+ "CheckCertificateDomainVerification": doCheckCertificateDomainVerification,
3135
3188
  "DescribeHostDeployRecord": doDescribeHostDeployRecord,
3136
3189
  "UpdateCertificateRecordRetry": doUpdateCertificateRecordRetry,
3137
3190
  "DescribeDeleteCertificatesTaskResult": doDescribeDeleteCertificatesTaskResult,
@@ -28,6 +28,13 @@
28
28
  "output": "CheckCertificateChainResponse",
29
29
  "status": "online"
30
30
  },
31
+ "CheckCertificateDomainVerification": {
32
+ "document": "检查证书域名验证",
33
+ "input": "CheckCertificateDomainVerificationRequest",
34
+ "name": "检查证书域名验证",
35
+ "output": "CheckCertificateDomainVerificationResponse",
36
+ "status": "online"
37
+ },
31
38
  "CommitCertificateInformation": {
32
39
  "document": "提交证书订单。",
33
40
  "input": "CommitCertificateInformationRequest",
@@ -1728,6 +1735,43 @@
1728
1735
  ],
1729
1736
  "type": "object"
1730
1737
  },
1738
+ "CheckCertificateDomainVerificationRequest": {
1739
+ "document": "CheckCertificateDomainVerification请求参数结构体",
1740
+ "members": [
1741
+ {
1742
+ "disabled": false,
1743
+ "document": "证书ID。",
1744
+ "example": "无",
1745
+ "member": "string",
1746
+ "name": "CertificateId",
1747
+ "required": true,
1748
+ "type": "string"
1749
+ }
1750
+ ],
1751
+ "type": "object"
1752
+ },
1753
+ "CheckCertificateDomainVerificationResponse": {
1754
+ "document": "CheckCertificateDomainVerification返回参数结构体",
1755
+ "members": [
1756
+ {
1757
+ "disabled": false,
1758
+ "document": "域名验证结果\n注意:此字段可能返回 null,表示取不到有效值。",
1759
+ "example": "无",
1760
+ "member": "DomainValidationResult",
1761
+ "name": "VerificationResults",
1762
+ "required": true,
1763
+ "type": "list",
1764
+ "value_allowed_null": true
1765
+ },
1766
+ {
1767
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
1768
+ "member": "string",
1769
+ "name": "RequestId",
1770
+ "type": "string"
1771
+ }
1772
+ ],
1773
+ "type": "object"
1774
+ },
1731
1775
  "ClbInstanceDetail": {
1732
1776
  "document": "clb实例详情",
1733
1777
  "members": [
@@ -6724,6 +6768,92 @@
6724
6768
  ],
6725
6769
  "type": "object"
6726
6770
  },
6771
+ "DomainValidationResult": {
6772
+ "document": "域名验证结果",
6773
+ "members": [
6774
+ {
6775
+ "disabled": false,
6776
+ "document": "域名。",
6777
+ "example": "qq.com",
6778
+ "member": "string",
6779
+ "name": "Domain",
6780
+ "required": true,
6781
+ "type": "string",
6782
+ "value_allowed_null": false
6783
+ },
6784
+ {
6785
+ "disabled": false,
6786
+ "document": "验证类型。\n注意:此字段可能返回 null,表示取不到有效值。",
6787
+ "example": "DNS",
6788
+ "member": "string",
6789
+ "name": "VerifyType",
6790
+ "required": true,
6791
+ "type": "string",
6792
+ "value_allowed_null": true
6793
+ },
6794
+ {
6795
+ "disabled": false,
6796
+ "document": "本地检查结果。",
6797
+ "example": "1",
6798
+ "member": "int64",
6799
+ "name": "LocalCheck",
6800
+ "required": true,
6801
+ "type": "int",
6802
+ "value_allowed_null": false
6803
+ },
6804
+ {
6805
+ "disabled": false,
6806
+ "document": "CA检查结果。",
6807
+ "example": "1",
6808
+ "member": "int64",
6809
+ "name": "CaCheck",
6810
+ "required": true,
6811
+ "type": "int",
6812
+ "value_allowed_null": false
6813
+ },
6814
+ {
6815
+ "disabled": false,
6816
+ "document": "检查失败原因。\n注意:此字段可能返回 null,表示取不到有效值。",
6817
+ "example": "无",
6818
+ "member": "string",
6819
+ "name": "LocalCheckFailReason",
6820
+ "required": true,
6821
+ "type": "string",
6822
+ "value_allowed_null": true
6823
+ },
6824
+ {
6825
+ "disabled": false,
6826
+ "document": "检查到的值。\n注意:此字段可能返回 null,表示取不到有效值。",
6827
+ "example": "无",
6828
+ "member": "string",
6829
+ "name": "CheckValue",
6830
+ "required": true,
6831
+ "type": "list",
6832
+ "value_allowed_null": true
6833
+ },
6834
+ {
6835
+ "disabled": false,
6836
+ "document": "是否频繁请求。",
6837
+ "example": "false",
6838
+ "member": "bool",
6839
+ "name": "Frequently",
6840
+ "required": true,
6841
+ "type": "bool",
6842
+ "value_allowed_null": false
6843
+ },
6844
+ {
6845
+ "disabled": false,
6846
+ "document": "是否已经签发。",
6847
+ "example": "false",
6848
+ "member": "bool",
6849
+ "name": "Issued",
6850
+ "required": true,
6851
+ "type": "bool",
6852
+ "value_allowed_null": false
6853
+ }
6854
+ ],
6855
+ "usage": "out"
6856
+ },
6727
6857
  "DownloadCertificateRequest": {
6728
6858
  "document": "DownloadCertificate请求参数结构体",
6729
6859
  "members": [
@@ -32,6 +32,14 @@
32
32
  "title": "对证书链进行检查"
33
33
  }
34
34
  ],
35
+ "CheckCertificateDomainVerification": [
36
+ {
37
+ "document": "",
38
+ "input": "POST / HTTP/1.1\nHost: ssl.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CheckCertificateDomainVerification\n<公共请求参数>\n\n{\n \"CertificateId\": \"xx\"\n}",
39
+ "output": "{\n \"Response\": {\n \"VerificationResults\": [\n {\n \"Domain\": \"xx\",\n \"CheckValue\": [\n \"xx\"\n ],\n \"LocalCheckFailReason\": \"xx\",\n \"LocalCheck\": 0,\n \"CaCheck\": 0,\n \"Frequently\": true,\n \"VerifyType\": \"xx\",\n \"Issued\": true\n }\n ],\n \"RequestId\": \"xx\"\n }\n}",
40
+ "title": "检查证书域名验证"
41
+ }
42
+ ],
35
43
  "CommitCertificateInformation": [
36
44
  {
37
45
  "document": "提交证书订单",
@@ -489,6 +489,58 @@ def doDescribeNodes(args, parsed_globals):
489
489
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
490
490
 
491
491
 
492
+ def doCreateWorkspaces(args, parsed_globals):
493
+ g_param = parse_global_arg(parsed_globals)
494
+
495
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
496
+ cred = credential.CVMRoleCredential()
497
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
498
+ cred = credential.STSAssumeRoleCredential(
499
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
500
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
501
+ )
502
+ 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):
503
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
504
+ else:
505
+ cred = credential.Credential(
506
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
507
+ )
508
+ http_profile = HttpProfile(
509
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
510
+ reqMethod="POST",
511
+ endpoint=g_param[OptionsDefine.Endpoint],
512
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
513
+ )
514
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
515
+ if g_param[OptionsDefine.Language]:
516
+ profile.language = g_param[OptionsDefine.Language]
517
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
518
+ client = mod.ThpcClient(cred, g_param[OptionsDefine.Region], profile)
519
+ client._sdkVersion += ("_CLI_" + __version__)
520
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
521
+ model = models.CreateWorkspacesRequest()
522
+ model.from_json_string(json.dumps(args))
523
+ start_time = time.time()
524
+ while True:
525
+ rsp = client.CreateWorkspaces(model)
526
+ result = rsp.to_json_string()
527
+ try:
528
+ json_obj = json.loads(result)
529
+ except TypeError as e:
530
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
531
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
532
+ break
533
+ cur_time = time.time()
534
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
535
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
536
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
537
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
538
+ else:
539
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
540
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
541
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
542
+
543
+
492
544
  def doDescribeInitNodeScripts(args, parsed_globals):
493
545
  g_param = parse_global_arg(parsed_globals)
494
546
 
@@ -1085,6 +1137,7 @@ ACTION_MAP = {
1085
1137
  "SetAutoScalingConfiguration": doSetAutoScalingConfiguration,
1086
1138
  "AddQueue": doAddQueue,
1087
1139
  "DescribeNodes": doDescribeNodes,
1140
+ "CreateWorkspaces": doCreateWorkspaces,
1088
1141
  "DescribeInitNodeScripts": doDescribeInitNodeScripts,
1089
1142
  "AttachNodes": doAttachNodes,
1090
1143
  "DescribeQueues": doDescribeQueues,