tccli 3.0.908.1__py2.py3-none-any.whl → 3.0.910.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 (118) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/examples/cdn/v20180606/DescribeHttpsPackages.md +19 -18
  3. tccli/examples/cdn/v20180606/DescribeTrafficPackages.md +16 -14
  4. tccli/examples/cfs/v20190719/DescribeCfsFileSystems.md +31 -31
  5. tccli/examples/cfs/v20190719/UpdateCfsPGroup.md +1 -1
  6. tccli/examples/cms/v20190321/CreateKeywordsSamples.md +10 -0
  7. tccli/examples/cms/v20190321/DeleteLibSamples.md +2 -1
  8. tccli/examples/cms/v20190321/DescribeLibSamples.md +2 -1
  9. tccli/examples/cvm/v20170312/DescribeImportImageOs.md +1 -1
  10. tccli/examples/cynosdb/v20190107/AddInstances.md +8 -8
  11. tccli/examples/cynosdb/v20190107/DescribeParamTemplates.md +2 -2
  12. tccli/examples/ecm/v20190719/AllocateIpv6AddressesBandwidth.md +25 -0
  13. tccli/examples/ecm/v20190719/AssignIpv6CidrBlock.md +23 -0
  14. tccli/examples/ecm/v20190719/AssignIpv6CidrBlocks.md +29 -0
  15. tccli/examples/ecm/v20190719/AssignIpv6SubnetCidrBlock.md +29 -0
  16. tccli/examples/ecm/v20190719/DescribeRegionIpv6Addresses.md +41 -0
  17. tccli/examples/ecm/v20190719/ModifyIpv6AddressesBandwidth.md +22 -0
  18. tccli/examples/ecm/v20190719/QueryVpcTaskResult.md +22 -0
  19. tccli/examples/ecm/v20190719/ReleaseIpv6AddressesBandwidth.md +22 -0
  20. tccli/examples/ecm/v20190719/UnassignIpv6SubnetCidrBlock.md +23 -0
  21. tccli/examples/emr/v20190103/InquiryPriceRenewInstance.md +32 -1
  22. tccli/examples/es/v20180416/ModifyEsVipSecurityGroup.md +21 -0
  23. tccli/examples/ess/v20201111/CreateFlowGroupByFiles.md +118 -0
  24. tccli/examples/ess/v20201111/CreateFlowGroupByTemplates.md +61 -0
  25. tccli/examples/ess/v20201111/CreateFlowReminds.md +3 -3
  26. tccli/examples/ess/v20201111/CreateFlowSignReview.md +2 -2
  27. tccli/examples/essbasic/v20210526/ChannelCreateFlowGroupByTemplates.md +49 -0
  28. tccli/examples/lcic/v20220817/DescribeDocument.md +52 -16
  29. tccli/examples/live/v20180801/DeleteLiveTranscodeTemplate.md +1 -1
  30. tccli/examples/monitor/v20180724/DeletePrometheusScrapeJobs.md +4 -4
  31. tccli/examples/monitor/v20180724/DescribeExporterIntegrations.md +5 -5
  32. tccli/examples/monitor/v20180724/DescribePrometheusAgents.md +10 -10
  33. tccli/examples/monitor/v20180724/DescribePrometheusScrapeJobs.md +8 -8
  34. tccli/examples/ocr/v20181119/DriverLicenseOCR.md +2 -2
  35. tccli/examples/smh/v20210712/DeleteLibrary.md +1 -1
  36. tccli/examples/sqlserver/v20180328/InquiryPriceRenewDBInstance.md +1 -1
  37. tccli/examples/sqlserver/v20180328/InquiryPriceUpgradeDBInstance.md +1 -1
  38. tccli/examples/ssl/v20191205/DescribeDeployedResources.md +5 -5
  39. tccli/examples/tchd/v20230306/DescribeEvents.md +35 -0
  40. tccli/examples/tdmq/v20200217/CreateTopic.md +1 -1
  41. tccli/examples/vod/v20180717/CreateRebuildMediaTemplate.md +2 -2
  42. tccli/examples/vod/v20180717/DeleteRebuildMediaTemplate.md +2 -2
  43. tccli/examples/vod/v20180717/DescribeRebuildMediaTemplates.md +2 -2
  44. tccli/examples/vod/v20180717/ModifyRebuildMediaTemplate.md +2 -2
  45. tccli/examples/vod/v20180717/RebuildMedia.md +2 -2
  46. tccli/examples/vod/v20180717/RebuildMediaByTemplate.md +2 -2
  47. tccli/examples/vpc/v20170312/DescribeSecurityGroups.md +1 -1
  48. tccli/examples/wav/v20210129/QueryClueInfoList.md +1 -0
  49. tccli/examples/wedata/v20210820/DescribeColumnLineage.md +77 -0
  50. tccli/examples/wedata/v20210820/DescribeTableLineage.md +79 -0
  51. tccli/services/__init__.py +3 -0
  52. tccli/services/autoscaling/v20180419/api.json +1 -1
  53. tccli/services/cdn/v20180606/api.json +49 -67
  54. tccli/services/cdn/v20180606/examples.json +3 -3
  55. tccli/services/cfs/v20190719/api.json +65 -26
  56. tccli/services/cfs/v20190719/examples.json +3 -3
  57. tccli/services/cls/v20201016/api.json +7 -2
  58. tccli/services/cms/v20190321/api.json +37 -2
  59. tccli/services/cms/v20190321/examples.json +3 -3
  60. tccli/services/cvm/v20170312/api.json +2 -0
  61. tccli/services/cvm/v20170312/examples.json +2 -2
  62. tccli/services/cynosdb/v20190107/api.json +58 -73
  63. tccli/services/cynosdb/v20190107/examples.json +3 -3
  64. tccli/services/ecm/ecm_client.py +493 -16
  65. tccli/services/ecm/v20190719/api.json +657 -26
  66. tccli/services/ecm/v20190719/examples.json +72 -0
  67. tccli/services/emr/v20190103/api.json +5 -12
  68. tccli/services/emr/v20190103/examples.json +7 -1
  69. tccli/services/es/es_client.py +65 -12
  70. tccli/services/es/v20180416/api.json +43 -0
  71. tccli/services/es/v20180416/examples.json +8 -0
  72. tccli/services/ess/ess_client.py +145 -39
  73. tccli/services/ess/v20201111/api.json +417 -41
  74. tccli/services/ess/v20201111/examples.json +19 -3
  75. tccli/services/essbasic/essbasic_client.py +53 -0
  76. tccli/services/essbasic/v20210526/api.json +105 -3
  77. tccli/services/essbasic/v20210526/examples.json +8 -0
  78. tccli/services/lcic/v20220817/api.json +27 -16
  79. tccli/services/lcic/v20220817/examples.json +10 -4
  80. tccli/services/live/v20180801/api.json +3 -3
  81. tccli/services/live/v20180801/examples.json +1 -1
  82. tccli/services/monitor/v20180724/api.json +20 -24
  83. tccli/services/monitor/v20180724/examples.json +11 -11
  84. tccli/services/ocr/v20181119/api.json +22 -5
  85. tccli/services/ocr/v20181119/examples.json +1 -1
  86. tccli/services/smh/v20210712/api.json +1 -1
  87. tccli/services/smh/v20210712/examples.json +2 -2
  88. tccli/services/sqlserver/v20180328/api.json +8 -15
  89. tccli/services/sqlserver/v20180328/examples.json +2 -2
  90. tccli/services/ssl/v20191205/api.json +1 -0
  91. tccli/services/ssl/v20191205/examples.json +2 -2
  92. tccli/services/tcb/v20180608/api.json +33 -39
  93. tccli/services/tchd/__init__.py +4 -0
  94. tccli/services/tchd/tchd_client.py +194 -0
  95. tccli/services/tchd/v20230306/api.json +167 -0
  96. tccli/services/tchd/v20230306/examples.json +13 -0
  97. tccli/services/tdmq/v20200217/api.json +7 -14
  98. tccli/services/tdmq/v20200217/examples.json +1 -1
  99. tccli/services/tke/v20180525/api.json +33 -20
  100. tccli/services/trtc/trtc_client.py +8 -61
  101. tccli/services/trtc/v20190722/api.json +0 -240
  102. tccli/services/trtc/v20190722/examples.json +0 -8
  103. tccli/services/tse/v20201207/api.json +20 -39
  104. tccli/services/tts/v20190823/api.json +1 -1
  105. tccli/services/vod/v20180717/api.json +40 -36
  106. tccli/services/vod/v20180717/examples.json +12 -12
  107. tccli/services/vpc/v20170312/api.json +21 -7
  108. tccli/services/vpc/v20170312/examples.json +1 -1
  109. tccli/services/wav/v20210129/api.json +10 -0
  110. tccli/services/wav/v20210129/examples.json +1 -1
  111. tccli/services/wedata/v20210820/api.json +1146 -211
  112. tccli/services/wedata/v20210820/examples.json +16 -0
  113. tccli/services/wedata/wedata_client.py +106 -0
  114. {tccli-3.0.908.1.dist-info → tccli-3.0.910.1.dist-info}/METADATA +82 -3
  115. {tccli-3.0.908.1.dist-info → tccli-3.0.910.1.dist-info}/RECORD +118 -98
  116. {tccli-3.0.908.1.dist-info → tccli-3.0.910.1.dist-info}/WHEEL +0 -0
  117. {tccli-3.0.908.1.dist-info → tccli-3.0.910.1.dist-info}/entry_points.txt +0 -0
  118. {tccli-3.0.908.1.dist-info → tccli-3.0.910.1.dist-info}/license_files/LICENSE +0 -0
