tccli-intl-en 3.0.1270.1__py2.py3-none-any.whl → 3.0.1272.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.
Files changed (35) hide show
  1. tccli/__init__.py +1 -1
  2. tccli/services/__init__.py +2 -1
  3. tccli/services/ccc/ccc_client.py +65 -12
  4. tccli/services/ccc/v20200210/api.json +112 -15
  5. tccli/services/ccc/v20200210/examples.json +8 -0
  6. tccli/services/clb/v20180317/api.json +29 -14
  7. tccli/services/cynosdb/cynosdb_client.py +114 -8
  8. tccli/services/cynosdb/v20190107/api.json +718 -54
  9. tccli/services/cynosdb/v20190107/examples.json +20 -4
  10. tccli/services/dlc/dlc_client.py +175 -16
  11. tccli/services/dlc/v20210125/api.json +282 -6
  12. tccli/services/dlc/v20210125/examples.json +24 -0
  13. tccli/services/faceid/v20180301/examples.json +1 -1
  14. tccli/services/mdl/v20200326/api.json +104 -0
  15. tccli/services/mongodb/mongodb_client.py +159 -0
  16. tccli/services/mongodb/v20190725/api.json +533 -226
  17. tccli/services/mongodb/v20190725/examples.json +46 -22
  18. tccli/services/monitor/monitor_client.py +273 -8
  19. tccli/services/monitor/v20180724/api.json +649 -0
  20. tccli/services/monitor/v20180724/examples.json +40 -0
  21. tccli/services/mps/v20190612/api.json +179 -30
  22. tccli/services/mps/v20190612/examples.json +8 -8
  23. tccli/services/quota/v20241204/api.json +13 -2
  24. tccli/services/quota/v20241204/examples.json +4 -3
  25. tccli/services/redis/v20180412/api.json +225 -113
  26. tccli/services/redis/v20180412/examples.json +19 -19
  27. tccli/services/wedata/v20250806/api.json +13644 -0
  28. tccli/services/wedata/v20250806/examples.json +621 -0
  29. tccli/services/wedata/wedata_client.py +4663 -789
  30. {tccli_intl_en-3.0.1270.1.dist-info → tccli_intl_en-3.0.1272.1.dist-info}/METADATA +2 -2
  31. {tccli_intl_en-3.0.1270.1.dist-info → tccli_intl_en-3.0.1272.1.dist-info}/RECORD +35 -33
  32. {tccli_intl_en-3.0.1270.1.dist-info → tccli_intl_en-3.0.1272.1.dist-info}/LICENSE +0 -0
  33. {tccli_intl_en-3.0.1270.1.dist-info → tccli_intl_en-3.0.1272.1.dist-info}/WHEEL +0 -0
  34. {tccli_intl_en-3.0.1270.1.dist-info → tccli_intl_en-3.0.1272.1.dist-info}/entry_points.txt +0 -0
  35. {tccli_intl_en-3.0.1270.1.dist-info → tccli_intl_en-3.0.1272.1.dist-info}/top_level.txt +0 -0
@@ -3,14 +3,14 @@
3
3
  "AssignProject": [
4
4
  {
5
5
  "document": " ",
6
- "input": "https://mongodb.tencentcloudapi.com/?Action=AssignProject\n&InstanceIds.0=cmgo-eqmoa5sf\n&ProjectId=12\n&<Common request parameters>",
6
+ "input": "https://mongodb.tencentcloudapi.com/?Action=AssignProject\n&InstanceIds.0=cmgo-eqmo****\n&ProjectId=12\n&<Common request parameters>",
7
7
  "output": "{\n \"Response\": {\n \"FlowIds\": [\n 1081\n ],\n \"RequestId\": \"8e2a339e-5ba9-4da3-8dc2-65a0a6314811\"\n }\n}",
8
- "title": "Specifying the project to which an instance belongs"
8
+ "title": "Specifying the Associated Project of a TencentDB for MongoDB Instance"
9
9
  }
10
10
  ],
11
11
  "CreateBackupDBInstance": [
12
12
  {
13
- "document": "This example shows you how to back up an instance.",
13
+ "document": "This example shows how to back up an instance.",
14
14
  "input": "https://mongodb.tencentcloudapi.com/?Action=CreateBackupDBInstance\n&InstanceId=cmgo-ayxpky6l\n&BackupRemark=remarkInfo\n&BackupMethod=0\n&<Common request parameters>",
15
15
  "output": "{\n \"Response\": {\n \"AsyncRequestId\": \"1680780049\",\n \"RequestId\": \"1df930fb-eb7e-4e3f-bcab-15a1aa5fede0\"\n }\n}",
16
16
  "title": "Backing Up an Instance"
@@ -51,9 +51,9 @@
51
51
  "DescribeBackupDownloadTask": [
52
52
  {
53
53
  "document": " ",
54
- "input": "https://mongodb.tencentcloudapi.com/?Action=DescribeBackupDownloadTask\n&InstanceId=cmgo-dygv1rnp\n&Status.0=2\n&<Common request parameters>",
55
- "output": "{\n \"Response\": {\n \"RequestId\": \"c41c0c46-7d5a-49b9-832a-557880c1e9ef\",\n \"Tasks\": [\n {\n \"BackupName\": \"cmgo-dygv1rnp_2021-03-26 10:44\",\n \"BackupSize\": 844,\n \"CreateTime\": \"2021-03-26 10:47:37\",\n \"Percent\": 100,\n \"ReplicaSetId\": \"cmgo-dygv1rnp_0\",\n \"Status\": 2,\n \"TimeSpend\": 0,\n \"Url\": \"https://mognodb-backup-test-tar-1251937656.cos.ap-guangzhou.myqcloud.com/cmgo-dygv1rnp_2021-03-26%2010%3A44%2Fcmgo-dygv1rnp_0.tar?q-sign-algorithm=sha1&q-ak=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&q-sign-time=1616726859%3B1616813259&q-key-time=1616726859%3B1616813259&q-header-list=host&q-url-param-list=&q-signature=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n }\n ],\n \"TotalCount\": 1\n }\n}",
56
- "title": "Querying backup download task information"
54
+ "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeBackupDownloadTask\n<Common request parameters>\n\n{\n \"InstanceId\": \"cmgo-fdzf****\",\n \"Status\": [\n \"2\"\n ]\n}",
55
+ "output": "{\n \"Response\": {\n \"RequestId\": \"c7c0c495-4826-4938-a6d7-32146cad2632\",\n \"Tasks\": [\n {\n \"BackupDesc\": \"Set daily scheduled automatic backup in the system background.\",\n \"BackupMethod\": 0,\n \"BackupName\": \"cmgo-fdzf****_2025-09-23 22:03\",\n \"BackupSize\": 5747378,\n \"Bucket\": \"sh-backup-remote-125758****\",\n \"CreateTime\": \"2025-09-24 10:58:55\",\n \"Percent\": 100,\n \"Region\": \"ap-shanghai\",\n \"ReplicaSetId\": \"cmgo-fdzf******\",\n \"Status\": 2,\n \"TimeSpend\": 1,\n \"Url\": \"https://sh-backup-remote-tar-**************\"\n }\n ],\n \"TotalCount\": 1\n }\n}",
56
+ "title": "Querying a Backup Download Task"
57
57
  }
58
58
  ],
59
59
  "DescribeClientConnections": [
@@ -67,8 +67,8 @@
67
67
  "DescribeDBBackups": [
68
68
  {
69
69
  "document": " ",
70
- "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeDBBackups\n<Common request parameters>\n\n{\n \"InstanceId\": \"cmgo-f555zzzz\",\n \"BackupMethod\": 1\n}",
71
- "output": "{\n \"Response\": {\n \"RequestId\": \"6EF60BEC-0242-43AF-BB20-270359FB54A7\",\n \"BackupList\": [],\n \"TotalCount\": 0\n }\n}",
70
+ "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeDBBackups\n<Common request parameters>\n\n{\n \"InstanceId\": \"cmgo-fdzf****\",\n \"BackupMethod\": 0\n}",
71
+ "output": "{\n \"Response\": {\n \"BackupList\": [\n {\n \"BackId\": 10657020,\n \"BackupDesc\": \"Set daily scheduled automatic backup in the system background.\",\n \"BackupMethod\": 0,\n \"BackupName\": \"cmgo-fdzf****_2025-09-17 22:01\",\n \"BackupRegion\": \"\",\n \"BackupSize\": 5747379,\n \"BackupType\": 0,\n \"DeleteTime\": \"2025-09-24 22:01:58\",\n \"EndTime\": \"2025-09-17 22:01:58\",\n \"InstanceId\": \"cmgo-fdzf****\",\n \"RestoreTime\": \"\",\n \"StartTime\": \"2025-09-17 22:01:52\",\n \"Status\": 2\n },\n {\n \"BackId\": 10688339,\n \"BackupDesc\": \"Set daily scheduled automatic backup in the system background.\",\n \"BackupMethod\": 0,\n \"BackupName\": \"cmgo-fdzf****_2025-09-18 22:03\",\n \"BackupRegion\": \"ap-shanghai\",\n \"BackupSize\": 5747378,\n \"BackupType\": 0,\n \"DeleteTime\": \"2025-09-20 22:03:37\",\n \"EndTime\": \"2025-09-18 22:03:44\",\n \"InstanceId\": \"cmgo-fdzf****\",\n \"RestoreTime\": \"\",\n \"StartTime\": \"2025-09-18 22:03:42\",\n \"Status\": 2\n }\n ],\n \"RequestId\": \"0e2eb0e1-f775-4ba8-af9f-e5650a55dce1\",\n \"TotalCount\": 2\n }\n}",
72
72
  "title": "Querying the Backup File Information on a TencentDB for MongoDB Instance"
73
73
  }
74
74
  ],
@@ -88,10 +88,10 @@
88
88
  "title": "Querying the Database List of the Current Instance"
89
89
  },
90
90
  {
91
- "document": "This example shows you how to query the information on all collections of a database when DbName is specified.",
91
+ "document": "This example shows you how to query the information on all collections of the database when DbName is specified.",
92
92
  "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeDBInstanceNamespace\n<Common request parameters>\n\n{\n \"InstanceId\": \"cmgo-qny2****\",\n \"DbName\": \"demo_db0\"\n}",
93
93
  "output": "{\n \"Response\": {\n \"Collections\": [\n \"col148\",\n \"col108\",\n \"col120\"\n ],\n \"RequestId\": \"21b503b5-6606-4efb-b250-63071c2fe565\"\n }\n}",
94
- "title": "Querying All Collections in a Specified Database"
94
+ "title": "Querying All Collections of the Specified Database"
95
95
  }
96
96
  ],
97
97
  "DescribeDBInstances": [
@@ -102,6 +102,14 @@
102
102
  "title": "Query Instance List"
103
103
  }
104
104
  ],
