tccli 3.0.1342.1__py2.py3-none-any.whl → 3.0.1343.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.
@@ -154,6 +154,13 @@
154
154
  "output": "DescribeDBInstancesResponse",
155
155
  "status": "online"
156
156
  },
157
+ "DescribeDetailedSlowLogs": {
158
+ "document": "查询实例慢日志详情",
159
+ "input": "DescribeDetailedSlowLogsRequest",
160
+ "name": "查询实例慢日志详情",
161
+ "output": "DescribeDetailedSlowLogsResponse",
162
+ "status": "online"
163
+ },
157
164
  "DescribeInstanceParams": {
158
165
  "document": "本接口(DescribeInstanceParams)用于查询当前实例可修改的参数列表。",
159
166
  "input": "DescribeInstanceParamsRequest",
@@ -3028,6 +3035,152 @@
3028
3035
  ],
3029
3036
  "type": "object"
3030
3037
  },
3038
+ "DescribeDetailedSlowLogsRequest": {
3039
+ "document": "DescribeDetailedSlowLogs请求参数结构体",
3040
+ "members": [
3041
+ {
3042
+ "disabled": false,
3043
+ "document": "实例id",
3044
+ "example": "cmgo-xxxx",
3045
+ "member": "string",
3046
+ "name": "InstanceId",
3047
+ "required": true,
3048
+ "type": "string"
3049
+ },
3050
+ {
3051
+ "disabled": false,
3052
+ "document": "待查询慢日志的开始时间",
3053
+ "example": "2025-01-02 13:14:15",
3054
+ "member": "string",
3055
+ "name": "StartTime",
3056
+ "required": true,
3057
+ "type": "string"
3058
+ },
3059
+ {
3060
+ "disabled": false,
3061
+ "document": "待慢日志的结束时间",
3062
+ "example": "2025-01-02 13:14:15",
3063
+ "member": "string",
3064
+ "name": "EndTime",
3065
+ "required": true,
3066
+ "type": "string"
3067
+ },
3068
+ {
3069
+ "disabled": false,
3070
+ "document": "过滤执行时间大于此值的慢日志,单位ms,默认值100",
3071
+ "example": "100",
3072
+ "member": "int64",
3073
+ "name": "ExecTime",
3074
+ "required": false,
3075
+ "type": "int"
3076
+ },
3077
+ {
3078
+ "disabled": false,
3079
+ "document": "过滤慢日志的命令类型",
3080
+ "example": "find",
3081
+ "member": "string",
3082
+ "name": "Commands",
3083
+ "required": false,
3084
+ "type": "list"
3085
+ },
3086
+ {
3087
+ "disabled": false,
3088
+ "document": "全文搜索关键字,多个关键字间为或关系",
3089
+ "example": "[\"aaa\",\"bbb\"]",
3090
+ "member": "string",
3091
+ "name": "Texts",
3092
+ "required": false,
3093
+ "type": "list"
3094
+ },
3095
+ {
3096
+ "disabled": false,
3097
+ "document": "根据节点名过滤",
3098
+ "example": "[\"cmgo-xxxx-node-primary\"]",
3099
+ "member": "string",
3100
+ "name": "NodeNames",
3101
+ "required": false,
3102
+ "type": "list"
3103
+ },
3104
+ {
3105
+ "disabled": false,
3106
+ "document": "根据queryHash过滤",
3107
+ "example": "[\"abcdef\"]",
3108
+ "member": "string",
3109
+ "name": "QueryHash",
3110
+ "required": false,
3111
+ "type": "list"
3112
+ },
3113
+ {
3114
+ "disabled": false,
3115
+ "document": "分页偏移量",
3116
+ "example": "1",
3117
+ "member": "int64",
3118
+ "name": "Offset",
3119
+ "required": false,
3120
+ "type": "int"
3121
+ },
3122
+ {
3123
+ "disabled": false,
3124
+ "document": "返回条数",
3125
+ "example": "10",
3126
+ "member": "int64",
3127
+ "name": "Limit",
3128
+ "required": false,
3129
+ "type": "int"
3130
+ },
3131
+ {
3132
+ "disabled": false,
3133
+ "document": "排序条件,只支持StartTime(按慢日志生成时间)和ExecTime(慢日志执行时间)",
3134
+ "example": "ExecTime",
3135
+ "member": "string",
3136
+ "name": "OrderBy",
3137
+ "required": false,
3138
+ "type": "string"
3139
+ },
3140
+ {
3141
+ "disabled": false,
3142
+ "document": "排序。desc倒排,asc正排",
3143
+ "example": "desc",
3144
+ "member": "string",
3145
+ "name": "OrderByType",
3146
+ "required": false,
3147
+ "type": "string"
3148
+ }
3149
+ ],
3150
+ "type": "object"
3151
+ },
3152
+ "DescribeDetailedSlowLogsResponse": {
3153
+ "document": "DescribeDetailedSlowLogs返回参数结构体",
3154
+ "members": [
3155
+ {
3156
+ "disabled": false,
3157
+ "document": "满足条件的慢日志数量",
3158
+ "example": "100",
3159
+ "member": "int64",
3160
+ "name": "TotalCount",
3161
+ "output_required": false,
3162
+ "type": "int",
3163
+ "value_allowed_null": false
3164
+ },
3165
+ {
3166
+ "disabled": false,
3167
+ "document": "慢日志详情",
3168
+ "example": "无",
3169
+ "member": "SlowLogItem",
3170
+ "name": "DetailedSlowLogs",
3171
+ "output_required": false,
3172
+ "type": "list",
3173
+ "value_allowed_null": false
3174
+ },
3175
+ {
3176
+ "document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
3177
+ "member": "string",
3178
+ "name": "RequestId",
3179
+ "type": "string"
3180
+ }
3181
+ ],
3182
+ "type": "object"
3183
+ },
3031
3184
  "DescribeInstanceParamsRequest": {
3032
3185
  "document": "DescribeInstanceParams请求参数结构体",
3033
3186
  "members": [
@@ -6368,6 +6521,42 @@
6368
6521
  ],
6369
6522
  "usage": "out"
6370
6523
  },