@@ -1929,7 +1929,7 @@
1929
1929
  "example": "test-001",
1930
1930
  "member": "string",
1931
1931
  "name": "VersionName",
1932
- "required": true,
1932
+ "output_required": true,
1933
1933
  "type": "string",
1934
1934
  "value_allowed_null": false
1935
1935
  },
@@ -1939,7 +1939,7 @@
1939
1939
  "example": "normal",
1940
1940
  "member": "string",
1941
1941
  "name": "Status",
1942
- "required": true,
1942
+ "output_required": true,
1943
1943
  "type": "string",
1944
1944
  "value_allowed_null": true
1945
1945
  },
@@ -1949,7 +1949,7 @@
1949
1949
  "example": "1",
1950
1950
  "member": "int64",
1951
1951
  "name": "FlowRatio",
1952
- "required": true,
1952
+ "output_required": true,
1953
1953
  "type": "int",
1954
1954
  "value_allowed_null": false
1955
1955
  },
@@ -1959,7 +1959,7 @@
1959
1959
  "example": "2020-01-01 12:00:00",
1960
1960
  "member": "string",
1961
1961
  "name": "CreatedTime",
1962
- "required": true,
1962
+ "output_required": true,
1963
1963
  "type": "string",
1964
1964
  "value_allowed_null": true