105
+ "DescribeDetailedSlowLogs": [
106
+ {
107
+ "document": "",
108
+ "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeDetailedSlowLogs\n<Common request parameters>\n\n{\n \"InstanceId\": \"cmgo-r3p8****\",\n \"StartTime\": \"2025-09-22 11:53:15\",\n \"EndTime\": \"2025-09-23 11:53:15\"\n}",
109
+ "output": "{\n \"Response\": {\n \"DetailedSlowLogs\": [\n {\n \"Log\": \"Mon Sep 22 20:30:19.980 I COMMAND [conn3725696] command admin.$cmd command: saslContinue { saslContinue: 1, conversationId: 1, payload: BinData(0, ), $clusterTime: { clusterTime: Timestamp(1758544211, 1), signature: { hash: BinData(0, C28B5E1C1EE29**************************), keyId: 75428892796********* } }, $db: \\\"admin\\\", $readPreference: { mode: \\\"primaryPreferred\\\" } } numYields:0 reslen:204 locks:{} protocol:op_msg 184ms\",\n \"NodeName\": \"cmgo-r3p8****_0-node-primary\",\n \"QueryHash\": \"admin..****Continue\"\n }\n ],\n \"RequestId\": \"5e35a1bd-60e6-4a45-8792-d033581b9209\",\n \"TotalCount\": 1\n }\n}",
110
+ "title": "Querying Slow Log Details"
111
+ }
112
+ ],
105
113
  "DescribeInstanceParams": [
106
114
  {
107
115
  "document": "This example shows you how to call this API to obtain the list of configurable parameters for a TencentDB for MongoDB instance.",
@@ -114,23 +122,23 @@
114
122
  {
115
123
  "document": "This example shows you how to query all security groups bound to the current instance.",
116
124
  "input": "https://mongodb.tencentcloudapi.com/?Action=DescribeSecurityGroup\n&InstanceId=cmgo-p8vn****\n&<Common request parameters>",
117
- "output": "{\n \"Response\": {\n \"Groups\": [\n {\n \"ProjectId\": 0,\n \"CreateTime\": \"2022-03-23 12:05:22\",\n \"Inbound\": [\n {\n \"Action\": \"Describe*\",\n \"CidrIp\": \"127.0.0.1\",\n \"PortRange\": \"27017\",\n \"IpProtocol\": \"tcp\",\n \"Id\": \"\",\n \"AddressModule\": \"\",\n \"ServiceModule\": \"\",\n \"Desc\": \"localip\"\n }\n ],\n \"Outbound\": [\n {\n \"Action\": \"Describe*\",\n \"CidrIp\": \"127.0.0.1\",\n \"PortRange\": \"27017\",\n \"IpProtocol\": \"tcp\",\n \"AddressModule\": \"\",\n \"ServiceModule\": \"\",\n \"Desc\": \"localip\"\n }\n ],\n \"SecurityGroupId\": \"sg-cade***\",\n \"SecurityGroupName\": \"sg\",\n \"SecurityGroupRemark\": \"sg-mark\"\n }\n ],\n \"RequestId\": \"bc59fa05-d429-4bcf-863f-1f6f99295485\"\n }\n}",
118
- "title": "Querying Instance Security Groups"
125
+ "output": "{\n \"Response\": {\n \"Groups\": [\n {\n \"CreateTime\": \"2022-06-08 17:06:38\",\n \"Inbound\": [\n {\n \"Action\": \"ACCEPT\",\n \"AddressModule\": \"\",\n \"CidrIp\": \"**.**.**.**/24\",\n \"Desc\": \"\",\n \"Id\": \"\",\n \"IpProtocol\": \"tcp\",\n \"PortRange\": \"8086\",\n \"ServiceModule\": \"\"\n },\n {\n \"Action\": \"ACCEPT\",\n \"AddressModule\": \"\",\n \"CidrIp\": \"**.**.**.**/24\",\n \"Desc\": \"\",\n \"Id\": \"\",\n \"IpProtocol\": \"tcp\",\n \"PortRange\": \"****\",\n \"ServiceModule\": \"\"\n },\n {\n \"Action\": \"ACCEPT\",\n \"AddressModule\": \"\",\n \"CidrIp\": \"**.**.**.**/24\",\n \"Desc\": \"\",\n \"Id\": \"\",\n \"IpProtocol\": \"tcp\",\n \"PortRange\": \"****\",\n \"ServiceModule\": \"\"\n },\n {\n \"Action\": \"ACCEPT\",\n \"AddressModule\": \"\",\n \"CidrIp\": \"**.**.**.**/24\",\n \"Desc\": \"\",\n \"Id\": \"\",\n \"IpProtocol\": \"tcp\",\n \"PortRange\": \"****\",\n \"ServiceModule\": \"\"\n },\n {\n \"Action\": \"ACCEPT\",\n \"AddressModule\": \"\",\n \"CidrIp\": \"**.**.**.**/24\",\n \"Desc\": \"\",\n \"Id\": \"\",\n \"IpProtocol\": \"tcp\",\n \"PortRange\": \"****\",\n \"ServiceModule\": \"\"\n },\n {\n \"Action\": \"ACCEPT\",\n \"AddressModule\": \"ipm-pvcdf2ty\",\n \"CidrIp\": \"\",\n \"Desc\": \"\",\n \"Id\": \"\",\n \"IpProtocol\": \"tcp\",\n \"PortRange\": \"**,**,**,****,**,****\",\n \"ServiceModule\": \"\"\n }\n ],\n \"Outbound\": [],\n \"ProjectId\": 0,\n \"SecurityGroupId\": \"sg-0klp****\",\n \"SecurityGroupName\": \"default\",\n \"SecurityGroupRemark\": \"System created security group\"\n }\n ],\n \"RequestId\": \"21d6a495-f46d-4440-bd25-d4e36f51afdd\"\n }\n}",
126
+ "title": "Querying an Instance Security Group"
119
127
  }
120
128
  ],
121
129
  "DescribeSlowLogPatterns": [
122
130
  {
123
131
  "document": " ",
124
- "input": "https://mongodb.tencentcloudapi.com/?Action=DescribeSlowLogPatterns\n&InstanceId=cmgo-a3bm93hf\n&StartTime=2020-04-20 00:00:00\n&EndTime=2020-04-20 22:00:00\n&SlowMS=100\n&Offset=0\n&Limit=100\n&<Common request parameters>",
132
+ "input": "https://mongodb.tencentcloudapi.com/?Action=DescribeSlowLogPatterns\n&InstanceId=cmgo-a3bm****\n&StartTime=2020-04-20 00:00:00\n&EndTime=2020-04-20 22:00:00\n&SlowMS=100\n&Offset=0\n&Limit=100\n&<Common request parameters>",
125
133
  "output": "{\n \"Response\": {\n \"Count\": 2,\n \"RequestId\": \"895de939-f726-4cb0-bb02-3890289479e3\",\n \"SlowLogPatterns\": [\n {\n \"AverageTime\": 699,\n \"MaxTime\": 5335,\n \"Pattern\": \"admin.$cmd.command\",\n \"Total\": 12\n },\n {\n \"AverageTime\": 271,\n \"MaxTime\": 423,\n \"Pattern\": \"local.system.replset.command\",\n \"Total\": 8\n }\n ]\n }\n}",
126
- "title": "Querying the slow log statistics of database"
134
+ "title": "Querying Database Slow Log Statistics Information"
127
135
  }
128
136
  ],
129
137
  "DescribeSlowLogs": [
130
138
  {
131
139
  "document": "This example shows you how to obtain the slow log information on an instance.",
132
- "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeSlowLogs\n<Common request parameters>\n\n{\n \"InstanceId\": \"cmgo-a1sh112****\",\n \"StartTime\": \"2020-09-22 00:00:00\",\n \"EndTime\": \"2020-09-22 00:00:00\",\n \"SlowMS\": 1,\n \"Offset\": 1,\n \"Limit\": 1,\n \"Format\": \"json\"\n}",
133
- "output": "{\n \"Response\": {\n \"Count\": 20,\n \"RequestId\": \"3a36aa6e-67e2-42a9-adfe-fc694334cc78\",\n \"SlowLogs\": [\n \"Mon Apr 20 13:55:21.623 I COMMAND [conn16903] command admin.$cmd command: _flushRoutingTableCacheUpdates { forceRoutingTableRefresh: \\\"config.system.sessions\\\", maxTimeMS: 30000, $clusterTime: { clusterTime: Timestamp(1587362114, 1), signature: { hash: BinData(0, 259955995BDC7E0CA35C4276EB23341C03910A48), keyId: 6817613949303783443 } }, $configServerState: { opTime: { ts: Timestamp(1587362108, 1), t: 1 } }, $db: \\\"admin\\\" } numYields:0 reslen:288 locks:{ Global: { acquireCount: { r: 4 } }, Database: { acquireCount: { r: 2 } }, Collection: { acquireCount: { r: 2 } } } protocol:op_msg 5335ms\",\n \"Mon Apr 20 14:01:00.309 I COMMAND [conn1313] command admin.$cmd command: _flushRoutingTableCacheUpdates { forceRoutingTableRefresh: \\\"config.system.sessions\\\", maxTimeMS: 30000, $clusterTime: { clusterTime: Timestamp(1587362457, 1), signature: { hash: BinData(0, DC2B16681C70845D7B6C8C6C97400D4DFB394CA0), keyId: 6817613949303783443 } }, $configServerState: { opTime: { ts: Timestamp(1587362455, 1), t: 1 } }, $db: \\\"admin\\\" } numYields:0 reslen:288 locks:{ Global: { acquireCount: { r: 4 } }, Database: { acquireCount: { r: 2 } }, Collection: { acquireCount: { r: 2 } } } protocol:op_msg 1264ms\",\n \"Mon Apr 20 14:20:15.283 I COMMAND [conn586] command admin.$cmd command: _flushRoutingTableCacheUpdates { forceRoutingTableRefresh: \\\"config.system.sessions\\\", maxTimeMS: 30000, $clusterTime: { clusterTime: Timestamp(1587363613, 1), signature: { hash: BinData(0, 72D24884320C8A9A26AF8C4DD1127874085DFAE5), keyId: 6817613949303783443 } }, $configServerState: { opTime: { ts: Timestamp(1587363603, 1), t: 1 } }, $db: \\\"admin\\\" } numYields:0 reslen:288 locks:{ Global: { acquireCount: { r: 4 } }, Database: { acquireCount: { r: 2 } }, Collection: { acquireCount: { r: 2 } } } protocol:op_msg 426ms\",\n \"Mon Apr 20 10:25:45.487 I COMMAND [conn48] command local.system.replset command: replSetReconfig { replSetReconfig: { _id: \\\"cmgo-a3bm93hf_1\\\", version: 3, protocolVersion: 1, members: [ { _id: 1, host: \\\"100.93.44.85:7005\\\", arbiterOnly: false, buildIndexes: true, hidden: false, priority: 1.0, slaveDelay: 0, votes: 1 }, { _id: 2, host: \\\"10.112.91.43:7009\\\", arbiterOnly: false, buildIndexes: true, hidden: false, priority: 1.0, slaveDelay: 0, votes: 1 }, { _id: 3, host: \\\"10.53.61.24:7004\\\" } ], settings: { chainingAllowed: true, heartbeatIntervalMillis: 2000, heartbeatTimeoutSecs: 10, electionTimeoutMillis: 10000, catchUpTimeoutMillis: -1, catchUpTakeoverDelayMillis: 30000, getLastErrorDefaults: { wtimeout: 0, w: 1 }, replicaSetId: ObjectId('5e9d08160c269352426f9575') } }, $db: \\\"admin\\\" } numYields:0 reslen:60 locks:{ Global: { acquireCount: { r: 3, w: 2, W: 1 } }, Database: { acquireCount: { w: 1, W: 1 } }, oplog: { acquireCount: { w: 1 } } } protocol:op_query 423ms\",\n \"Mon Apr 20 10:25:34.934 I COMMAND [conn28] command local.system.replset command: replSetReconfig { replSetReconfig: { _id: \\\"cmgo-a3bm93hf_1\\\", version: 2, protocolVersion: 1, members: [ { _id: 1, host: \\\"100.93.44.85:7005\\\", arbiterOnly: false, buildIndexes: true, hidden: false, priority: 1.0, slaveDelay: 0, votes: 1 }, { _id: 2, host: \\\"10.112.91.43:7009\\\" } ], settings: { chainingAllowed: true, heartbeatIntervalMillis: 2000, heartbeatTimeoutSecs: 10, electionTimeoutMillis: 10000, catchUpTimeoutMillis: -1, catchUpTakeoverDelayMillis: 30000, getLastErrorDefaults: { w: 1, wtimeout: 0 }, replicaSetId: ObjectId('5e9d08160c269352426f9575') } }, $db: \\\"admin\\\" } numYields:0 reslen:60 locks:{ Global: { acquireCount: { r: 3, w: 2, W: 1 } }, Database: { acquireCount: { w: 1, W: 1 } }, oplog: { acquireCount: { w: 1 } } } protocol:op_query 414ms\",\n \"Mon Apr 20 10:24:52.278 I COMMAND [conn30] command local.system.replset command: replSetReconfig { replSetReconfig: { _id: \\\"cmgo-a3bm93hf_0\\\", version: 2, protocolVersion: 1, members: [ { _id: 1, host: \\\"10.53.80.6:7011\\\", arbiterOnly: false, buildIndexes: true, hidden: false, priority: 1.0, slaveDelay: 0, votes: 1 }, { _id: 2, host: \\\"100.93.44.26:7012\\\" } ], settings: { chainingAllowed: true, heartbeatIntervalMillis: 2000, heartbeatTimeoutSecs: 10, electionTimeoutMillis: 10000, catchUpTimeoutMillis: -1, catchUpTakeoverDelayMillis: 30000, getLastErrorDefaults: { w: 1, wtimeout: 0 }, replicaSetId: ObjectId('5e9d07ebf3f99b58c95a33fb') } }, $db: \\\"admin\\\" } numYields:0 reslen:60 locks:{ Global: { acquireCount: { r: 3, w: 2, W: 1 } }, Database: { acquireCount: { w: 1, W: 1 } }, oplog: { acquireCount: { w: 1 } } } protocol:op_query 406ms\",\n \"Mon Apr 20 10:25:02.675 I COMMAND [conn50] command local.system.replset command: replSetReconfig { replSetReconfig: { _id: \\\"cmgo-a3bm93hf_0\\\", version: 3, protocolVersion: 1, members: [ { _id: 1, host: \\\"10.53.80.6:7011\\\", arbiterOnly: false, buildIndexes: true, hidden: false, priority: 1.0, slaveDelay: 0, votes: 1 }, { _id: 2, host: \\\"100.93.44.26:7012\\\", arbiterOnly: false, buildIndexes: true, hidden: false, priority: 1.0, slaveDelay: 0, votes: 1 }, { _id: 3, host: \\\"9.34.46.139:7003\\\" } ], settings: { chainingAllowed: true, heartbeatIntervalMillis: 2000, heartbeatTimeoutSecs: 10, electionTimeoutMillis: 10000, catchUpTimeoutMillis: -1, catchUpTakeoverDelayMillis: 30000, getLastErrorDefaults: { w: 1, wtimeout: 0 }, replicaSetId: ObjectId('5e9d07ebf3f99b58c95a33fb') } }, $db: \\\"admin\\\" } numYields:0 reslen:60 locks:{ Global: { acquireCount: { r: 3, w: 2, W: 1 } }, Database: { acquireCount: { w: 1, W: 1 } }, oplog: { acquireCount: { w: 1 } } } protocol:op_query 373ms\",\n \"Mon Apr 20 18:35:15.103 I COMMAND [conn586] command admin.$cmd command: _flushRoutingTableCacheUpdates { forceRoutingTableRefresh: \\\"config.system.sessions\\\", maxTimeMS: 30000, $clusterTime: { clusterTime: Timestamp(1587378913, 1), signature: { hash: BinData(0, A3C176F81B64A7473F88F3F40B84C59EC9E1E1AE), keyId: 6817613949303783443 } }, $configServerState: { opTime: { ts: Timestamp(1587378912, 1), t: 2 } }, $db: \\\"admin\\\" } numYields:0 reslen:288 locks:{ Global: { acquireCount: { r: 4 } }, Database: { acquireCount: { r: 2 } }, Collection: { acquireCount: { r: 2 } } } protocol:op_msg 248ms\",\n \"Mon Apr 20 10:27:38.171 I COMMAND [conn281] command admin.$cmd command: setFeatureCompatibilityVersion { setFeatureCompatibilityVersion: \\\"4.0\\\", $db: \\\"admin\\\" } numYields:0 reslen:288 locks:{ Global: { acquireCount: { r: 5, w: 4, R: 1 } }, Database: { acquireCount: { w: 2, W: 2 } }, Collection: { acquireCount: { w: 2 } }, Mutex: { acquireCount: { W: 1 } }, oplog: { acquireCount: { w: 2 } } } protocol:op_msg 212ms\",\n \"Mon Apr 20 10:26:27.924 I COMMAND [conn111] command local.system.replset command: replSetReconfig { replSetReconfig: { _id: \\\"cmgo-a3bm93hf_2\\\", version: 3, protocolVersion: 1, members: [ { _id: 1, host: \\\"10.112.90.165:7002\\\", arbiterOnly: false, buildIndexes: true, hidden: false, priority: 1.0, slaveDelay: 0, votes: 1 }, { _id: 2, host: \\\"10.53.80.6:7012\\\", arbiterOnly: false, buildIndexes: true, hidden: false, priority: 1.0, slaveDelay: 0, votes: 1 }, { _id: 3, host: \\\"100.93.44.26:7013\\\" } ], settings: { chainingAllowed: true, heartbeatIntervalMillis: 2000, heartbeatTimeoutSecs: 10, electionTimeoutMillis: 10000, catchUpTimeoutMillis: -1, catchUpTakeoverDelayMillis: 30000, getLastErrorDefaults: { w: 1, wtimeout: 0 }, replicaSetId: ObjectId('5e9d0841f0f688fc992fd087') } }, $db: \\\"admin\\\" } numYields:0 reslen:60 locks:{ Global: { acquireCount: { r: 3, w: 2, W: 1 } }, Database: { acquireCount: { w: 1, W: 1 } }, oplog: { acquireCount: { w: 1 } } } protocol:op_query 212ms\",\n \"Mon Apr 20 13:55:15.051 I COMMAND [conn586] command admin.$cmd command: _flushRoutingTableCacheUpdates { forceRoutingTableRefresh: \\\"config.system.sessions\\\", maxTimeMS: 30000, $clusterTime: { clusterTime: Timestamp(1587362114, 1), signature: { hash: BinData(0, 259955995BDC7E0CA35C4276EB23341C03910A48), keyId: 6817613949303783443 } }, $configServerState: { opTime: { ts: Timestamp(1587362085, 6), t: 1 } }, $db: \\\"admin\\\" } numYields:0 reslen:288 locks:{ Global: { acquireCount: { r: 4 } }, Database: { acquireCount: { r: 2 } }, Collection: { acquireCount: { r: 2 } } } protocol:op_msg 192ms\",\n \"Mon Apr 20 10:27:39.400 I COMMAND [conn213] command admin.$cmd command: setFeatureCompatibilityVersion { setFeatureCompatibilityVersion: \\\"4.0\\\", $db: \\\"admin\\\" } numYields:0 reslen:288 locks:{ Global: { acquireCount: { r: 5, w: 4, R: 1 } }, Database: { acquireCount: { w: 2, W: 2 } }, Collection: { acquireCount: { w: 2 } }, Mutex: { acquireCount: { W: 1 } }, oplog: { acquireCount: { w: 2 } } } protocol:op_msg 183ms\",\n \"Mon Apr 20 10:26:09.357 I COMMAND [conn36] command local.system.replset command: replSetInitiate { replSetInitiate: { _id: \\\"cmgo-a3bm93hf_2\\\", version: 1, members: [ { _id: 1, host: \\\"10.112.90.165:7002\\\" } ] }, $readPreference: { mode: \\\"secondaryPreferred\\\" }, $db: \\\"admin\\\" } numYields:0 reslen:60 locks:{ Global: { acquireCount: { r: 23, w: 7, W: 2 }, acquireWaitCount: { W: 1 }, timeAcquiringMicros: { W: 59 } }, Database: { acquireCount: { r: 7, w: 4, W: 3 } }, Collection: { acquireCount: { r: 3, w: 2 } }, oplog: { acquireCount: { r: 2, w: 3 } } } protocol:op_query 134ms\",\n \"Mon Apr 20 13:00:16.363 I COMMAND [conn16903] command admin.$cmd command: _flushRoutingTableCacheUpdates { forceRoutingTableRefresh: \\\"config.system.sessions\\\", maxTimeMS: 30000, $clusterTime: { clusterTime: Timestamp(1587358814, 1), signature: { hash: BinData(0, 90BD7BB9B481B9825527D89A3579B52E6C0C3915), keyId: 6817613949303783443 } }, $configServerState: { opTime: { ts: Timestamp(1587358809, 2), t: 1 } }, $db: \\\"admin\\\" } numYields:0 reslen:288 locks:{ Global: { acquireCount: { r: 4 } }, Database: { acquireCount: { r: 2 } }, Collection: { acquireCount: { r: 2 } } } protocol:op_msg 123ms\",\n \"Mon Apr 20 13:35:14.983 I COMMAND [conn586] command admin.$cmd command: _flushRoutingTableCacheUpdates { forceRoutingTableRefresh: \\\"config.system.sessions\\\", maxTimeMS: 30000, $clusterTime: { clusterTime: Timestamp(1587360912, 1), signature: { hash: BinData(0, 06A84575A66B9316D1ECBFB9FB1C7B2F605AB3A8), keyId: 6817613949303783443 } }, $configServerState: { opTime: { ts: Timestamp(1587360909, 5), t: 1 } }, $db: \\\"admin\\\" } numYields:0 reslen:288 locks:{ Global: { acquireCount: { r: 4 } }, Database: { acquireCount: { r: 2 } }, Collection: { acquireCount: { r: 2 } } } protocol:op_msg 122ms\",\n \"Mon Apr 20 10:24:43.760 I COMMAND [conn16] command local.system.replset command: replSetInitiate { replSetInitiate: { _id: \\\"cmgo-a3bm93hf_0\\\", version: 1, members: [ { _id: 1, host: \\\"10.53.80.6:7011\\\" } ] }, $readPreference: { mode: \\\"secondaryPreferred\\\" }, $db: \\\"admin\\\" } numYields:0 reslen:60 locks:{ Global: { acquireCount: { r: 23, w: 7, W: 2 }, acquireWaitCount: { W: 1 }, timeAcquiringMicros: { W: 39 } }, Database: { acquireCount: { r: 7, w: 4, W: 3 } }, Collection: { acquireCount: { r: 3, w: 2 } }, oplog: { acquireCount: { r: 2, w: 3 } } } protocol:op_query 112ms\",\n \"Mon Apr 20 10:25:26.300 I COMMAND [conn15] command local.system.replset command: replSetInitiate { replSetInitiate: { _id: \\\"cmgo-a3bm93hf_1\\\", version: 1, members: [ { _id: 1, host: \\\"100.93.44.85:7005\\\" } ] }, $readPreference: { mode: \\\"secondaryPreferred\\\" }, $db: \\\"admin\\\" } numYields:0 reslen:60 locks:{ Global: { acquireCount: { r: 23, w: 7, W: 2 }, acquireWaitCount: { W: 1 }, timeAcquiringMicros: { W: 24 } }, Database: { acquireCount: { r: 7, w: 4, W: 3 }, acquireWaitCount: { W: 1 }, timeAcquiringMicros: { W: 7 } }, Collection: { acquireCount: { r: 3, w: 2 } }, oplog: { acquireCount: { r: 2, w: 3 } } } protocol:op_query 110ms\",\n \"Mon Apr 20 10:27:39.400 I COMMAND [conn213] command admin.$cmd command: update { update: \\\"system.version\\\", writeConcern: { w: \\\"majority\\\" }, $db: \\\"admin\\\" } numYields:0 reslen:370 locks:{ Global: { acquireCount: { r: 5, w: 4, R: 1 } }, Database: { acquireCount: { w: 2, W: 2 } }, Collection: { acquireCount: { w: 2 } }, Mutex: { acquireCount: { W: 1 } }, oplog: { acquireCount: { w: 2 } } } protocol:op_msg 107ms\",\n \"Mon Apr 20 10:27:38.065 I COMMAND [conn281] command admin.$cmd command: update { update: \\\"system.version\\\", writeConcern: { w: \\\"majority\\\" }, $db: \\\"admin\\\" } numYields:0 reslen:370 locks:{ Global: { acquireCount: { r: 2, w: 2 } }, Database: { acquireCount: { w: 1, W: 1 } }, Collection: { acquireCount: { w: 1 } }, Mutex: { acquireCount: { W: 1 } }, oplog: { acquireCount: { w: 1 } } } protocol:op_msg 107ms\",\n \"Mon Apr 20 10:27:38.170 I COMMAND [conn281] command admin.$cmd command: update { update: \\\"system.version\\\", writeConcern: { w: \\\"majority\\\" }, $db: \\\"admin\\\" } numYields:0 reslen:370 locks:{ Global: { acquireCount: { r: 5, w: 4, R: 1 } }, Database: { acquireCount: { w: 2, W: 2 } }, Collection: { acquireCount: { w: 2 } }, Mutex: { acquireCount: { W: 1 } }, oplog: { acquireCount: { w: 2 } } } protocol:op_msg 105ms\"\n ]\n }\n}",
140
+ "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeSlowLogs\n<Common request parameters>\n\n{\n \"InstanceId\": \"cmgo-r3p8****\",\n \"StartTime\": \"2025-09-22 00:00:00\",\n \"EndTime\": \"2025-09-23 00:00:00\",\n \"SlowMS\": 100,\n \"Offset\": 1,\n \"Limit\": 1,\n \"Format\": \"json\"\n}",
141
+ "output": "{\n \"Response\": {\n \"Count\": 1,\n \"RequestId\": \"ec514cb8-55a6-41d4-a6e4-896da43886db\",\n \"SlowLogs\": [\n \"Mon Sep 22 20:30:19.980 I COMMAND [conn3725696] command admin.$cmd command: ****Continue { ****Continue: 1, conversationId: 1, payload: BinData(0, ), $clusterTime: { clusterTime: Timestamp(1758544211, 1), signature: { hash: BinData(0, *************************************), keyId: 7542889************ } }, $db: \\\"admin\\\", $readPreference: { mode: \\\"primaryPreferred\\\" } } numYields:0 reslen:204 locks:{} protocol:op_msg 184ms\"\n ]\n }\n}",
134
142
  "title": "Obtaining the Slow Log Information on an Instance"
135
143
  }
136
144
  ],
@@ -185,7 +193,7 @@
185
193
  "ModifyDBInstanceNetworkAddress": [
186
194
  {
187
195
  "document": "This example shows you how to modify the VIP information on a TencentDB for MongoDB instance.",
188
- "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyDBInstanceNetworkAddress\n<Common request parameters>\n\n{\n \"InstanceId\": \"cmgo-9d0p****\",\n \"OldIpExpiredTime\": 1,\n \"NetworkAddresses\": [\n {\n \"NewIPAddress\": \"10.0.0.10\",\n \"OldIpAddress\": \"10.0.0.1\"\n }\n ],\n \"NewUniqVpcId\": \"vpc-gfb3pqo1\",\n \"NewUniqSubnetId\": \"ins-wsdn61fw\"\n}",
196
+ "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyDBInstanceNetworkAddress\n<Common request parameters>\n\n{\n \"InstanceId\": \"cmgo-9d0p****\",\n \"OldIpExpiredTime\": 1,\n \"NetworkAddresses\": [\n {\n \"NewIPAddress\": \"10.0.0.10\",\n \"OldIpAddress\": \"10.0.0.1\"\n }\n ],\n \"NewUniqVpcId\": \"vpc-gfb3****\",\n \"NewUniqSubnetId\": \"subnet-6fe2****\"\n}",
189
197
  "output": "{\n \"Response\": {\n \"FlowId\": 1679402995,\n \"RequestId\": \"8279f6c2-db93-4b2e-931b-233d780b1a91\"\n }\n}",
190
198
  "title": "Modifying the Network Information on a TencentDB for MongoDB Instance"
191
199
  }
@@ -193,7 +201,7 @@
193
201
  "ModifyDBInstanceSecurityGroup": [
194
202
  {
195
203
  "document": "This example shows you how to modify the inbound rules of security groups for a specified instance.",
196
- "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyDBInstanceSecurityGroup\n<Common request parameters>\n\n{\n \"InstanceId\": \"cmgo-14i5dgtl'\",\n \"SecurityGroupIds\": [\n \"sg-l7ipccjl\"\n ]\n}",
204
+ "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyDBInstanceSecurityGroup\n<Common request parameters>\n\n{\n \"InstanceId\": \"cmgo-14i5****'\",\n \"SecurityGroupIds\": [\n \"sg-l7ip****\"\n ]\n}",
197
205
  "output": "{\n \"Response\": {\n \"RequestId\": \"bc59fa05-d429-4bcf-863f-1f6f99295485\"\n }\n}",
198
206
  "title": "Modifying the Security Group Information on an Instance"
199
207
  }
@@ -213,7 +221,7 @@
213
221
  },
214
222
  {
215
223
  "document": "This example shows you how to add 2 secondary nodes in total to Guangzhou Zone 2 and Zone 3. The final number of nodes changes to 5.",
216
- "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyDBInstanceSpec\n<Common request parameters>\n\n{\n \"InstanceId\": \"cmgo-abcdef\",\n \"Memory\": 4,\n \"Volume\": 100,\n \"OplogSize\": 30,\n \"NodeNum\": 5,\n \"ReplicateSetNum\": 1,\n \"InMaintenance\": 1,\n \"AddNodeList\": [\n {\n \"Role\": \"SECONDARY\",\n \"Zone\": \"ap-guangzhou-2\"\n },\n {\n \"Role\": \"SECONDARY\",\n \"Zone\": \"ap-guangzhou-3\"\n }\n ]\n}",
224
+ "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ModifyDBInstanceSpec\n<Common request parameters>\n\n{\n \"InstanceId\": \"cmgo-p8vn****\",\n \"Memory\": 4,\n \"Volume\": 100,\n \"OplogSize\": 30,\n \"NodeNum\": 5,\n \"ReplicateSetNum\": 1,\n \"InMaintenance\": 1,\n \"AddNodeList\": [\n {\n \"Role\": \"SECONDARY\",\n \"Zone\": \"ap-guangzhou-2\"\n },\n {\n \"Role\": \"SECONDARY\",\n \"Zone\": \"ap-guangzhou-3\"\n }\n ]\n}",
217
225
  "output": "{\n \"Response\": {\n \"DealId\": \"7142863\",\n \"RequestId\": \"d88095e5-50e8-4245-a0cf-993a536f9b20\"\n }\n}",
218
226
  "title": "Adding Secondary Nodes to a TencentDB for MongoDB Instance"
219
227
  }
@@ -244,10 +252,26 @@
244
252
  ],
245
253
  "ResetDBInstancePassword": [
246
254
  {
247
- "document": " ",
248
- "input": "https://mongodb.tencentcloudapi.com/?Action=ResetDBInstancePassword\n&InstanceId=cmgo-7pjedvz7\n&UserName=rwuser\n&Password=111111\n&<Common request parameters>",
255
+ "document": "This example shows you how to change the password of the user accessing the instance.",
256
+ "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: ResetDBInstancePassword\n<Common request parameters>\n\n{\n \"InstanceId\": \"cmgo-7pje****\",\n \"UserName\": \"rwuser\",\n \"Password\": \"*******\"\n}",
249
257
  "output": "{\n \"Response\": {\n \"AsyncRequestId\": \"4769\",\n \"RequestId\": \"e600a8d0-9014-11ea-84c1-01cccde830c6\"\n }\n}",
250
- "title": "Modifying the instance password"
258
+ "title": "Changing the Password of the User Accessing the Instance"
259
+ }
260
+ ],
261
+ "SetDBInstanceDeletionProtection": [
262
+ {
263
+ "document": "",
264
+ "input": "https://mongodb.tencentcloudapi.com/?Action=SetDBInstanceDeletionProtection\n&InstanceIds.0=cmgo-8l3r6yyt\n&EnableDeletionProtection=1\n&<Common request parameters>",
265
+ "output": "{\n \"Response\": {\n \"RequestId\": \"1d0d55f9-15ee-4f00-b460-7b645a62cc3a\"\n }\n}",
266
+ "title": "Setting Instance Termination Protection"
267
+ }
268
+ ],
269
+ "TerminateDBInstances": [
270
+ {
271
+ "document": "",
272
+ "input": "POST / HTTP/1.1\nHost: mongodb.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: TerminateDBInstances\n<Common request parameters>\n\n{\n \"InstanceId\": \"cmgo-7pje****\"\n}",
273
+ "output": "{\n \"Response\": {\n \"RequestId\": \"ccfe11c0-b1d3-11ea-8b51-552abe435100\"\n }\n}",
274
+ "title": "Return and Refund for Monthly Subscription Instance"
251
275
  }
252
276
  ]
253
277
  },