6524
+ "SlowLogItem": {
6525
+ "document": "慢日志详情",
6526
+ "members": [
6527
+ {
6528
+ "disabled": false,
6529
+ "document": "慢日志",
6530
+ "example": "无",
6531
+ "member": "string",
6532
+ "name": "Log",
6533
+ "output_required": false,
6534
+ "type": "string",
6535
+ "value_allowed_null": false
6536
+ },
6537
+ {
6538
+ "disabled": false,
6539
+ "document": "节点名称",
6540
+ "example": "无",
6541
+ "member": "string",
6542
+ "name": "NodeName",
6543
+ "output_required": false,
6544
+ "type": "string",
6545
+ "value_allowed_null": false
6546
+ },
6547
+ {
6548
+ "disabled": false,
6549
+ "document": "queryHash",
6550
+ "example": "无",
6551
+ "member": "string",
6552
+ "name": "QueryHash",
6553
+ "output_required": false,
6554
+ "type": "string",
6555
+ "value_allowed_null": false
6556
+ }
6557
+ ],
6558
+ "usage": "out"
6559
+ },
6371
6560
  "SlowLogPattern": {
6372
6561
  "document": "用于描述MongoDB数据库慢日志统计信息",
6373
6562
  "members": [
@@ -182,6 +182,14 @@
182
182
  "title": "查询实例列表"
183
183
  }
184
184
  ],