1965
1965
  },
@@ -1969,7 +1969,7 @@
1969
1969
  "example": "2020-01-01 12:00:00",
1970
1970
  "member": "string",
1971
1971
  "name": "UpdatedTime",
1972
- "required": true,
1972
+ "output_required": true,
1973
1973
  "type": "string",
1974
1974
  "value_allowed_null": true
1975
1975
  },
@@ -1979,7 +1979,7 @@
1979
1979
  "example": "12345",
1980
1980
  "member": "int64",
1981
1981
  "name": "BuildId",
1982
- "required": true,
1982
+ "output_required": true,
1983
1983
  "type": "int",
1984
1984
  "value_allowed_null": true
1985
1985
  },
@@ -1989,7 +1989,7 @@
1989
1989
  "example": "Image",
1990
1990
  "member": "string",
1991
1991
  "name": "UploadType",
1992
- "required": true,
1992
+ "output_required": true,
1993
1993
  "type": "string",
1994
1994
  "value_allowed_null": true
1995
1995
  },
@@ -1999,7 +1999,7 @@
1999
1999
  "example": "test",
2000
2000
  "member": "string",
2001
2001
  "name": "Remark",
2002
- "required": true,
2002
+ "output_required": true,
2003
2003
  "type": "string",
2004
2004
  "value_allowed_null": true
2005
2005
  },
@@ -2009,7 +2009,7 @@
2009
2009
  "example": "test",
2010
2010
  "member": "ObjectKV",
2011
2011
  "name": "UrlParam",
2012
- "required": true,
2012
+ "output_required": true,
2013
2013
  "type": "object",
2014
2014
  "value_allowed_null": true
2015
2015
  },
@@ -2019,7 +2019,7 @@
2019
2019
  "example": "1",
2020
2020
  "member": "int64",
2021
2021
  "name": "Priority",
2022
- "required": true,
2022
+ "output_required": true,
2023
2023
  "type": "int",
2024
2024
  "value_allowed_null": true
2025
2025
  },
@@ -2029,7 +2029,7 @@
2029
2029
  "example": "1",