@@ -329,6 +329,58 @@ def doModifyPrometheusAlertPolicy(args, parsed_globals):
329
329
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
330
330
 
331
331
 
332
+ def doDescribePrometheusAlertGroups(args, parsed_globals):
333
+ g_param = parse_global_arg(parsed_globals)
334
+
335
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
336
+ cred = credential.CVMRoleCredential()
337
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
338
+ cred = credential.STSAssumeRoleCredential(
339
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
340
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
341
+ )
342
+ 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):
343
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
344
+ else:
345
+ cred = credential.Credential(
346
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
347
+ )
348
+ http_profile = HttpProfile(
349
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
350
+ reqMethod="POST",
351
+ endpoint=g_param[OptionsDefine.Endpoint],
352
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
353
+ )
354
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
355
+ if g_param[OptionsDefine.Language]:
356
+ profile.language = g_param[OptionsDefine.Language]
357
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
358
+ client = mod.MonitorClient(cred, g_param[OptionsDefine.Region], profile)
359
+ client._sdkVersion += ("_CLI_" + __version__)
360
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
361
+ model = models.DescribePrometheusAlertGroupsRequest()
362
+ model.from_json_string(json.dumps(args))
363
+ start_time = time.time()
364
+ while True:
365
+ rsp = client.DescribePrometheusAlertGroups(model)
366
+ result = rsp.to_json_string()
367
+ try:
368
+ json_obj = json.loads(result)
369
+ except TypeError as e:
370
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
371
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
372
+ break
373
+ cur_time = time.time()
374
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
375
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
376
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
377
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
378
+ else:
379
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
380
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
381
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
382
+
383
+
332
384
  def doDescribePrometheusInstanceUsage(args, parsed_globals):