185
+ "DescribeDetailedSlowLogs": [
186
+ {
187
+ "document": "",
188
+ "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeDetailedSlowLogs\n<公共请求参数>\n\n{\n \"InstanceId\": \"cmgo-qny2****\",\n \"StartTime\": \"2025-03-27 12:00:00\",\n \"EndTime\": \"2025-03-27 13:33:00\"\n}",
189
+ "output": "{\n \"Response\": {\n \"DetailedSlowLogs\": [\n {\n \"Log\": \"xxxxxxx\",\n \"NodeName\": \"cmgo-xxxx_0-node-primary\",\n \"QueryHash\": \"BA0DFF88\"\n }\n ],\n \"RequestId\": \"a1460a2d-dc8e-467c-b2d5-0beb6b84a7a7\",\n \"TotalCount\": 2\n }\n}",
190
+ "title": "查询慢日志详情"
191
+ }
192
+ ],
185
193
  "DescribeInstanceParams": [
186
194
  {
187
195
  "document": "用户请求该接口获取其mongoDB实例可配置的参数列表;",
@@ -2943,6 +2943,16 @@
2943
2943
  "output_required": true,
2944
2944
  "type": "list",
2945
2945
  "value_allowed_null": false
2946
+ },
2947
+ {
2948
+ "disabled": false,
2949
+ "document": "海关缴款书常用字段",
2950
+ "example": "无",
2951
+ "member": "OtherInvoiceItem",
2952
+ "name": "CommonContent",
2953
+ "output_required": true,
2954
+ "type": "list",
2955
+ "value_allowed_null": false
2946
2956
  }
2947
2957
  ],
2948
2958
  "usage": "out"
@@ -1319,7 +1319,7 @@ def doDescribeEnvironments(args, parsed_globals):
1319
1319
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1320
1320
 
1321
1321
 
1322
- def doIncreasePlanQuota(args, parsed_globals):
1322
+ def doDescribeOriginACL(args, parsed_globals):
1323
1323
  g_param = parse_global_arg(parsed_globals)
1324
1324
 
1325
1325
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -1348,11 +1348,11 @@ def doIncreasePlanQuota(args, parsed_globals):
1348
1348
  client = mod.TeoClient(cred, g_param[OptionsDefine.Region], profile)
1349
1349
  client._sdkVersion += ("_CLI_" + __version__)
1350
1350
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
1351
- model = models.IncreasePlanQuotaRequest()
1351
+ model = models.DescribeOriginACLRequest()
1352
1352
  model.from_json_string(json.dumps(args))
1353
1353
  start_time = time.time()
1354
1354
  while True:
1355
- rsp = client.IncreasePlanQuota(model)
1355
+ rsp = client.DescribeOriginACL(model)
1356
1356
  result = rsp.to_json_string()
1357
1357
  try:
1358
1358
  json_obj = json.loads(result)
@@ -1891,6 +1891,58 @@ def doBindSecurityTemplateToEntity(args, parsed_globals):
1891
1891
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1892
1892
 
1893
1893
 
1894
+ def doModifyOriginACL(args, parsed_globals):
1895
+ g_param = parse_global_arg(parsed_globals)
1896
+
1897
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
1898
+ cred = credential.CVMRoleCredential()
1899
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
1900
+ cred = credential.STSAssumeRoleCredential(
1901
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
1902
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
1903
+ )
1904
+ 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):
1905
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
1906
+ else:
1907
+ cred = credential.Credential(
1908
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
1909
+ )
1910
+ http_profile = HttpProfile(
1911
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
1912
+ reqMethod="POST",
1913
+ endpoint=g_param[OptionsDefine.Endpoint],
1914
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
1915
+ )
1916
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
1917
+ if g_param[OptionsDefine.Language]:
1918
+ profile.language = g_param[OptionsDefine.Language]
1919
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
1920
+ client = mod.TeoClient(cred, g_param[OptionsDefine.Region], profile)
1921
+ client._sdkVersion += ("_CLI_" + __version__)
1922
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
1923
+ model = models.ModifyOriginACLRequest()
1924
+ model.from_json_string(json.dumps(args))
1925
+ start_time = time.time()
1926
+ while True:
1927
+ rsp = client.ModifyOriginACL(model)
1928
+ result = rsp.to_json_string()
1929
+ try:
1930
+ json_obj = json.loads(result)
1931
+ except TypeError as e:
1932
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
1933
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
1934
+ break
1935
+ cur_time = time.time()
1936
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
1937
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
1938
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
1939
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
1940
+ else:
1941
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
1942
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
1943
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
1944
+
1945
+
1894
1946
  def doModifyApplicationProxyRuleStatus(args, parsed_globals):
