tccli 3.0.1200.1__py2.py3-none-any.whl → 3.0.1201.1__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- tccli/__init__.py +1 -1
- tccli/services/__init__.py +3 -0
- tccli/services/autoscaling/v20180419/api.json +33 -5
- tccli/services/autoscaling/v20180419/examples.json +3 -3
- tccli/services/batch/v20170312/api.json +2 -2
- tccli/services/ca/__init__.py +4 -0
- tccli/services/ca/ca_client.py +301 -0
- tccli/services/ca/v20230228/api.json +264 -0
- tccli/services/ca/v20230228/examples.json +41 -0
- tccli/services/ccc/ccc_client.py +153 -47
- tccli/services/ccc/v20200210/api.json +185 -1
- tccli/services/ccc/v20200210/examples.json +17 -1
- tccli/services/cdn/v20180606/api.json +30 -1
- tccli/services/cdwdoris/v20211228/api.json +5 -1
- tccli/services/cvm/cvm_client.py +53 -0
- tccli/services/cvm/v20170312/api.json +173 -25
- tccli/services/cvm/v20170312/examples.json +9 -1
- tccli/services/cynosdb/v20190107/api.json +56 -56
- tccli/services/dts/v20211206/api.json +12 -12
- tccli/services/emr/v20190103/api.json +9 -0
- tccli/services/ess/v20201111/api.json +6 -6
- tccli/services/essbasic/v20210526/api.json +1 -1
- tccli/services/lcic/v20220817/api.json +1 -1
- tccli/services/lighthouse/v20200324/api.json +2 -2
- tccli/services/mqtt/v20240516/api.json +1 -1
- tccli/services/mrs/v20200910/api.json +71 -1
- tccli/services/ocr/v20181119/api.json +10 -0
- tccli/services/ses/v20201002/api.json +50 -0
- tccli/services/ses/v20201002/examples.json +6 -0
- tccli/services/teo/teo_client.py +724 -141
- tccli/services/teo/v20220901/api.json +993 -106
- tccli/services/teo/v20220901/examples.json +112 -0
- tccli/services/tke/v20180525/api.json +7 -4
- tccli/services/vpc/v20170312/api.json +1273 -17
- tccli/services/vpc/v20170312/examples.json +176 -0
- tccli/services/vpc/vpc_client.py +1315 -149
- {tccli-3.0.1200.1.dist-info → tccli-3.0.1201.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1200.1.dist-info → tccli-3.0.1201.1.dist-info}/RECORD +41 -37
- {tccli-3.0.1200.1.dist-info → tccli-3.0.1201.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1200.1.dist-info → tccli-3.0.1201.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1200.1.dist-info → tccli-3.0.1201.1.dist-info}/license_files/LICENSE +0 -0
tccli/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '3.0.
|
1
|
+
__version__ = '3.0.1201.1'
|
tccli/services/__init__.py
CHANGED
@@ -1721,11 +1721,11 @@
|
|
1721
1721
|
},
|
1722
1722
|
{
|
1723
1723
|
"disabled": false,
|
1724
|
-
"document": "指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-8toqc6s3
|
1724
|
+
"document": "指定有效的[镜像](https://cloud.tencent.com/document/product/213/4940)ID,格式形如`img-8toqc6s3`。镜像Id与镜像族名称,二者必填一个且只能填写一个。镜像类型分为四种:<br/><li>公共镜像</li><li>自定义镜像</li><li>共享镜像</li><li>服务市场镜像</li><br/>可通过以下方式获取可用的镜像ID:<br/><li>`公共镜像`、`自定义镜像`、`共享镜像`的镜像ID可通过登录[控制台](https://console.cloud.tencent.com/cvm/image?rid=1&imageType=PUBLIC_IMAGE)查询;`服务镜像市场`的镜像ID可通过[云市场](https://market.cloud.tencent.com/list)查询。</li><li>通过调用接口 [DescribeImages](https://cloud.tencent.com/document/api/213/15715) ,取返回信息中的`ImageId`字段。</li>",
|
1725
1725
|
"example": "img-8toqc6s3",
|
1726
1726
|
"member": "string",
|
1727
1727
|
"name": "ImageId",
|
1728
|
-
"required":
|
1728
|
+
"required": false,
|
1729
1729
|
"type": "string"
|
1730
1730
|
},
|
1731
1731
|
{
|
@@ -1934,6 +1934,15 @@
|
|
1934
1934
|
"name": "DisasterRecoverGroupIds",
|
1935
1935
|
"required": false,
|
1936
1936
|
"type": "list"
|
1937
|
+
},
|
1938
|
+
{
|
1939
|
+
"disabled": false,
|
1940
|
+
"document": "镜像族名称。镜像Id与镜像族名称,二者必填一个且只能填写一个。",
|
1941
|
+
"example": "test-family",
|
1942
|
+
"member": "string",
|
1943
|
+
"name": "ImageFamily",
|
1944
|
+
"required": false,
|
1945
|
+
"type": "string"
|
1937
1946
|
}
|
1938
1947
|
],
|
1939
1948
|
"type": "object"
|
@@ -3015,7 +3024,7 @@
|
|
3015
3024
|
},
|
3016
3025
|
{
|
3017
3026
|
"disabled": false,
|
3018
|
-
"document": "过滤条件。\n<li> launch-configuration-id - String - 是否必填:否 -(过滤条件)按照启动配置ID过滤。</li>\n<li> launch-configuration-name - String - 是否必填:否 -(过滤条件)按照启动配置名称过滤。</li>\n<li> vague-launch-configuration-name - String - 是否必填:否 -(过滤条件)按照启动配置名称模糊搜索。</li>\n<li> tag-key - String - 是否必填:否 -(过滤条件)按照标签键进行过滤。</li>\n<li> tag-value - String - 是否必填:否 -(过滤条件)按照标签值进行过滤。</li>\n<li> tag:tag-key - String - 是否必填:否 -(过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例3
|
3027
|
+
"document": "过滤条件。\n<li> launch-configuration-id - String - 是否必填:否 -(过滤条件)按照启动配置ID过滤。</li>\n<li> launch-configuration-name - String - 是否必填:否 -(过滤条件)按照启动配置名称过滤。</li>\n<li> vague-launch-configuration-name - String - 是否必填:否 -(过滤条件)按照启动配置名称模糊搜索。</li>\n<li> tag-key - String - 是否必填:否 -(过滤条件)按照标签键进行过滤。</li>\n<li> tag-value - String - 是否必填:否 -(过滤条件)按照标签值进行过滤。</li>\n<li> tag:tag-key - String - 是否必填:否 -(过滤条件)按照标签键值对进行过滤。 tag-key使用具体的标签键进行替换。使用请参考示例3</li>\n每次请求的`Filters`的上限为10,`Filter.Values`的上限为5。参数不支持同时指定`LaunchConfigurationIds`和`Filters`。",
|
3019
3028
|
"example": "无",
|
3020
3029
|
"member": "Filter",
|
3021
3030
|
"name": "Filters",
|
@@ -3052,7 +3061,7 @@
|
|
3052
3061
|
"example": "1",
|
3053
3062
|
"member": "uint64",
|
3054
3063
|
"name": "TotalCount",
|
3055
|
-
"
|
3064
|
+
"output_required": true,
|
3056
3065
|
"type": "int",
|
3057
3066
|
"value_allowed_null": false
|
3058
3067
|
},
|
@@ -3062,7 +3071,7 @@
|
|
3062
3071
|
"example": "无",
|
3063
3072
|
"member": "LaunchConfiguration",
|
3064
3073
|
"name": "LaunchConfigurationSet",
|
3065
|
-
"
|
3074
|
+
"output_required": true,
|
3066
3075
|
"type": "list",
|
3067
3076
|
"value_allowed_null": false
|
3068
3077
|
},
|
@@ -4741,6 +4750,16 @@
|
|
4741
4750
|
"output_required": true,
|
4742
4751
|
"type": "list",
|
4743
4752
|
"value_allowed_null": false
|
4753
|
+
},
|
4754
|
+
{
|
4755
|
+
"disabled": false,
|
4756
|
+
"document": "镜像族名称。\n注意:此字段可能返回 null,表示取不到有效值。",
|
4757
|
+
"example": "testfamily",
|
4758
|
+
"member": "string",
|
4759
|
+
"name": "ImageFamily",
|
4760
|
+
"output_required": true,
|
4761
|
+
"type": "string",
|
4762
|
+
"value_allowed_null": true
|
4744
4763
|
}
|
4745
4764
|
],
|
4746
4765
|
"usage": "out"
|
@@ -5586,6 +5605,15 @@
|
|
5586
5605
|
"name": "InstanceTags",
|
5587
5606
|
"required": false,
|
5588
5607
|
"type": "list"
|
5608
|
+
},
|
5609
|
+
{
|
5610
|
+
"disabled": false,
|
5611
|
+
"document": "镜像族名称。",
|
5612
|
+
"example": "test-family",
|
5613
|
+
"member": "string",
|
5614
|
+
"name": "ImageFamily",
|
5615
|
+
"required": false,
|
5616
|
+
"type": "string"
|
5589
5617
|
}
|
5590
5618
|
],
|
5591
5619
|
"type": "object"
|
@@ -286,19 +286,19 @@
|
|
286
286
|
{
|
287
287
|
"document": "",
|
288
288
|
"input": "POST / HTTP/1.1\nHost: as.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeLaunchConfigurations\n<公共请求参数>\n\n{\n \"Filters\": [\n {\n \"Values\": [\n \"asc-fa28v4in\"\n ],\n \"Name\": \"launch-configuration-id\"\n }\n ]\n}",
|
289
|
-
"output": "{\n \"Response\": {\n \"TotalCount\": 1,\n \"LaunchConfigurationSet\": [\n {\n \"ProjectId\": 0,\n \"LaunchConfigurationId\": \"asc-fa28v4in\",\n \"VersionNumber\": 2,\n \"LaunchConfigurationName\": \"lc1\",\n \"LaunchConfigurationStatus\": \"NORMAL\",\n \"AutoScalingGroupAbstractSet\": [],\n \"InstanceType\": \"S3.MEDIUM4\",\n \"InstanceTypes\": [\n \"S3.MEDIUM4\"\n ],\n \"LastOperationInstanceTypesCheckPolicy\": \"ANY\",\n \"ImageId\": \"img-eb30mz89\",\n \"InstanceChargeType\": \"POSTPAID_BY_HOUR\",\n \"InstanceMarketOptions\": null,\n \"DiskTypePolicy\": \"ORIGINAL\",\n \"SystemDisk\": {\n \"DiskType\": \"CLOUD_PREMIUM\",\n \"DiskSize\": 50\n },\n \"DataDisks\": [\n {\n \"DiskType\": \"CLOUD_PREMIUM\",\n \"DiskSize\": 10,\n \"SnapshotId\": null,\n \"DeleteWithInstance\": false,\n \"Encrypt\": false,\n \"ThroughputPerformance\": null\n }\n ],\n \"LoginSettings\": {\n \"KeyIds\": []\n },\n \"InternetAccessible\": {\n \"InternetChargeType\": \"TRAFFIC_POSTPAID_BY_HOUR\",\n \"InternetMaxBandwidthOut\": 0,\n \"PublicIpAssigned\": false,\n \"BandwidthPackageId\": null\n },\n \"SecurityGroupIds\": [],\n \"EnhancedService\": {\n \"SecurityService\": {\n \"Enabled\": true\n },\n \"MonitorService\": {\n \"Enabled\": true\n }\n },\n \"UserData\": null,\n \"InstanceTags\": [],\n \"CreatedTime\": \"2022-03-03T02:36:12Z\",\n \"UpdatedTime\": \"2022-03-03T06:49:31Z\",\n \"CamRoleName\": \"\",\n \"HostNameSettings\": {\n \"HostName\": null,\n \"HostNameStyle\": null\n },\n \"InstanceNameSettings\": {\n \"InstanceName\": \"\",\n \"InstanceNameStyle\": \"\"\n },\n \"InstanceChargePrepaid\": {\n \"Period\": 0,\n \"RenewFlag\": \"\"\n },\n \"HpcClusterId\": \"\"\n }\n ],\n \"RequestId\": \"923dd24c-e492-4bdb-90be-1d3bd4bfe8a5\"\n }\n}",
|
289
|
+
"output": "{\n \"Response\": {\n \"TotalCount\": 1,\n \"LaunchConfigurationSet\": [\n {\n \"ProjectId\": 0,\n \"LaunchConfigurationId\": \"asc-fa28v4in\",\n \"VersionNumber\": 2,\n \"LaunchConfigurationName\": \"lc1\",\n \"LaunchConfigurationStatus\": \"NORMAL\",\n \"AutoScalingGroupAbstractSet\": [],\n \"InstanceType\": \"S3.MEDIUM4\",\n \"InstanceTypes\": [\n \"S3.MEDIUM4\"\n ],\n \"LastOperationInstanceTypesCheckPolicy\": \"ANY\",\n \"ImageId\": \"img-eb30mz89\",\n \"ImageFamily\": \"\",\n \"Tags\": [],\n \"IPv6InternetAccessible\": {\n \"InternetChargeType\": \"TRAFFIC_POSTPAID_BY_HOUR\",\n \"InternetMaxBandwidthOut\": 0,\n \"BandwidthPackageId\": null\n },\n \"DisasterRecoverGroupIds\": [],\n \"InstanceChargeType\": \"POSTPAID_BY_HOUR\",\n \"InstanceMarketOptions\": null,\n \"DiskTypePolicy\": \"ORIGINAL\",\n \"SystemDisk\": {\n \"DiskType\": \"CLOUD_PREMIUM\",\n \"DiskSize\": 50\n },\n \"DataDisks\": [\n {\n \"DiskType\": \"CLOUD_PREMIUM\",\n \"DiskSize\": 10,\n \"SnapshotId\": null,\n \"DeleteWithInstance\": false,\n \"Encrypt\": false,\n \"BurstPerformance\": null,\n \"ThroughputPerformance\": null\n }\n ],\n \"LoginSettings\": {\n \"KeyIds\": []\n },\n \"InternetAccessible\": {\n \"InternetChargeType\": \"TRAFFIC_POSTPAID_BY_HOUR\",\n \"InternetMaxBandwidthOut\": 0,\n \"PublicIpAssigned\": false,\n \"BandwidthPackageId\": null\n },\n \"SecurityGroupIds\": [],\n \"EnhancedService\": {\n \"SecurityService\": {\n \"Enabled\": true\n },\n \"AutomationToolsService\": {\n \"Enabled\": true\n },\n \"MonitorService\": {\n \"Enabled\": true\n }\n },\n \"UserData\": null,\n \"InstanceTags\": [],\n \"CreatedTime\": \"2022-03-03T02:36:12Z\",\n \"UpdatedTime\": \"2022-03-03T06:49:31Z\",\n \"CamRoleName\": \"\",\n \"HostNameSettings\": {\n \"HostName\": null,\n \"HostNameSuffix\": null,\n \"HostNameStyle\": null\n },\n \"InstanceNameSettings\": {\n \"InstanceName\": \"\",\n \"InstanceNameSuffix\": null,\n \"InstanceNameStyle\": \"\"\n },\n \"InstanceChargePrepaid\": {\n \"Period\": 0,\n \"RenewFlag\": \"\"\n },\n \"HpcClusterId\": \"\"\n }\n ],\n \"RequestId\": \"923dd24c-e492-4bdb-90be-1d3bd4bfe8a5\"\n }\n}",
|
290
290
|
"title": "使用Filters查看启动配置列表"
|
291
291
|
},
|
292
292
|
{
|
293
293
|
"document": "",
|
294
294
|
"input": "POST / HTTP/1.1\nHost: as.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeLaunchConfigurations\n<公共请求参数>\n\n{\n \"LaunchConfigurationIds\": [\n \"asc-g9uwgyvx\",\n \"asc-fa28v4in\"\n ]\n}",
|
295
|
-
"output": "{\n \"Response\": {\n \"TotalCount\": 2,\n \"LaunchConfigurationSet\": [\n {\n \"ProjectId\": 0,\n \"LaunchConfigurationId\": \"asc-fa28v4in\",\n \"VersionNumber\": 2,\n \"LaunchConfigurationName\": \"lc1\",\n \"LaunchConfigurationStatus\": \"NORMAL\",\n \"AutoScalingGroupAbstractSet\": [],\n \"InstanceType\": \"S3.MEDIUM4\",\n \"InstanceTypes\": [\n \"S3.MEDIUM4\"\n ],\n \"LastOperationInstanceTypesCheckPolicy\": \"ANY\",\n \"ImageId\": \"img-eb30mz89\",\n \"InstanceChargeType\": \"POSTPAID_BY_HOUR\",\n \"InstanceMarketOptions\": null,\n \"DiskTypePolicy\": \"ORIGINAL\",\n \"SystemDisk\": {\n \"DiskType\": \"CLOUD_PREMIUM\",\n \"DiskSize\": 50\n },\n \"DataDisks\": [\n {\n \"DiskType\": \"CLOUD_PREMIUM\",\n \"DiskSize\": 10,\n \"SnapshotId\": null,\n \"DeleteWithInstance\": false,\n \"Encrypt\": false,\n \"ThroughputPerformance\": null\n }\n ],\n \"LoginSettings\": {\n \"KeyIds\": []\n },\n \"InternetAccessible\": {\n \"InternetChargeType\": \"TRAFFIC_POSTPAID_BY_HOUR\",\n \"InternetMaxBandwidthOut\": 0,\n \"PublicIpAssigned\": false,\n \"BandwidthPackageId\": null\n },\n \"SecurityGroupIds\": [],\n \"EnhancedService\": {\n \"SecurityService\": {\n \"Enabled\": true\n },\n \"MonitorService\": {\n \"Enabled\": true\n }\n },\n \"UserData\": null,\n \"InstanceTags\": [],\n \"CreatedTime\": \"2022-03-03T02:36:12Z\",\n \"UpdatedTime\": \"2022-03-03T06:49:31Z\",\n \"CamRoleName\": \"\",\n \"HostNameSettings\": {\n \"HostName\": null,\n \"HostNameStyle\": null\n },\n \"InstanceNameSettings\": {\n \"InstanceName\": \"\",\n \"InstanceNameStyle\": \"\"\n },\n \"InstanceChargePrepaid\": {\n \"Period\": 0,\n \"RenewFlag\": \"\"\n },\n \"
|
295
|
+
"output": "{\n \"Response\": {\n \"TotalCount\": 2,\n \"LaunchConfigurationSet\": [\n {\n \"ProjectId\": 0,\n \"LaunchConfigurationId\": \"asc-fa28v4in\",\n \"VersionNumber\": 2,\n \"LaunchConfigurationName\": \"lc1\",\n \"LaunchConfigurationStatus\": \"NORMAL\",\n \"AutoScalingGroupAbstractSet\": [],\n \"InstanceType\": \"S3.MEDIUM4\",\n \"InstanceTypes\": [\n \"S3.MEDIUM4\"\n ],\n \"LastOperationInstanceTypesCheckPolicy\": \"ANY\",\n \"ImageId\": \"img-eb30mz89\",\n \"InstanceChargeType\": \"POSTPAID_BY_HOUR\",\n \"InstanceMarketOptions\": null,\n \"DiskTypePolicy\": \"ORIGINAL\",\n \"SystemDisk\": {\n \"DiskType\": \"CLOUD_PREMIUM\",\n \"DiskSize\": 50\n },\n \"DataDisks\": [\n {\n \"DiskType\": \"CLOUD_PREMIUM\",\n \"DiskSize\": 10,\n \"BurstPerformance\": null,\n \"SnapshotId\": null,\n \"DeleteWithInstance\": false,\n \"Encrypt\": false,\n \"ThroughputPerformance\": null\n }\n ],\n \"LoginSettings\": {\n \"KeyIds\": []\n },\n \"InternetAccessible\": {\n \"InternetChargeType\": \"TRAFFIC_POSTPAID_BY_HOUR\",\n \"InternetMaxBandwidthOut\": 0,\n \"PublicIpAssigned\": false,\n \"BandwidthPackageId\": null\n },\n \"SecurityGroupIds\": [],\n \"EnhancedService\": {\n \"SecurityService\": {\n \"Enabled\": true\n },\n \"AutomationToolsService\": {\n \"Enabled\": true\n },\n \"MonitorService\": {\n \"Enabled\": true\n }\n },\n \"UserData\": null,\n \"InstanceTags\": [],\n \"ImageFamily\": \"\",\n \"Tags\": [],\n \"IPv6InternetAccessible\": {\n \"InternetChargeType\": \"TRAFFIC_POSTPAID_BY_HOUR\",\n \"InternetMaxBandwidthOut\": 0,\n \"BandwidthPackageId\": null\n },\n \"DisasterRecoverGroupIds\": [],\n \"CreatedTime\": \"2022-03-03T02:36:12Z\",\n \"UpdatedTime\": \"2022-03-03T06:49:31Z\",\n \"CamRoleName\": \"\",\n \"HostNameSettings\": {\n \"HostName\": null,\n \"HostNameSuffix\": null,\n \"HostNameStyle\": null\n },\n \"InstanceNameSettings\": {\n \"InstanceName\": \"\",\n \"InstanceNameSuffix\": null,\n \"InstanceNameStyle\": \"\"\n },\n \"InstanceChargePrepaid\": {\n \"Period\": 0,\n \"RenewFlag\": \"\"\n },\n \"HpcClusterId\": \"\"\n },\n {\n \"ProjectId\": 0,\n \"LaunchConfigurationId\": \"asc-g9uwgyvx\",\n \"VersionNumber\": 1,\n \"LaunchConfigurationName\": \"lc2\",\n \"LaunchConfigurationStatus\": \"NORMAL\",\n \"AutoScalingGroupAbstractSet\": [],\n \"InstanceType\": \"S3.MEDIUM4\",\n \"InstanceTypes\": [\n \"S3.MEDIUM4\"\n ],\n \"LastOperationInstanceTypesCheckPolicy\": \"ANY\",\n \"ImageId\": \"img-eb30mz89\",\n \"InstanceChargeType\": \"POSTPAID_BY_HOUR\",\n \"InstanceMarketOptions\": null,\n \"DiskTypePolicy\": \"ORIGINAL\",\n \"SystemDisk\": {\n \"DiskType\": \"CLOUD_PREMIUM\",\n \"DiskSize\": 50\n },\n \"DataDisks\": [\n {\n \"DiskType\": \"CLOUD_PREMIUM\",\n \"DiskSize\": 40,\n \"SnapshotId\": null,\n \"DeleteWithInstance\": null,\n \"Encrypt\": null,\n \"BurstPerformance\": null,\n \"ThroughputPerformance\": null\n }\n ],\n \"LoginSettings\": {\n \"KeyIds\": []\n },\n \"InternetAccessible\": {\n \"InternetChargeType\": \"TRAFFIC_POSTPAID_BY_HOUR\",\n \"InternetMaxBandwidthOut\": 0,\n \"PublicIpAssigned\": false,\n \"BandwidthPackageId\": null\n },\n \"SecurityGroupIds\": [],\n \"EnhancedService\": {\n \"SecurityService\": {\n \"Enabled\": true\n },\n \"AutomationToolsService\": {\n \"Enabled\": true\n },\n \"MonitorService\": {\n \"Enabled\": true\n }\n },\n \"UserData\": null,\n \"InstanceTags\": [],\n \"ImageFamily\": \"\",\n \"Tags\": [],\n \"IPv6InternetAccessible\": {\n \"InternetChargeType\": \"TRAFFIC_POSTPAID_BY_HOUR\",\n \"InternetMaxBandwidthOut\": 0,\n \"BandwidthPackageId\": null\n },\n \"DisasterRecoverGroupIds\": [],\n \"CreatedTime\": \"2022-03-02T02:25:12Z\",\n \"UpdatedTime\": \"2022-03-02T02:25:12Z\",\n \"CamRoleName\": \"\",\n \"HostNameSettings\": {\n \"HostName\": null,\n \"HostNameSuffix\": null,\n \"HostNameStyle\": null\n },\n \"InstanceNameSettings\": {\n \"InstanceName\": \"\",\n \"InstanceNameSuffix\": null,\n \"InstanceNameStyle\": \"\"\n },\n \"InstanceChargePrepaid\": {\n \"Period\": 0,\n \"RenewFlag\": \"\"\n },\n \"HpcClusterId\": \"\"\n }\n ],\n \"RequestId\": \"0d4514d4-e277-4f0f-bc85-8b7377a71980\"\n }\n}",
|
296
296
|
"title": "根据启动配置ID查询启动配置列表"
|
297
297
|
},
|
298
298
|
{
|
299
299
|
"document": "",
|
300
300
|
"input": "POST / HTTP/1.1\nHost: as.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeLaunchConfigurations\n<公共请求参数>\n\n{\n \"Filters\": [\n {\n \"Values\": [\n \"v2\"\n ],\n \"Name\": \"tag:k1\"\n }\n ]\n}",
|
301
|
-
"output": "{\n \"Response\": {\n \"TotalCount\": 1,\n \"LaunchConfigurationSet\": [\n {\n \"ProjectId\": 0,\n \"LaunchConfigurationId\": \"asc-0zri3ck1\",\n \"VersionNumber\": 1,\n \"LaunchConfigurationName\": \"test_tag_k1_v2\",\n \"LaunchConfigurationStatus\": \"NORMAL\",\n \"AutoScalingGroupAbstractSet\": [],\n \"InstanceType\": \"S5.MEDIUM4\",\n \"InstanceTypes\": [\n \"S5.MEDIUM4\"\n ],\n \"LastOperationInstanceTypesCheckPolicy\": \"ANY\",\n \"ImageId\": \"img-eb30mz89\",\n \"InstanceChargeType\": \"POSTPAID_BY_HOUR\",\n \"InstanceMarketOptions\": null,\n \"DiskTypePolicy\": \"ORIGINAL\",\n \"SystemDisk\": {\n \"DiskType\": \"CLOUD_PREMIUM\",\n \"DiskSize\": 50\n },\n \"DataDisks\": [\n {\n \"DiskType\": \"CLOUD_PREMIUM\",\n \"DiskSize\": 40,\n \"SnapshotId\": null,\n \"DeleteWithInstance\": null,\n \"Encrypt\": null,\n \"ThroughputPerformance\": null\n }\n ],\n \"LoginSettings\": {\n \"KeyIds\": []\n },\n \"InternetAccessible\": {\n \"InternetChargeType\": \"TRAFFIC_POSTPAID_BY_HOUR\",\n \"InternetMaxBandwidthOut\": 0,\n \"PublicIpAssigned\": false,\n \"BandwidthPackageId\": null\n },\n \"SecurityGroupIds\": [],\n \"EnhancedService\": {\n \"SecurityService\": {\n \"Enabled\": true\n },\n \"MonitorService\": {\n \"Enabled\": true\n }\n },\n \"UserData\": null,\n \"Tags\": [
|
301
|
+
"output": "{\n \"Response\": {\n \"TotalCount\": 1,\n \"LaunchConfigurationSet\": [\n {\n \"ProjectId\": 0,\n \"LaunchConfigurationId\": \"asc-0zri3ck1\",\n \"VersionNumber\": 1,\n \"LaunchConfigurationName\": \"test_tag_k1_v2\",\n \"LaunchConfigurationStatus\": \"NORMAL\",\n \"AutoScalingGroupAbstractSet\": [],\n \"InstanceType\": \"S5.MEDIUM4\",\n \"InstanceTypes\": [\n \"S5.MEDIUM4\"\n ],\n \"LastOperationInstanceTypesCheckPolicy\": \"ANY\",\n \"ImageId\": \"img-eb30mz89\",\n \"InstanceChargeType\": \"POSTPAID_BY_HOUR\",\n \"InstanceMarketOptions\": null,\n \"DiskTypePolicy\": \"ORIGINAL\",\n \"SystemDisk\": {\n \"DiskType\": \"CLOUD_PREMIUM\",\n \"DiskSize\": 50\n },\n \"DataDisks\": [\n {\n \"DiskType\": \"CLOUD_PREMIUM\",\n \"DiskSize\": 40,\n \"BurstPerformance\": null,\n \"SnapshotId\": null,\n \"DeleteWithInstance\": null,\n \"Encrypt\": null,\n \"ThroughputPerformance\": null\n }\n ],\n \"LoginSettings\": {\n \"KeyIds\": []\n },\n \"InternetAccessible\": {\n \"InternetChargeType\": \"TRAFFIC_POSTPAID_BY_HOUR\",\n \"InternetMaxBandwidthOut\": 0,\n \"PublicIpAssigned\": false,\n \"BandwidthPackageId\": null\n },\n \"SecurityGroupIds\": [],\n \"EnhancedService\": {\n \"SecurityService\": {\n \"Enabled\": true\n },\n \"AutomationToolsService\": {\n \"Enabled\": true\n },\n \"MonitorService\": {\n \"Enabled\": true\n }\n },\n \"UserData\": null,\n \"Tags\": [],\n \"InstanceTags\": [],\n \"ImageFamily\": \"\",\n \"IPv6InternetAccessible\": {\n \"InternetChargeType\": \"TRAFFIC_POSTPAID_BY_HOUR\",\n \"InternetMaxBandwidthOut\": 0,\n \"BandwidthPackageId\": null\n },\n \"DisasterRecoverGroupIds\": [],\n \"CreatedTime\": \"2022-07-14T06:37:08Z\",\n \"UpdatedTime\": \"2022-07-14T06:37:08Z\",\n \"CamRoleName\": \"\",\n \"HostNameSettings\": {\n \"HostName\": null,\n \"HostNameSuffix\": null,\n \"HostNameStyle\": null\n },\n \"InstanceNameSettings\": {\n \"InstanceName\": \"\",\n \"InstanceNameSuffix\": null,\n \"InstanceNameStyle\": \"\"\n },\n \"InstanceChargePrepaid\": {\n \"Period\": 0,\n \"RenewFlag\": \"\"\n },\n \"HpcClusterId\": \"\"\n }\n ],\n \"RequestId\": \"8b8047bb-1372-4208-866e-a18e7b7547e9\"\n }\n}",
|
302
302
|
"title": "使用Filters通过Tag:Key方式查看启动配置列表。"
|
303
303
|
}
|
304
304
|
],
|
@@ -5000,7 +5000,7 @@
|
|
5000
5000
|
{
|
5001
5001
|
"disabled": false,
|
5002
5002
|
"document": "实例所属的专用宿主机ID列表,仅用于入参。如果您有购买专用宿主机并且指定了该参数,则您购买的实例就会随机的部署在这些专用宿主机上。",
|
5003
|
-
"example": "
|
5003
|
+
"example": "host-o5i742go",
|
5004
5004
|
"member": "string",
|
5005
5005
|
"name": "HostIds",
|
5006
5006
|
"output_required": true,
|
@@ -5011,7 +5011,7 @@
|
|
5011
5011
|
{
|
5012
5012
|
"disabled": false,
|
5013
5013
|
"document": "实例所属的专用宿主机ID,仅用于出参。",
|
5014
|
-
"example": "
|
5014
|
+
"example": "[\"host-o5i742go\"]",
|
5015
5015
|
"member": "string",
|
5016
5016
|
"name": "HostId",
|
5017
5017
|
"output_required": true,
|
@@ -0,0 +1,301 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
import os
|
3
|
+
import sys
|
4
|
+
import six
|
5
|
+
import json
|
6
|
+
import tccli.options_define as OptionsDefine
|
7
|
+
import tccli.format_output as FormatOutput
|
8
|
+
from tccli import __version__
|
9
|
+
from tccli.utils import Utils
|
10
|
+
from tccli.exceptions import ConfigurationError, ClientError, ParamError
|
11
|
+
from tencentcloud.common import credential
|
12
|
+
from tencentcloud.common.profile.http_profile import HttpProfile
|
13
|
+
from tencentcloud.common.profile.client_profile import ClientProfile
|
14
|
+
from tencentcloud.ca.v20230228 import ca_client as ca_client_v20230228
|
15
|
+
from tencentcloud.ca.v20230228 import models as models_v20230228
|
16
|
+
|
17
|
+
from jmespath import search
|
18
|
+
import time
|
19
|
+
|
20
|
+
def doDescribeVerifyReport(args, parsed_globals):
|
21
|
+
g_param = parse_global_arg(parsed_globals)
|
22
|
+
|
23
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
24
|
+
cred = credential.CVMRoleCredential()
|
25
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
26
|
+
cred = credential.STSAssumeRoleCredential(
|
27
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
28
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
29
|
+
)
|
30
|
+
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):
|
31
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
32
|
+
else:
|
33
|
+
cred = credential.Credential(
|
34
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
35
|
+
)
|
36
|
+
http_profile = HttpProfile(
|
37
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
38
|
+
reqMethod="POST",
|
39
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
40
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
41
|
+
)
|
42
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
43
|
+
if g_param[OptionsDefine.Language]:
|
44
|
+
profile.language = g_param[OptionsDefine.Language]
|
45
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
46
|
+
client = mod.CaClient(cred, g_param[OptionsDefine.Region], profile)
|
47
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
48
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
49
|
+
model = models.DescribeVerifyReportRequest()
|
50
|
+
model.from_json_string(json.dumps(args))
|
51
|
+
start_time = time.time()
|
52
|
+
while True:
|
53
|
+
rsp = client.DescribeVerifyReport(model)
|
54
|
+
result = rsp.to_json_string()
|
55
|
+
try:
|
56
|
+
json_obj = json.loads(result)
|
57
|
+
except TypeError as e:
|
58
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
59
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
60
|
+
break
|
61
|
+
cur_time = time.time()
|
62
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
63
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
64
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
65
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
66
|
+
else:
|
67
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
68
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
69
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
70
|
+
|
71
|
+
|
72
|
+
def doCreateVerifyReport(args, parsed_globals):
|
73
|
+
g_param = parse_global_arg(parsed_globals)
|
74
|
+
|
75
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
76
|
+
cred = credential.CVMRoleCredential()
|
77
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
78
|
+
cred = credential.STSAssumeRoleCredential(
|
79
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
80
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
81
|
+
)
|
82
|
+
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):
|
83
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
84
|
+
else:
|
85
|
+
cred = credential.Credential(
|
86
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
87
|
+
)
|
88
|
+
http_profile = HttpProfile(
|
89
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
90
|
+
reqMethod="POST",
|
91
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
92
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
93
|
+
)
|
94
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
95
|
+
if g_param[OptionsDefine.Language]:
|
96
|
+
profile.language = g_param[OptionsDefine.Language]
|
97
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
98
|
+
client = mod.CaClient(cred, g_param[OptionsDefine.Region], profile)
|
99
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
100
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
101
|
+
model = models.CreateVerifyReportRequest()
|
102
|
+
model.from_json_string(json.dumps(args))
|
103
|
+
start_time = time.time()
|
104
|
+
while True:
|
105
|
+
rsp = client.CreateVerifyReport(model)
|
106
|
+
result = rsp.to_json_string()
|
107
|
+
try:
|
108
|
+
json_obj = json.loads(result)
|
109
|
+
except TypeError as e:
|
110
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
111
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
112
|
+
break
|
113
|
+
cur_time = time.time()
|
114
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
115
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
116
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
117
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
118
|
+
else:
|
119
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
120
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
121
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
122
|
+
|
123
|
+
|
124
|
+
def doUploadFile(args, parsed_globals):
|
125
|
+
g_param = parse_global_arg(parsed_globals)
|
126
|
+
|
127
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
128
|
+
cred = credential.CVMRoleCredential()
|
129
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
130
|
+
cred = credential.STSAssumeRoleCredential(
|
131
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
132
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
133
|
+
)
|
134
|
+
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):
|
135
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
136
|
+
else:
|
137
|
+
cred = credential.Credential(
|
138
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
139
|
+
)
|
140
|
+
http_profile = HttpProfile(
|
141
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
142
|
+
reqMethod="POST",
|
143
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
144
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
145
|
+
)
|
146
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
147
|
+
if g_param[OptionsDefine.Language]:
|
148
|
+
profile.language = g_param[OptionsDefine.Language]
|
149
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
150
|
+
client = mod.CaClient(cred, g_param[OptionsDefine.Region], profile)
|
151
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
152
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
153
|
+
model = models.UploadFileRequest()
|
154
|
+
model.from_json_string(json.dumps(args))
|
155
|
+
start_time = time.time()
|
156
|
+
while True:
|
157
|
+
rsp = client.UploadFile(model)
|
158
|
+
result = rsp.to_json_string()
|
159
|
+
try:
|
160
|
+
json_obj = json.loads(result)
|
161
|
+
except TypeError as e:
|
162
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
163
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
164
|
+
break
|
165
|
+
cur_time = time.time()
|
166
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
167
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
168
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
169
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
170
|
+
else:
|
171
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
172
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
173
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
174
|
+
|
175
|
+
|
176
|
+
CLIENT_MAP = {
|
177
|
+
"v20230228": ca_client_v20230228,
|
178
|
+
|
179
|
+
}
|
180
|
+
|
181
|
+
MODELS_MAP = {
|
182
|
+
"v20230228": models_v20230228,
|
183
|
+
|
184
|
+
}
|
185
|
+
|
186
|
+
ACTION_MAP = {
|
187
|
+
"DescribeVerifyReport": doDescribeVerifyReport,
|
188
|
+
"CreateVerifyReport": doCreateVerifyReport,
|
189
|
+
"UploadFile": doUploadFile,
|
190
|
+
|
191
|
+
}
|
192
|
+
|
193
|
+
AVAILABLE_VERSION_LIST = [
|
194
|
+
"v20230228",
|
195
|
+
|
196
|
+
]
|
197
|
+
|
198
|
+
|
199
|
+
def action_caller():
|
200
|
+
return ACTION_MAP
|
201
|
+
|
202
|
+
|
203
|
+
def parse_global_arg(parsed_globals):
|
204
|
+
g_param = parsed_globals
|
205
|
+
|
206
|
+
is_exist_profile = True
|
207
|
+
if not parsed_globals["profile"]:
|
208
|
+
is_exist_profile = False
|
209
|
+
g_param["profile"] = os.environ.get("TCCLI_PROFILE", "default")
|
210
|
+
|
211
|
+
configure_path = os.path.join(os.path.expanduser("~"), ".tccli")
|
212
|
+
is_conf_exist, conf_path = Utils.file_existed(configure_path, g_param["profile"] + ".configure")
|
213
|
+
is_cred_exist, cred_path = Utils.file_existed(configure_path, g_param["profile"] + ".credential")
|
214
|
+
|
215
|
+
conf = {}
|
216
|
+
cred = {}
|
217
|
+
|
218
|
+
if is_conf_exist:
|
219
|
+
conf = Utils.load_json_msg(conf_path)
|
220
|
+
if is_cred_exist:
|
221
|
+
cred = Utils.load_json_msg(cred_path)
|
222
|
+
|
223
|
+
if not (isinstance(conf, dict) and isinstance(cred, dict)):
|
224
|
+
raise ConfigurationError(
|
225
|
+
"file: %s or %s is not json format"
|
226
|
+
% (g_param["profile"] + ".configure", g_param["profile"] + ".credential"))
|
227
|
+
|
228
|
+
if OptionsDefine.Token not in cred:
|
229
|
+
cred[OptionsDefine.Token] = None
|
230
|
+
|
231
|
+
if not is_exist_profile:
|
232
|
+
if os.environ.get(OptionsDefine.ENV_SECRET_ID) and os.environ.get(OptionsDefine.ENV_SECRET_KEY):
|
233
|
+
cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
|
234
|
+
cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
|
235
|
+
cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
|
236
|
+
|
237
|
+
if os.environ.get(OptionsDefine.ENV_REGION):
|
238
|
+
conf[OptionsDefine.SysParam][OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
|
239
|
+
|
240
|
+
if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
|
241
|
+
cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
|
242
|
+
cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
|
243
|
+
|
244
|
+
for param in g_param.keys():
|
245
|
+
if g_param[param] is None:
|
246
|
+
if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.Token]:
|
247
|
+
if param in cred:
|
248
|
+
g_param[param] = cred[param]
|
249
|
+
elif not (g_param[OptionsDefine.UseCVMRole.replace('-', '_')]
|
250
|
+
or os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN)):
|
251
|
+
raise ConfigurationError("%s is invalid" % param)
|
252
|
+
elif param in [OptionsDefine.Region, OptionsDefine.Output, OptionsDefine.Language]:
|
253
|
+
if param in conf[OptionsDefine.SysParam]:
|
254
|
+
g_param[param] = conf[OptionsDefine.SysParam][param]
|
255
|
+
elif param != OptionsDefine.Language:
|
256
|
+
raise ConfigurationError("%s is invalid" % param)
|
257
|
+
elif param.replace('_', '-') in [OptionsDefine.RoleArn, OptionsDefine.RoleSessionName]:
|
258
|
+
if param.replace('_', '-') in cred:
|
259
|
+
g_param[param] = cred[param.replace('_', '-')]
|
260
|
+
|
261
|
+
try:
|
262
|
+
if g_param[OptionsDefine.ServiceVersion]:
|
263
|
+
g_param[OptionsDefine.Version] = "v" + g_param[OptionsDefine.ServiceVersion].replace('-', '')
|
264
|
+
else:
|
265
|
+
version = conf["ca"][OptionsDefine.Version]
|
266
|
+
g_param[OptionsDefine.Version] = "v" + version.replace('-', '')
|
267
|
+
|
268
|
+
if g_param[OptionsDefine.Endpoint] is None:
|
269
|
+
g_param[OptionsDefine.Endpoint] = conf["ca"][OptionsDefine.Endpoint]
|
270
|
+
g_param["sts_cred_endpoint"] = conf.get("sts", {}).get("endpoint")
|
271
|
+
except Exception as err:
|
272
|
+
raise ConfigurationError("config file:%s error, %s" % (conf_path, str(err)))
|
273
|
+
|
274
|
+
if g_param[OptionsDefine.Version] not in AVAILABLE_VERSION_LIST:
|
275
|
+
raise Exception("available versions: %s" % " ".join(AVAILABLE_VERSION_LIST))
|
276
|
+
|
277
|
+
if g_param[OptionsDefine.Waiter]:
|
278
|
+
param = eval(g_param[OptionsDefine.Waiter])
|
279
|
+
if 'expr' not in param:
|
280
|
+
raise Exception('`expr` in `--waiter` must be defined')
|
281
|
+
if 'to' not in param:
|
282
|
+
raise Exception('`to` in `--waiter` must be defined')
|
283
|
+
if 'timeout' not in param:
|
284
|
+
if 'waiter' in conf and 'timeout' in conf['waiter']:
|
285
|
+
param['timeout'] = conf['waiter']['timeout']
|
286
|
+
else:
|
287
|
+
param['timeout'] = 180
|
288
|
+
if 'interval' not in param:
|
289
|
+
if 'waiter' in conf and 'interval' in conf['waiter']:
|
290
|
+
param['interval'] = conf['waiter']['interval']
|
291
|
+
else:
|
292
|
+
param['interval'] = 5
|
293
|
+
param['interval'] = min(param['interval'], param['timeout'])
|
294
|
+
g_param['OptionsDefine.WaiterInfo'] = param
|
295
|
+
|
296
|
+
if six.PY2:
|
297
|
+
for key, value in g_param.items():
|
298
|
+
if isinstance(value, six.text_type):
|
299
|
+
g_param[key] = value.encode('utf-8')
|
300
|
+
return g_param
|
301
|
+
|