333
385
  g_param = parse_global_arg(parsed_globals)
334
386
 
@@ -485,6 +537,110 @@ def doBindingPolicyObject(args, parsed_globals):
485
537
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
486
538
 
487
539
 
540
+ def doDeletePrometheusAlertGroups(args, parsed_globals):
541
+ g_param = parse_global_arg(parsed_globals)
542
+
543
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
544
+ cred = credential.CVMRoleCredential()
545
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
546
+ cred = credential.STSAssumeRoleCredential(
547
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
548
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
549
+ )
550
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
551
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
552
+ else:
553
+ cred = credential.Credential(
554
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
555
+ )
556
+ http_profile = HttpProfile(
557
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
558
+ reqMethod="POST",
559
+ endpoint=g_param[OptionsDefine.Endpoint],
560
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
561
+ )
562
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
563
+ if g_param[OptionsDefine.Language]:
564
+ profile.language = g_param[OptionsDefine.Language]
565
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
566
+ client = mod.MonitorClient(cred, g_param[OptionsDefine.Region], profile)
567
+ client._sdkVersion += ("_CLI_" + __version__)
568
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
569
+ model = models.DeletePrometheusAlertGroupsRequest()
570
+ model.from_json_string(json.dumps(args))
571
+ start_time = time.time()
572
+ while True:
573
+ rsp = client.DeletePrometheusAlertGroups(model)
574
+ result = rsp.to_json_string()
575
+ try:
576
+ json_obj = json.loads(result)
577
+ except TypeError as e:
578
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
579
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
580
+ break
581
+ cur_time = time.time()
582
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
583
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
584
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
585
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
586
+ else:
587
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
588
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
589
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
590
+
591
+
592
+ def doDescribePolicyGroupInfo(args, parsed_globals):
593
+ g_param = parse_global_arg(parsed_globals)
594
+
595
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
596
+ cred = credential.CVMRoleCredential()
597
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
598
+ cred = credential.STSAssumeRoleCredential(
599
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
600
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
601
+ )
602
+ elif os.getenv(OptionsDefine.ENV_TKE_REGION) and os.getenv(OptionsDefine.ENV_TKE_PROVIDER_ID) and os.getenv(OptionsDefine.ENV_TKE_WEB_IDENTITY_TOKEN_FILE) and os.getenv(OptionsDefine.ENV_TKE_ROLE_ARN):
603
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
604
+ else:
605
+ cred = credential.Credential(
606
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
607
+ )
608
+ http_profile = HttpProfile(
609
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
610
+ reqMethod="POST",
611
+ endpoint=g_param[OptionsDefine.Endpoint],
612
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
613
+ )
614
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
615
+ if g_param[OptionsDefine.Language]:
616
+ profile.language = g_param[OptionsDefine.Language]
617
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
618
+ client = mod.MonitorClient(cred, g_param[OptionsDefine.Region], profile)
619
+ client._sdkVersion += ("_CLI_" + __version__)
620
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
621
+ model = models.DescribePolicyGroupInfoRequest()
622
+ model.from_json_string(json.dumps(args))
623
+ start_time = time.time()
624
+ while True:
625
+ rsp = client.DescribePolicyGroupInfo(model)
626
+ result = rsp.to_json_string()
627
+ try:
628
+ json_obj = json.loads(result)
629
+ except TypeError as e:
630
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
631
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
632
+ break
633
+ cur_time = time.time()
634
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
635
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
636
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
637
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
638
+ else:
639
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
640
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
641
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
642
+
643
+
488
644
  def doCreateGrafanaInstance(args, parsed_globals):