1895
1947
  g_param = parse_global_arg(parsed_globals)
1896
1948
 
@@ -3711,6 +3763,58 @@ def doCreateL4Proxy(args, parsed_globals):
3711
3763
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3712
3764
 
3713
3765
 
3766
+ def doIncreasePlanQuota(args, parsed_globals):
3767
+ g_param = parse_global_arg(parsed_globals)
3768
+
3769
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
3770
+ cred = credential.CVMRoleCredential()
3771
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
3772
+ cred = credential.STSAssumeRoleCredential(
3773
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
3774
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
3775
+ )
3776
+ 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):
3777
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
3778
+ else:
3779
+ cred = credential.Credential(
3780
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
3781
+ )
3782
+ http_profile = HttpProfile(
3783
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
3784
+ reqMethod="POST",
3785
+ endpoint=g_param[OptionsDefine.Endpoint],
3786
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
3787
+ )
3788
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
3789
+ if g_param[OptionsDefine.Language]:
3790
+ profile.language = g_param[OptionsDefine.Language]
3791
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
3792
+ client = mod.TeoClient(cred, g_param[OptionsDefine.Region], profile)
3793
+ client._sdkVersion += ("_CLI_" + __version__)
3794
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
3795
+ model = models.IncreasePlanQuotaRequest()
3796
+ model.from_json_string(json.dumps(args))
3797
+ start_time = time.time()
3798
+ while True:
3799
+ rsp = client.IncreasePlanQuota(model)
3800
+ result = rsp.to_json_string()
3801
+ try:
3802
+ json_obj = json.loads(result)
3803
+ except TypeError as e:
3804
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
3805
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
3806
+ break
3807
+ cur_time = time.time()
3808
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
3809
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
3810
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
3811
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
3812
+ else:
3813
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
3814
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
3815
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
3816
+
3817
+
3714
3818
  def doModifyApplicationProxyStatus(args, parsed_globals):
3715
3819
  g_param = parse_global_arg(parsed_globals)
3716
3820
 
@@ -4595,6 +4699,58 @@ def doDeleteLoadBalancer(args, parsed_globals):
4595
4699
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4596
4700
 
4597
4701
 
4702
+ def doDisableOriginACL(args, parsed_globals):
4703
+ g_param = parse_global_arg(parsed_globals)
4704
+
4705
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4706
+ cred = credential.CVMRoleCredential()
4707
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4708
+ cred = credential.STSAssumeRoleCredential(
4709
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4710
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4711
+ )
4712
+ 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):
4713
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4714
+ else:
4715
+ cred = credential.Credential(
4716
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4717
+ )
4718
+ http_profile = HttpProfile(
4719
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4720
+ reqMethod="POST",
4721
+ endpoint=g_param[OptionsDefine.Endpoint],
4722
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4723
+ )
4724
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4725
+ if g_param[OptionsDefine.Language]:
4726
+ profile.language = g_param[OptionsDefine.Language]
4727
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4728
+ client = mod.TeoClient(cred, g_param[OptionsDefine.Region], profile)
4729
+ client._sdkVersion += ("_CLI_" + __version__)
4730
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
4731
+ model = models.DisableOriginACLRequest()
4732
+ model.from_json_string(json.dumps(args))
4733
+ start_time = time.time()
4734
+ while True:
4735
+ rsp = client.DisableOriginACL(model)
4736
+ result = rsp.to_json_string()
4737
+ try:
4738
+ json_obj = json.loads(result)
4739
+ except TypeError as e:
4740
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
4741
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4742
+ break
4743
+ cur_time = time.time()
4744
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4745
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4746
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4747
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4748
+ else:
4749
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4750
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4751
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4752
+
4753
+
4598
4754
  def doDeleteContentIdentifier(args, parsed_globals):