2030
2030
  "member": "bool",
2031
2031
  "name": "IsDefaultPriority",
2032
- "required": true,
2032
+ "output_required": true,
2033
2033
  "type": "bool",
2034
2034
  "value_allowed_null": true
2035
2035
  },
@@ -2039,7 +2039,7 @@
2039
2039
  "example": "[]",
2040
2040
  "member": "CloudBaseRunKVPriority",
2041
2041
  "name": "FlowParams",
2042
- "required": true,
2042
+ "output_required": true,
2043
2043
  "type": "list",
2044
2044
  "value_allowed_null": true
2045
2045
  },
@@ -2049,7 +2049,7 @@
2049
2049
  "example": "1",
2050
2050
  "member": "int64",
2051
2051
  "name": "MinReplicas",
2052
- "required": true,
2052
+ "output_required": true,
2053
2053
  "type": "int",
2054
2054
  "value_allowed_null": true
2055
2055
  },
@@ -2059,7 +2059,7 @@
2059
2059
  "example": "2",
2060
2060
  "member": "int64",
2061
2061
  "name": "MaxReplicas",
2062
- "required": true,
2062
+ "output_required": true,
2063
2063
  "type": "int",
2064
2064
  "value_allowed_null": true
2065
2065
  },
@@ -2069,7 +2069,7 @@
2069
2069
  "example": "aa123",
2070
2070
  "member": "string",
2071
2071
  "name": "RunId",
2072
- "required": true,
2072
+ "output_required": true,
2073
2073
  "type": "string",
2074
2074
  "value_allowed_null": true
2075
2075
  },
@@ -2079,7 +2079,7 @@
2079
2079
  "example": "100",
2080
2080
  "member": "int64",
2081
2081
  "name": "Percent",
2082
- "required": true,
2082
+ "output_required": true,
2083
2083
  "type": "int",
2084
2084
  "value_allowed_null": true
2085
2085
  },
@@ -2089,7 +2089,7 @@
2089
2089
  "example": "1",
2090
2090
  "member": "int64",
2091
2091
  "name": "CurrentReplicas",
2092
- "required": true,
2092
+ "output_required": true,
2093
2093
  "type": "int",
2094
2094
  "value_allowed_null": true
2095
2095
  },
@@ -2099,7 +2099,7 @@
2099
2099
  "example": "xx",
2100
2100
  "member": "string",
2101
2101
  "name": "Architecture",
2102
- "required": true,
2102
+ "output_required": true,
2103
2103
  "type": "string",
2104
2104
  "value_allowed_null": true
2105
2105
  }
@@ -10425,29 +10425,27 @@
10425
10425
  "document": "安全网关版本路由信息限额配置",
10426
10426
  "members": [
10427
10427
  {
10428
- "default": "",
10429
10428
  "disabled": false,
10430
- "document": "限额对象 \"ConnectionsLimit\" 或 \"QPSLimit\"",
10429
+ "document": "限额对象 \"ConnectionsLimit\" 或 \"QPSLimit\"\n注意:此字段可能返回 null,表示取不到有效值。",
10431
10430
  "example": "ConnectionsLimit",
10432
10431
  "member": "string",
10433
10432
  "name": "LimitObject",
10434
10433
  "required": false,
10435
10434
  "type": "string",
10436
- "value_allowed_null": false
10435
+ "value_allowed_null": true
10437
10436
  },
10438
10437
  {
10439
- "default": "",
10440
10438
  "disabled": false,
10441
- "document": "限额配置",
10439
+ "document": "限额配置\n注意:此字段可能返回 null,表示取不到有效值。",
10442
10440
  "example": "{value:1000}",
10443
10441
  "member": "string",
10444
10442
  "name": "LimitConfig",
10445
10443
  "required": false,
10446
10444
  "type": "string",
10447
- "value_allowed_null": false
10445
+ "value_allowed_null": true
10448
10446
  }
10449
10447
  ],
10450
- "usage": "in"
10448
+ "usage": "both"
10451
10449
  },