489
645
  g_param = parse_global_arg(parsed_globals)
490
646
 
@@ -4489,7 +4645,7 @@ def doDescribeDNSConfig(args, parsed_globals):
4489
4645
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4490
4646
 
4491
4647
 
4492
- def doModifyPrometheusGlobalNotification(args, parsed_globals):
4648
+ def doCreatePrometheusAlertGroup(args, parsed_globals):
4493
4649
  g_param = parse_global_arg(parsed_globals)
4494
4650
 
4495
4651
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -4518,11 +4674,63 @@ def doModifyPrometheusGlobalNotification(args, parsed_globals):
4518
4674
  client = mod.MonitorClient(cred, g_param[OptionsDefine.Region], profile)
4519
4675
  client._sdkVersion += ("_CLI_" + __version__)
4520
4676
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
4521
- model = models.ModifyPrometheusGlobalNotificationRequest()
4677
+ model = models.CreatePrometheusAlertGroupRequest()
4522
4678
  model.from_json_string(json.dumps(args))
4523
4679
  start_time = time.time()
4524
4680
  while True:
4525
- rsp = client.ModifyPrometheusGlobalNotification(model)
4681
+ rsp = client.CreatePrometheusAlertGroup(model)
4682
+ result = rsp.to_json_string()
4683
+ try:
4684
+ json_obj = json.loads(result)
4685
+ except TypeError as e:
4686
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
4687
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
4688
+ break
4689
+ cur_time = time.time()
4690
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
4691
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
4692
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
4693
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
4694
+ else:
4695
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
4696
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
4697
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4698
+
4699
+
4700
+ def doUpdatePrometheusAlertGroupState(args, parsed_globals):
4701
+ g_param = parse_global_arg(parsed_globals)
4702
+
4703
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
4704
+ cred = credential.CVMRoleCredential()
4705
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
4706
+ cred = credential.STSAssumeRoleCredential(
4707
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
4708
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
4709
+ )
4710
+ 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):
4711
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
4712
+ else:
4713
+ cred = credential.Credential(
4714
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
4715
+ )
4716
+ http_profile = HttpProfile(
4717
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
4718
+ reqMethod="POST",
4719
+ endpoint=g_param[OptionsDefine.Endpoint],
4720
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
4721
+ )
4722
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
4723
+ if g_param[OptionsDefine.Language]:
4724
+ profile.language = g_param[OptionsDefine.Language]
4725
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
4726
+ client = mod.MonitorClient(cred, g_param[OptionsDefine.Region], profile)
4727
+ client._sdkVersion += ("_CLI_" + __version__)
4728
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
4729
+ model = models.UpdatePrometheusAlertGroupStateRequest()
4730
+ model.from_json_string(json.dumps(args))
4731
+ start_time = time.time()
4732
+ while True:
4733
+ rsp = client.UpdatePrometheusAlertGroupState(model)
4526
4734
  result = rsp.to_json_string()