4599
4755
  g_param = parse_global_arg(parsed_globals)
4600
4756
 
@@ -5635,6 +5791,58 @@ def doCreateCLSIndex(args, parsed_globals):
5635
5791
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
5636
5792
 
5637
5793
 
5794
+ def doConfirmOriginACLUpdate(args, parsed_globals):
5795
+ g_param = parse_global_arg(parsed_globals)
5796
+
5797
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
5798
+ cred = credential.CVMRoleCredential()
5799
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
5800
+ cred = credential.STSAssumeRoleCredential(
5801
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
5802
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
5803
+ )
5804
+ 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):
5805
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
5806
+ else:
5807
+ cred = credential.Credential(
5808
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
5809
+ )
5810
+ http_profile = HttpProfile(
5811
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
5812
+ reqMethod="POST",
5813
+ endpoint=g_param[OptionsDefine.Endpoint],
5814
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
5815
+ )
5816
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
5817
+ if g_param[OptionsDefine.Language]:
5818
+ profile.language = g_param[OptionsDefine.Language]
5819
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
5820
+ client = mod.TeoClient(cred, g_param[OptionsDefine.Region], profile)
5821
+ client._sdkVersion += ("_CLI_" + __version__)
5822
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
5823
+ model = models.ConfirmOriginACLUpdateRequest()
5824
+ model.from_json_string(json.dumps(args))
5825
+ start_time = time.time()
5826
+ while True:
5827
+ rsp = client.ConfirmOriginACLUpdate(model)
5828
+ result = rsp.to_json_string()
5829
+ try:
5830
+ json_obj = json.loads(result)
5831
+ except TypeError as e:
5832
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
5833
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
5834
+ break
5835
+ cur_time = time.time()
5836
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
5837
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
5838
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
5839
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
5840
+ else:
5841
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
5842
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
5843
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
5844
+
5845
+
5638
5846
  def doCreateApplicationProxy(args, parsed_globals):
5639
5847
  g_param = parse_global_arg(parsed_globals)
5640
5848
 
@@ -5739,6 +5947,58 @@ def doUpgradePlan(args, parsed_globals):
5739
5947
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
5740
5948
 
5741
5949
 
5950
+ def doEnableOriginACL(args, parsed_globals):
5951
+ g_param = parse_global_arg(parsed_globals)
5952
+
5953
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
5954
+ cred = credential.CVMRoleCredential()
5955
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
5956
+ cred = credential.STSAssumeRoleCredential(
5957
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
5958
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
5959
+ )
5960
+ 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):
5961
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
5962
+ else:
5963
+ cred = credential.Credential(
5964
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
5965
+ )
5966
+ http_profile = HttpProfile(
5967
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
5968
+ reqMethod="POST",
5969
+ endpoint=g_param[OptionsDefine.Endpoint],
5970
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
5971
+ )
5972
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
5973
+ if g_param[OptionsDefine.Language]:
5974
+ profile.language = g_param[OptionsDefine.Language]
5975
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
5976
+ client = mod.TeoClient(cred, g_param[OptionsDefine.Region], profile)
5977
+ client._sdkVersion += ("_CLI_" + __version__)
5978
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
5979
+ model = models.EnableOriginACLRequest()
5980
+ model.from_json_string(json.dumps(args))
5981
+ start_time = time.time()
5982
+ while True:
5983
+ rsp = client.EnableOriginACL(model)
5984
+ result = rsp.to_json_string()
5985
+ try:
5986
+ json_obj = json.loads(result)
5987
+ except TypeError as e:
5988
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
5989
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
5990
+ break
5991
+ cur_time = time.time()
5992
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
5993
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
5994
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
5995
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
5996
+ else:
5997
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
5998
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
5999
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
6000
+
6001
+
5742
6002
  def doModifyAliasDomain(args, parsed_globals):