10452
10450
  "FunctionInfo": {
10453
10451
  "document": "函数的信息",
@@ -13199,7 +13197,6 @@
13199
13197
  "document": "安全网关路由",
13200
13198
  "members": [
13201
13199
  {
13202
- "default": "",
13203
13200
  "disabled": false,
13204
13201
  "document": "安全网关路由名称",
13205
13202
  "example": "无",
@@ -13210,7 +13207,6 @@
13210
13207
  "value_allowed_null": false
13211
13208
  },
13212
13209
  {
13213
- "default": "",
13214
13210
  "disabled": false,
13215
13211
  "document": "安全网关路由协议",
13216
13212
  "example": "无",
@@ -13221,7 +13217,6 @@
13221
13217
  "value_allowed_null": false
13222
13218
  },
13223
13219
  {
13224
- "default": "",
13225
13220
  "disabled": false,
13226
13221
  "document": "安全网关路由地址",
13227
13222
  "example": "无",
@@ -13232,7 +13227,6 @@
13232
13227
  "value_allowed_null": false
13233
13228
  },
13234
13229
  {
13235
- "default": "",
13236
13230
  "disabled": false,
13237
13231
  "document": "安全网关路由描述",
13238
13232
  "example": "无",
@@ -13243,7 +13237,6 @@
13243
13237
  "value_allowed_null": false
13244
13238
  },
13245
13239
  {
13246
- "default": "",
13247
13240
  "disabled": false,
13248
13241
  "document": "安全网关后端集群id,如果是外网服务,该id与GatewayRountName相同",
13249
13242
  "example": "无",
@@ -13254,7 +13247,6 @@
13254
13247
  "value_allowed_null": false
13255
13248
  },
13256
13249
  {
13257
- "default": "",
13258
13250
  "disabled": false,
13259
13251
  "document": "安全网关创建时间",
13260
13252
  "example": "无",
@@ -13265,7 +13257,6 @@
13265
13257
  "value_allowed_null": false
13266
13258
  },
13267
13259
  {
13268
- "default": "",
13269
13260
  "disabled": false,
13270
13261
  "document": "安全网关路由限制\n注意:此字段可能返回 null,表示取不到有效值。",
13271
13262
  "example": "无",
@@ -13276,7 +13267,6 @@
13276
13267
  "value_allowed_null": true
13277
13268
  },
13278
13269
  {
13279
- "default": "",
13280
13270
  "disabled": false,
13281
13271
  "document": "ip代表绑定后端ip。cbr代表云托管服务\n注意:此字段可能返回 null,表示取不到有效值。",
13282
13272
  "example": "cbr",
@@ -13287,7 +13277,6 @@
13287
13277
  "value_allowed_null": true
13288
13278
  },
13289
13279
  {
13290
- "default": "",
13291
13280
  "disabled": false,
13292
13281
  "document": "服务名\n注意:此字段可能返回 null,表示取不到有效值。",
13293
13282
  "example": "test",
@@ -13298,7 +13287,6 @@
13298
13287
  "value_allowed_null": true
13299
13288
  },
13300
13289
  {
13301
- "default": "",
13302
13290
  "disabled": false,
13303
13291
  "document": "ip\n注意:此字段可能返回 null,表示取不到有效值。",
13304
13292
  "example": "1.0.0.1",
@@ -13309,7 +13297,6 @@
13309
13297
  "value_allowed_null": true
13310
13298
  },
13311
13299
  {
13312
- "default": "",
13313
13300
  "disabled": false,
13314
13301
  "document": "网关版本\n注意:此字段可能返回 null,表示取不到有效值。",
13315
13302
  "example": "gatewayversion",
@@ -13320,7 +13307,6 @@
13320
13307
  "value_allowed_null": true
13321
13308
  },
13322
13309
  {
13323
- "default": "",
13324
13310
  "disabled": false,
13325
13311
  "document": "请求路径\n注意:此字段可能返回 null,表示取不到有效值。",
13326
13312
  "example": "path",
@@ -13331,7 +13317,6 @@
13331
13317
  "value_allowed_null": true
13332
13318
  },
13333
13319
  {
13334
- "default": "",
13335
13320
  "disabled": false,
13336
13321
  "document": "请求模式\n注意:此字段可能返回 null,表示取不到有效值。",
13337
13322
  "example": "GET",
@@ -13342,7 +13327,6 @@
13342
13327
  "value_allowed_null": true
13343
13328
  },
13344
13329
  {
13345
- "default": "",
13346
13330
  "disabled": false,
13347
13331
  "document": "4层端口\n注意:此字段可能返回 null,表示取不到有效值。",
13348
13332
  "example": "80",
@@ -13351,6 +13335,16 @@
13351
13335
  "required": true,
13352
13336
  "type": "int",
13353
13337
  "value_allowed_null": true
13338
+ },
13339
+ {
13340
+ "disabled": false,
13341
+ "document": "路由环境ID\n注意:此字段可能返回 null,表示取不到有效值。",
13342
+ "example": "env-xxx",
13343
+ "member": "string",
13344
+ "name": "GatewayRouteEnvId",
13345
+ "required": false,
13346
+ "type": "string",
13347
+ "value_allowed_null": true
13354
13348
  }
13355
13349
  ],
13356
13350
  "usage": "out"
@@ -0,0 +1,4 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ from tccli.services.tchd.tchd_client import action_caller
4
+
@@ -0,0 +1,194 @@
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.tchd.v20230306 import tchd_client as tchd_client_v20230306
15
+ from tencentcloud.tchd.v20230306 import models as models_v20230306
16
+
17
+ from jmespath import search
18
+ import time
19
+
20
+ def doDescribeEvents(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('-', '_')]
29
+ )
30
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_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.TchdClient(cred, g_param[OptionsDefine.Region], profile)
47
+ client._sdkVersion += ("_CLI_" + __version__)
48
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
49
+ model = models.DescribeEventsRequest()
50
+ model.from_json_string(json.dumps(args))
51
+ start_time = time.time()
52
+ while True:
53
+ rsp = client.DescribeEvents(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
+ CLIENT_MAP = {
73
+ "v20230306": tchd_client_v20230306,
74
+
75
+ }
76
+
77
+ MODELS_MAP = {
78
+ "v20230306": models_v20230306,
79
+
80
+ }
81
+
82
+ ACTION_MAP = {
83
+ "DescribeEvents": doDescribeEvents,
84
+
85
+ }
86
+
87
+ AVAILABLE_VERSION_LIST = [
88
+ "v20230306",
89
+
90
+ ]
91
+
92
+
93
+ def action_caller():
94
+ return ACTION_MAP
95
+
96
+
97
+ def parse_global_arg(parsed_globals):
98
+ g_param = parsed_globals
99
+
100
+ is_exist_profile = True
101
+ if not parsed_globals["profile"]:
102
+ is_exist_profile = False
103
+ g_param["profile"] = "default"
104
+
105
+ configure_path = os.path.join(os.path.expanduser("~"), ".tccli")
106
+ is_conf_exist, conf_path = Utils.file_existed(configure_path, g_param["profile"] + ".configure")
107
+ is_cred_exist, cred_path = Utils.file_existed(configure_path, g_param["profile"] + ".credential")
108
+
109
+ conf = {}
110
+ cred = {}
111
+
112
+ if is_conf_exist:
113
+ conf = Utils.load_json_msg(conf_path)
114
+ if is_cred_exist:
115
+ cred = Utils.load_json_msg(cred_path)
116
+
117
+ if not (isinstance(conf, dict) and isinstance(cred, dict)):
118
+ raise ConfigurationError(
119
+ "file: %s or %s is not json format"
120
+ % (g_param["profile"] + ".configure", g_param["profile"] + ".credential"))
121
+
122
+ if OptionsDefine.Token not in cred:
123
+ cred[OptionsDefine.Token] = None
124
+
125
+ if not is_exist_profile:
126
+ if os.environ.get(OptionsDefine.ENV_SECRET_ID) and os.environ.get(OptionsDefine.ENV_SECRET_KEY):
127
+ cred[OptionsDefine.SecretId] = os.environ.get(OptionsDefine.ENV_SECRET_ID)
128
+ cred[OptionsDefine.SecretKey] = os.environ.get(OptionsDefine.ENV_SECRET_KEY)
129
+ cred[OptionsDefine.Token] = os.environ.get(OptionsDefine.ENV_TOKEN)
130
+
131
+ if os.environ.get(OptionsDefine.ENV_REGION):
132
+ conf[OptionsDefine.Region] = os.environ.get(OptionsDefine.ENV_REGION)
133
+
134
+ if os.environ.get(OptionsDefine.ENV_ROLE_ARN) and os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME):
135
+ cred[OptionsDefine.RoleArn] = os.environ.get(OptionsDefine.ENV_ROLE_ARN)
136
+ cred[OptionsDefine.RoleSessionName] = os.environ.get(OptionsDefine.ENV_ROLE_SESSION_NAME)
137
+
138
+ for param in g_param.keys():
139
+ if g_param[param] is None:
140
+ if param in [OptionsDefine.SecretKey, OptionsDefine.SecretId, OptionsDefine.Token]:
141
+ if param in cred:
142
+ g_param[param] = cred[param]
143
+ elif not (g_param[OptionsDefine.UseCVMRole.replace('-', '_')]
144
+ or os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN)):
145
+ raise ConfigurationError("%s is invalid" % param)
146
+ elif param in [OptionsDefine.Region, OptionsDefine.Output, OptionsDefine.Language]:
147
+ if param in conf:
148
+ g_param[param] = conf[param]
149
+ elif param != OptionsDefine.Language:
150
+ raise ConfigurationError("%s is invalid" % param)
151
+ elif param.replace('_', '-') in [OptionsDefine.RoleArn, OptionsDefine.RoleSessionName]:
152
+ if param.replace('_', '-') in cred:
153
+ g_param[param] = cred[param.replace('_', '-')]
154
+
155
+ try:
156
+ if g_param[OptionsDefine.ServiceVersion]:
157
+ g_param[OptionsDefine.Version] = "v" + g_param[OptionsDefine.ServiceVersion].replace('-', '')
158
+ else:
159
+ version = conf["tchd"][OptionsDefine.Version]
160
+ g_param[OptionsDefine.Version] = "v" + version.replace('-', '')
161
+
162
+ if g_param[OptionsDefine.Endpoint] is None:
163
+ g_param[OptionsDefine.Endpoint] = conf["tchd"][OptionsDefine.Endpoint]
164
+ except Exception as err:
165
+ raise ConfigurationError("config file:%s error, %s" % (conf_path, str(err)))
166
+
167
+ if g_param[OptionsDefine.Version] not in AVAILABLE_VERSION_LIST:
168
+ raise Exception("available versions: %s" % " ".join(AVAILABLE_VERSION_LIST))
169
+
170
+ if g_param[OptionsDefine.Waiter]:
171
+ param = eval(g_param[OptionsDefine.Waiter])
172
+ if 'expr' not in param:
173
+ raise Exception('`expr` in `--waiter` must be defined')
174
+ if 'to' not in param:
175
+ raise Exception('`to` in `--waiter` must be defined')
176
+ if 'timeout' not in param:
177
+ if 'waiter' in conf and 'timeout' in conf['waiter']:
178
+ param['timeout'] = conf['waiter']['timeout']
179
+ else:
180
+ param['timeout'] = 180
181
+ if 'interval' not in param:
182
+ if 'waiter' in conf and 'interval' in conf['waiter']:
183
+ param['interval'] = conf['waiter']['interval']
184
+ else:
185
+ param['interval'] = 5
186
+ param['interval'] = min(param['interval'], param['timeout'])
187
+ g_param['OptionsDefine.WaiterInfo'] = param
188
+
189
+ if six.PY2:
190
+ for key, value in g_param.items():
191
+ if isinstance(value, six.text_type):
192
+ g_param[key] = value.encode('utf-8')
193
+ return g_param
194
+
@@ -0,0 +1,167 @@
1
+ {
2
+ "actions": {
3
+ "DescribeEvents": {
4
+ "document": "本接口用于查询腾讯云健康看板的可用性事件信息,可以通过产品列表、地域列表和事件发生日期进行过滤查询。",
5
+ "input": "DescribeEventsRequest",
6
+ "name": "查看事件列表",
7
+ "output": "DescribeEventsResponse",
8
+ "status": "online"
9
+ }
10
+ },
11
+ "metadata": {
12
+ "apiVersion": "2023-03-06",
13
+ "api_brief": "支持腾讯云用户通过API获取云产品健康看板数据",
14
+ "serviceNameCN": "腾讯云健康看板",
15
+ "serviceShortName": "tchd"
16
+ },
17
+ "objects": {
18
+ "DescribeEventsRequest": {
19
+ "document": "DescribeEvents请求参数结构体",
20
+ "members": [
21
+ {
22
+ "disabled": false,
23
+ "document": "事件的发生日期",
24
+ "example": "2023-06-22",
25
+ "member": "date",
26
+ "name": "EventDate",
27
+ "required": true,
28
+ "type": "string"
29
+ },
30
+ {
31
+ "disabled": false,
32
+ "document": "1. 不指定产品列表时将查询所有产品。\n2. 产品ID示例:cvm、lb、cdb、cdn、crs",
33
+ "example": "[\"cvm\",\"clb\"]",
34
+ "member": "string",
35
+ "name": "ProductIds",
36
+ "required": false,
37
+ "type": "list"
38
+ },
39
+ {
40
+ "disabled": false,
41
+ "document": "1. 不指定地域列表时将查询所有地域。\n2. 查询非区域性产品事件时,地域ID指定为:non-regional\n3. 其他地域ID取值请参考:https://cloud.tencent.com/document/api/213/15692",
42
+ "example": "[\"ap-guangzhou\",\"ap-shanghai\"]",
43
+ "member": "string",
44
+ "name": "RegionIds",
45
+ "required": false,
46
+ "type": "list"
47
+ }
48
+ ],
49
+ "type": "object"
50
+ },
51
+ "DescribeEventsResponse": {
52
+ "document": "DescribeEvents返回参数结构体",
53
+ "members": [
54
+ {
55
+ "disabled": false,
56
+ "document": "事件详情列表",
57
+ "example": "无",
58
+ "member": "ProductEventList",
59
+ "name": "Data",
60
+ "output_required": true,
61
+ "type": "object",
62
+ "value_allowed_null": false
63
+ },
64
+ {
65
+ "document": "唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。",
66
+ "member": "string",
67
+ "name": "RequestId",
68
+ "type": "string"
69
+ }
70
+ ],
71
+ "type": "object"
72
+ },
73
+ "EventDetail": {
74
+ "document": "事件详情信息,包含:产品名称、地域名称、事件开始时间、事件结束时间、事件当前状态;",
75
+ "members": [
76
+ {
77
+ "disabled": false,
78
+ "document": "产品ID",
79
+ "example": "cvm",
80
+ "member": "string",
81
+ "name": "ProductId",
82
+ "output_required": true,
83
+ "type": "string",
84
+ "value_allowed_null": false
85
+ },
86
+ {
87
+ "disabled": false,
88
+ "document": "产品名称",
89
+ "example": "云服务器",
90
+ "member": "string",
91
+ "name": "ProductName",
92
+ "output_required": true,
93
+ "type": "string",
94
+ "value_allowed_null": false
95
+ },
96
+ {
97
+ "disabled": false,
98
+ "document": "地域ID,非区域性地域返回non-regional",
99
+ "example": "ap-beijing",
100
+ "member": "string",
101
+ "name": "RegionId",
102
+ "output_required": true,
103
+ "type": "string",
104
+ "value_allowed_null": false
105
+ },
106
+ {
107
+ "disabled": false,
108
+ "document": "地域名称",
109
+ "example": "北京",
110
+ "member": "string",
111
+ "name": "RegionName",
112
+ "output_required": true,
113
+ "type": "string",
114
+ "value_allowed_null": false
115
+ },
116
+ {
117
+ "disabled": false,
118
+ "document": "事件开始时间",
119
+ "example": "2023-06-22 09:55:00",
120
+ "member": "string",
121
+ "name": "StartTime",
122
+ "output_required": true,
123
+ "type": "string",
124
+ "value_allowed_null": false
125
+ },
126
+ {
127
+ "disabled": false,
128
+ "document": "事件结束时间,当事件正在发生还未结束时,结束时间返回空",
129
+ "example": "2023-06-22 10:00:00",
130
+ "member": "string",
131
+ "name": "EndTime",
132
+ "output_required": true,
133
+ "type": "string",
134
+ "value_allowed_null": false
135
+ },
136
+ {
137
+ "disabled": false,
138
+ "document": "事件当前状态:提示、异常、正常",
139
+ "example": "异常",
140
+ "member": "string",
141
+ "name": "CurrentStatus",
142
+ "output_required": true,
143
+ "type": "string",
144
+ "value_allowed_null": false
145
+ }
146
+ ],
147
+ "usage": "out"
148
+ },
149
+ "ProductEventList": {
150
+ "document": "产品可用性事件详情列表",
151
+ "members": [
152
+ {
153
+ "disabled": false,
154
+ "document": "事件详情列表\n注意:此字段可能返回 null,表示取不到有效值。",
155
+ "example": "无",
156
+ "member": "EventDetail",
157
+ "name": "EventList",
158
+ "output_required": false,
159
+ "type": "list",
160
+ "value_allowed_null": true
161
+ }
162
+ ],
163
+ "usage": "out"
164
+ }
165
+ },
166
+ "version": "1.0"
167
+ }