4527
4735
  try:
4528
4736
  json_obj = json.loads(result)
@@ -4853,6 +5061,58 @@ def doUpdateGrafanaConfig(args, parsed_globals):
4853
5061
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
4854
5062
 
4855
5063
 
5064
+ def doUpdatePrometheusAlertGroup(args, parsed_globals):
5065
+ g_param = parse_global_arg(parsed_globals)
5066
+
5067
+ if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
5068
+ cred = credential.CVMRoleCredential()
5069
+ elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
5070
+ cred = credential.STSAssumeRoleCredential(
5071
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
5072
+ g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
5073
+ )
5074
+ 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):
5075
+ cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
5076
+ else:
5077
+ cred = credential.Credential(
5078
+ g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
5079
+ )
5080
+ http_profile = HttpProfile(
5081
+ reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
5082
+ reqMethod="POST",
5083
+ endpoint=g_param[OptionsDefine.Endpoint],
5084
+ proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
5085
+ )
5086
+ profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
5087
+ if g_param[OptionsDefine.Language]:
5088
+ profile.language = g_param[OptionsDefine.Language]
5089
+ mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
5090
+ client = mod.MonitorClient(cred, g_param[OptionsDefine.Region], profile)
5091
+ client._sdkVersion += ("_CLI_" + __version__)
5092
+ models = MODELS_MAP[g_param[OptionsDefine.Version]]
5093
+ model = models.UpdatePrometheusAlertGroupRequest()
5094
+ model.from_json_string(json.dumps(args))
5095
+ start_time = time.time()
5096
+ while True:
5097
+ rsp = client.UpdatePrometheusAlertGroup(model)
5098
+ result = rsp.to_json_string()
5099
+ try:
5100
+ json_obj = json.loads(result)
5101
+ except TypeError as e:
5102
+ json_obj = json.loads(result.decode('utf-8')) # python3.3
5103
+ if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
5104
+ break
5105
+ cur_time = time.time()
5106
+ if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
5107
+ raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
5108
+ (g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
5109
+ search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
5110
+ else:
5111
+ print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
5112
+ time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
5113
+ FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
5114
+
5115
+
4856
5116
  def doDescribeGrafanaNotificationChannels(args, parsed_globals):
4857
5117
  g_param = parse_global_arg(parsed_globals)
4858
5118
 
@@ -6517,7 +6777,7 @@ def doDescribePrometheusConfig(args, parsed_globals):
6517
6777
  FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
6518
6778
 
6519
6779
 
6520
- def doDescribePolicyGroupInfo(args, parsed_globals):
6780
+ def doModifyPrometheusGlobalNotification(args, parsed_globals):
6521
6781
  g_param = parse_global_arg(parsed_globals)
6522
6782
 
6523
6783
  if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
@@ -6546,11 +6806,11 @@ def doDescribePolicyGroupInfo(args, parsed_globals):
6546
6806
  client = mod.MonitorClient(cred, g_param[OptionsDefine.Region], profile)
6547
6807
  client._sdkVersion += ("_CLI_" + __version__)
6548
6808
  models = MODELS_MAP[g_param[OptionsDefine.Version]]
6549
- model = models.DescribePolicyGroupInfoRequest()
6809
+ model = models.ModifyPrometheusGlobalNotificationRequest()
6550
6810
  model.from_json_string(json.dumps(args))
6551
6811
  start_time = time.time()
6552
6812
  while True:
6553
- rsp = client.DescribePolicyGroupInfo(model)
6813
+ rsp = client.ModifyPrometheusGlobalNotification(model)
6554
6814
  result = rsp.to_json_string()
6555
6815
  try:
6556
6816
  json_obj = json.loads(result)
@@ -7522,9 +7782,12 @@ ACTION_MAP = {
7522
7782
  "DescribeBindingPolicyObjectList": doDescribeBindingPolicyObjectList,
7523
7783
  "UpdateAlertRule": doUpdateAlertRule,
7524
7784
  "ModifyPrometheusAlertPolicy": doModifyPrometheusAlertPolicy,
7785
+ "DescribePrometheusAlertGroups": doDescribePrometheusAlertGroups,
7525
7786
  "DescribePrometheusInstanceUsage": doDescribePrometheusInstanceUsage,
7526
7787
  "ModifyAlarmReceivers": doModifyAlarmReceivers,
7527
7788
  "BindingPolicyObject": doBindingPolicyObject,
7789
+ "DeletePrometheusAlertGroups": doDeletePrometheusAlertGroups,
7790
+ "DescribePolicyGroupInfo": doDescribePolicyGroupInfo,
7528
7791
  "CreateGrafanaInstance": doCreateGrafanaInstance,
7529
7792
  "DescribeBasicAlarmList": doDescribeBasicAlarmList,
7530
7793
  "DescribePrometheusRecordRuleYaml": doDescribePrometheusRecordRuleYaml,
@@ -7602,13 +7865,15 @@ ACTION_MAP = {
7602
7865
  "UpgradeGrafanaDashboard": doUpgradeGrafanaDashboard,
7603
7866
  "DescribeAlarmNotices": doDescribeAlarmNotices,
7604
7867
  "DescribeDNSConfig": doDescribeDNSConfig,
7605
- "ModifyPrometheusGlobalNotification": doModifyPrometheusGlobalNotification,
7868
+ "CreatePrometheusAlertGroup": doCreatePrometheusAlertGroup,
7869
+ "UpdatePrometheusAlertGroupState": doUpdatePrometheusAlertGroupState,
7606
7870
  "DescribePrometheusAgentInstances": doDescribePrometheusAgentInstances,
7607
7871
  "DeletePrometheusRecordRuleYaml": doDeletePrometheusRecordRuleYaml,
7608
7872
  "DescribePrometheusInstances": doDescribePrometheusInstances,
7609
7873
  "DescribeGrafanaInstances": doDescribeGrafanaInstances,
7610
7874
  "ModifyPrometheusRecordRuleYaml": doModifyPrometheusRecordRuleYaml,
7611
7875
  "UpdateGrafanaConfig": doUpdateGrafanaConfig,
7876
+ "UpdatePrometheusAlertGroup": doUpdatePrometheusAlertGroup,
7612
7877
  "DescribeGrafanaNotificationChannels": doDescribeGrafanaNotificationChannels,
7613
7878
  "ModifyPrometheusAgentExternalLabels": doModifyPrometheusAgentExternalLabels,
7614
7879
  "ModifyPolicyGroup": doModifyPolicyGroup,
@@ -7641,7 +7906,7 @@ ACTION_MAP = {
7641
7906
  "DescribeServiceDiscovery": doDescribeServiceDiscovery,
7642
7907
  "RunPrometheusInstance": doRunPrometheusInstance,
7643
7908
  "DescribePrometheusConfig": doDescribePrometheusConfig,
7644
- "DescribePolicyGroupInfo": doDescribePolicyGroupInfo,
7909
+ "ModifyPrometheusGlobalNotification": doModifyPrometheusGlobalNotification,
7645
7910
  "UpdateExporterIntegration": doUpdateExporterIntegration,
7646
7911
  "DescribeAllNamespaces": doDescribeAllNamespaces,
7647
7912
  "CreateServiceDiscovery": doCreateServiceDiscovery,