5743
6003
  g_param = parse_global_arg(parsed_globals)
5744
6004
 
@@ -7493,7 +7753,7 @@ ACTION_MAP = {
7493
7753
  "ModifyL4ProxyStatus": doModifyL4ProxyStatus,
7494
7754
  "DownloadL7Logs": doDownloadL7Logs,
7495
7755
  "DescribeEnvironments": doDescribeEnvironments,
7496
- "IncreasePlanQuota": doIncreasePlanQuota,
7756
+ "DescribeOriginACL": doDescribeOriginACL,
7497
7757
  "DeleteApplicationProxyRule": doDeleteApplicationProxyRule,
7498
7758
  "CheckCnameStatus": doCheckCnameStatus,
7499
7759
  "ModifyZone": doModifyZone,
@@ -7504,6 +7764,7 @@ ACTION_MAP = {
7504
7764
  "DescribeConfigGroupVersionDetail": doDescribeConfigGroupVersionDetail,
7505
7765
  "DescribeL7AccRules": doDescribeL7AccRules,
7506
7766
  "BindSecurityTemplateToEntity": doBindSecurityTemplateToEntity,
7767
+ "ModifyOriginACL": doModifyOriginACL,
7507
7768
  "ModifyApplicationProxyRuleStatus": doModifyApplicationProxyRuleStatus,
7508
7769
  "CreatePlanForZone": doCreatePlanForZone,
7509
7770
  "DeleteOriginGroup": doDeleteOriginGroup,
@@ -7539,6 +7800,7 @@ ACTION_MAP = {
7539
7800
  "CreateCustomizeErrorPage": doCreateCustomizeErrorPage,
7540
7801
  "ModifyAccelerationDomain": doModifyAccelerationDomain,
7541
7802
  "CreateL4Proxy": doCreateL4Proxy,
7803
+ "IncreasePlanQuota": doIncreasePlanQuota,
7542
7804
  "ModifyApplicationProxyStatus": doModifyApplicationProxyStatus,
7543
7805
  "CreatePlan": doCreatePlan,
7544
7806
  "DescribeTimingL7AnalysisData": doDescribeTimingL7AnalysisData,
@@ -7556,6 +7818,7 @@ ACTION_MAP = {
7556
7818
  "DescribeCustomErrorPages": doDescribeCustomErrorPages,
7557
7819
  "DescribePlans": doDescribePlans,
7558
7820
  "DeleteLoadBalancer": doDeleteLoadBalancer,
7821
+ "DisableOriginACL": doDisableOriginACL,
7559
7822
  "DeleteContentIdentifier": doDeleteContentIdentifier,
7560
7823
  "DescribeRulesSetting": doDescribeRulesSetting,
7561
7824
  "ModifyAccelerationDomainStatuses": doModifyAccelerationDomainStatuses,
@@ -7576,8 +7839,10 @@ ACTION_MAP = {
7576
7839
  "ModifySecurityIPGroup": doModifySecurityIPGroup,
7577
7840
  "DescribeRules": doDescribeRules,
7578
7841
  "CreateCLSIndex": doCreateCLSIndex,
7842
+ "ConfirmOriginACLUpdate": doConfirmOriginACLUpdate,
7579
7843
  "CreateApplicationProxy": doCreateApplicationProxy,
7580
7844
  "UpgradePlan": doUpgradePlan,
7845
+ "EnableOriginACL": doEnableOriginACL,
7581
7846
  "ModifyAliasDomain": doModifyAliasDomain,
7582
7847
  "CreateLoadBalancer": doCreateLoadBalancer,
7583
7848
  "ModifyApplicationProxyRule": doModifyApplicationProxyRule,