tccli 3.0.1159.1__py2.py3-none-any.whl → 3.0.1161.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/aiart/v20221229/api.json +12 -15
- tccli/services/apm/v20210622/api.json +9 -0
- tccli/services/cdb/v20170320/api.json +3 -1
- tccli/services/cdwdoris/cdwdoris_client.py +1056 -49
- tccli/services/cdwdoris/v20211228/api.json +3192 -1014
- tccli/services/cdwdoris/v20211228/examples.json +152 -0
- tccli/services/cfg/cfg_client.py +224 -12
- tccli/services/cfg/v20210820/api.json +897 -32
- tccli/services/cfg/v20210820/examples.json +32 -0
- tccli/services/cfw/v20190904/api.json +12 -2
- tccli/services/cls/v20201016/api.json +11 -1
- tccli/services/cme/v20191029/api.json +9 -9
- tccli/services/cme/v20191029/examples.json +1 -1
- tccli/services/csip/csip_client.py +53 -0
- tccli/services/csip/v20221121/api.json +136 -2
- tccli/services/csip/v20221121/examples.json +8 -0
- tccli/services/cwp/v20180228/api.json +66 -46
- tccli/services/cwp/v20180228/examples.json +1 -1
- tccli/services/dlc/v20210125/api.json +31 -2
- tccli/services/dnspod/v20210323/api.json +1 -1
- tccli/services/domain/v20180808/api.json +1 -1
- tccli/services/ess/v20201111/api.json +4 -4
- tccli/services/ess/v20201111/examples.json +6 -6
- tccli/services/essbasic/v20210526/api.json +21 -12
- tccli/services/essbasic/v20210526/examples.json +7 -1
- tccli/services/faceid/v20180301/api.json +1 -1
- tccli/services/iotexplorer/v20190423/api.json +25 -25
- tccli/services/iotexplorer/v20190423/examples.json +10 -4
- tccli/services/lcic/lcic_client.py +57 -4
- tccli/services/lcic/v20220817/api.json +52 -0
- tccli/services/lcic/v20220817/examples.json +8 -0
- tccli/services/live/v20180801/api.json +1 -1
- tccli/services/lke/v20231130/api.json +563 -9
- tccli/services/ocr/v20181119/api.json +10 -0
- tccli/services/trro/v20220325/api.json +181 -6
- tccli/services/trro/v20220325/examples.json +3 -3
- tccli/services/trtc/trtc_client.py +53 -0
- tccli/services/trtc/v20190722/api.json +83 -10
- tccli/services/trtc/v20190722/examples.json +27 -13
- tccli/services/tsf/v20180326/api.json +8 -7
- tccli/services/tsf/v20180326/examples.json +1 -1
- tccli/services/vclm/v20240523/api.json +137 -1
- tccli/services/vclm/v20240523/examples.json +46 -0
- tccli/services/vclm/vclm_client.py +106 -0
- tccli/services/vpc/v20170312/api.json +1 -1
- tccli/services/vtc/v20240223/api.json +1 -1
- {tccli-3.0.1159.1.dist-info → tccli-3.0.1161.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1159.1.dist-info → tccli-3.0.1161.1.dist-info}/RECORD +52 -52
- {tccli-3.0.1159.1.dist-info → tccli-3.0.1161.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1159.1.dist-info → tccli-3.0.1161.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1159.1.dist-info → tccli-3.0.1161.1.dist-info}/license_files/LICENSE +0 -0
@@ -1,5 +1,13 @@
|
|
1
1
|
{
|
2
2
|
"actions": {
|
3
|
+
"CreateTaskFromAction": [
|
4
|
+
{
|
5
|
+
"document": "",
|
6
|
+
"input": "POST / HTTP/1.1\nHost: cfg.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: CreateTaskFromAction\n<公共请求参数>\n\n\n\n\n{\n\t\"TaskActionId\": 127,\n\t\"TaskInstances\": [\n\t\t\"ins-87bfr32q\"\n\t]\n\n}",
|
7
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"f0aee8ac-2ed3-4a7f-a25b-f0d7d228dd30\",\n \"TaskId\": 50\n }\n}",
|
8
|
+
"title": "从动作创建演练"
|
9
|
+
}
|
10
|
+
],
|
3
11
|
"CreateTaskFromTemplate": [
|
4
12
|
{
|
5
13
|
"document": "通过预创建好的经验模板生成常规化的演练持续使用",
|
@@ -16,6 +24,30 @@
|
|
16
24
|
"title": "删除任务"
|
17
25
|
}
|
18
26
|
],
|
27
|
+
"DescribeActionFieldConfigList": [
|
28
|
+
{
|
29
|
+
"document": "",
|
30
|
+
"input": "POST / HTTP/1.1\nHost: cfg.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeActionFieldConfigList\n<公共请求参数>\n\n{\n \"ObjectTypeId\": \"1\",\n \"ActionIds\": [\n \"1\"\n ]\n}",
|
31
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"f3433a9a-e8fd-40b9-88e7-dd8b3f1a181f\",\n \"Common\": [\n {\n \"ActionId\": 1,\n \"ActionName\": \"关机\",\n \"ConfigDetail\": [\n {\n \"Type\": \"input\",\n \"Lable\": \"动作别名\",\n \"Field\": \"AliasTitle\",\n \"DefaultValue\": \"\",\n \"Config\": \"{}\",\n \"Required\": 0,\n \"Validate\": \"{}\",\n \"Visible\": \"{}\"\n },\n {\n \"Type\": \"number\",\n \"Lable\": \"前置等待时间(s)\",\n \"Field\": \"PreTimeWait\",\n \"DefaultValue\": \"0\",\n \"Config\": \"{\\\"max\\\": 86400, \\\"min\\\": 0, \\\"tooltip\\\": \\\"仅限用于自动推进模式\\\"}\",\n \"Required\": 1,\n \"Validate\": \"{}\",\n \"Visible\": \"{}\"\n },\n {\n \"Type\": \"number\",\n \"Lable\": \"后置等待时间(s)\",\n \"Field\": \"AfterTimeWait\",\n \"DefaultValue\": \"0\",\n \"Config\": \"{\\\"max\\\": 86400, \\\"min\\\": 0, \\\"tooltip\\\": \\\"仅限用于自动推进模式\\\"}\",\n \"Required\": 1,\n \"Validate\": \"{}\",\n \"Visible\": \"{}\"\n },\n {\n \"Type\": \"number\",\n \"Lable\": \"动作超时时间(s)\",\n \"Field\": \"ActionTimeout\",\n \"DefaultValue\": \"1800\",\n \"Config\": \"{\\\"max\\\": 86400, \\\"min\\\": 0, \\\"tooltip\\\": \\\"动作的超时时间\\\"}\",\n \"Required\": 1,\n \"Validate\": \"{}\",\n \"Visible\": \"{}\"\n }\n ]\n }\n ],\n \"Results\": []\n }\n}",
|
32
|
+
"title": "示例"
|
33
|
+
}
|
34
|
+
],
|
35
|
+
"DescribeActionLibraryList": [
|
36
|
+
{
|
37
|
+
"document": "动作库列表数据查询",
|
38
|
+
"input": "POST / HTTP/1.1\nHost: cfg.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeActionLibraryList\n<公共请求参数>\n\n{\n \"Limit\": 10,\n \"Offset\": 0,\n \"Filters\": [\n {\n \"Keyword\": \"a_type\",\n \"Values\": [\n \"1\"\n ]\n }\n ],\n \"ObjectType\": 1,\n \"Attribute\": [\n 1\n ]\n}",
|
39
|
+
"output": "{\n \"Response\": {\n \"RequestId\": \"cZ6m0xYnnDreBNJm\",\n \"Results\": [\n {\n \"ActionName\": \"关机(测试)\",\n \"Desc\": \"对CVM进行关机操作\",\n \"ActionType\": \"平台\",\n \"CreateTime\": \"2023-07-04 11:20:43\",\n \"Creator\": \"系统\",\n \"UpdateTime\": \"2023-07-04 11:20:43\",\n \"RiskDesc\": \"高风险\",\n \"ActionId\": 1,\n \"AttributeId\": 1,\n \"RelationActionId\": 2,\n \"ActionCommand\": \"调用腾讯云对应产品的API接口\",\n \"ActionContent\": \"调用云api StopInstances\",\n \"ActionCommandType\": 1,\n \"ActionDetail\": \"<p>调用云api <a href=\\\"https://cloud.tencent.com/document/product/213/15743\\\">StopInstances</a>关机</p>\",\n \"ResourceType\": \"服务器资源\",\n \"IsAllowed\": true,\n \"ActionBestCase\": \"https://cloud.tencent.com/document/product/1500/74357\",\n \"ObjectType\": \"CVM\",\n \"MetricIdList\": [\n 614,\n 615\n ]\n },\n {\n \"ActionName\": \"开机\",\n \"Desc\": \"对CVM进行开机操作\",\n \"ActionType\": \"平台\",\n \"CreateTime\": \"2022-11-29 18:08:46\",\n \"Creator\": \"系统\",\n \"UpdateTime\": \"2022-11-29 18:08:46\",\n \"RiskDesc\": \"高风险\",\n \"ActionId\": 2,\n \"AttributeId\": 2,\n \"RelationActionId\": 1,\n \"ActionCommand\": \"调用腾讯云对应产品的API接口\",\n \"ActionContent\": \"调用云api StartInstances\",\n \"ActionCommandType\": 1,\n \"ActionDetail\": \"<p>调用云api <a href=\\\"https://cloud.tencent.com/document/product/213/15735\\\">StartInstances</a>开机</p>\",\n \"ResourceType\": \"服务器资源\",\n \"IsAllowed\": true,\n \"ActionBestCase\": \"\",\n \"ObjectType\": \"CVM\",\n \"MetricIdList\": []\n },\n {\n \"ActionName\": \"重启\",\n \"Desc\": \"重启\",\n \"ActionType\": \"平台\",\n \"CreateTime\": \"2023-05-24 15:33:39\",\n \"Creator\": \"系统\",\n \"UpdateTime\": \"2023-05-24 15:33:39\",\n \"RiskDesc\": \"高风险\",\n \"ActionId\": 3,\n \"AttributeId\": 1,\n \"RelationActionId\": 0,\n \"ActionCommand\": \"调用腾讯云对应产品的API接口\",\n \"ActionContent\": \"调用云api RebootInstances\",\n \"ActionCommandType\": 1,\n \"ActionDetail\": \"<p>调用云api <a href=\\\"https://cloud.tencent.com/document/product/213/15742\\\">RebootInstances</a>重启</p>\",\n \"ResourceType\": \"服务器资源\",\n \"IsAllowed\": true,\n \"ActionBestCase\": \"https://tcloud4api.woa.com/document/product/1607/88863?!preview&!document=1\",\n \"ObjectType\": \"CVM\",\n \"MetricIdList\": []\n },\n {\n \"ActionName\": \"CPU利用率高\",\n \"Desc\": \"使用stress-ng压测工具压测,支持的linux发行版:Centos7.2及以上,CoreOS 1745.5.0及以上,Debian9.0及以上,Ubuntu 16.04.1及以上\",\n \"ActionType\": \"平台\",\n \"CreateTime\": \"2022-11-29 18:08:46\",\n \"Creator\": \"系统\",\n \"UpdateTime\": \"2022-11-29 18:08:46\",\n \"RiskDesc\": \"高风险\",\n \"ActionId\": 4,\n \"AttributeId\": 1,\n \"RelationActionId\": 0,\n \"ActionCommand\": \"#!/bin/bash\\n\\nuser=$(whoami)\\nif [ !$user == 'root' ]\\nthen\\n sudo -i\\nfi\\n\\nfunction command_exists(){\\n if command -v $1 > /dev/null 2>&1; then\\n return 1\\n else\\n return 0\\n fi\\n}\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n\\nos_desc=$(cat /etc/*release)\\n# echo $os_desc\\n\\ndeclare -A os_dic\\nos_dic=([CentOS]=\\\"yum install stress-ng -y\\\" \\\\\\n [CoreOS]=\\\"docker pull alexeiled/stress-ng\\\" \\\\\\n [Debian]=\\\"apt-get install -y stress-ng\\\" \\\\\\n [Ubuntu]=\\\"apt-get install -y stress-ng\\\")\\n\\nos_name='N/A'\\n\\nfor key in $(echo ${!os_dic[*]})\\ndo\\n if [[ $os_desc =~ $key ]]\\n then\\n os_name=$key\\n echo $key\\n fi\\ndone\\n\\nif [ $os_name == 'N/A' ]\\nthen\\n echo \\\"Unsupported Linux distributions\\\"\\n exit 1\\nfi\\n\\n# os_name=$(cat /etc/*release | awk 'NR==1{print($1)}')\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"installing stress-ng...\\\"\\ncommand_exists stress-ng\\n\\nif [[ $? -eq 0 ]]\\nthen\\n ${os_dic[$os_name]}\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Checking the installation status...\\\"\\n command_exists stress-ng\\n if [[ $? -eq 0 && $os_name != 'CoreOS' ]]\\n then\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Fail to install\\\"\\n exit 1\\n else\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\n fi\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\nfi\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"Starting to perform stress test.\\\"\\nif [ $os_name == \\\"CoreOS\\\" ]\\nthen\\n docker run --rm alexeiled/stress-ng -c 0 -l {{percentage}} --timeout {{timeout}}\\nelse\\n stress-ng -c 0 -l {{percentage}} --timeout {{timeout}}\\nfi\\n\\nif [[ !$? -eq 0 ]]\\nthen\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"failed\\\"\\n exit 1\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"completed\\\"\\n exit 0\\nfi\",\n \"ActionContent\": \"#!/bin/bash\\n\\nuser=$(whoami)\\nif [ !$user == 'root' ]\\nthen\\n sudo -i\\nfi\\n\\nfunction command_exists(){\\n if command -v $1 > /dev/null 2>&1; then\\n return 1\\n else\\n return 0\\n fi\\n}\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n\\nos_desc=$(cat /etc/*release)\\n# echo $os_desc\\n\\ndeclare -A os_dic\\nos_dic=([CentOS]=\\\"yum install stress-ng -y\\\" \\\\\\n [CoreOS]=\\\"docker pull alexeiled/stress-ng\\\" \\\\\\n [Debian]=\\\"apt-get install -y stress-ng\\\" \\\\\\n [Ubuntu]=\\\"apt-get install -y stress-ng\\\")\\n\\nos_name='N/A'\\n\\nfor key in $(echo ${!os_dic[*]})\\ndo\\n if [[ $os_desc =~ $key ]]\\n then\\n os_name=$key\\n echo $key\\n fi\\ndone\\n\\nif [ $os_name == 'N/A' ]\\nthen\\n echo \\\"Unsupported Linux distributions\\\"\\n exit 1\\nfi\\n\\n# os_name=$(cat /etc/*release | awk 'NR==1{print($1)}')\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"installing stress-ng...\\\"\\ncommand_exists stress-ng\\n\\nif [[ $? -eq 0 ]]\\nthen\\n ${os_dic[$os_name]}\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Checking the installation status...\\\"\\n command_exists stress-ng\\n if [[ $? -eq 0 && $os_name != 'CoreOS' ]]\\n then\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Fail to install\\\"\\n exit 1\\n else\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\n fi\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\nfi\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"Starting to perform stress test.\\\"\\nif [ $os_name == \\\"CoreOS\\\" ]\\nthen\\n docker run --rm alexeiled/stress-ng -c 0 -l {{percentage}} --timeout {{timeout}}\\nelse\\n stress-ng -c 0 -l {{percentage}} --timeout {{timeout}}\\nfi\\n\\nif [[ !$? -eq 0 ]]\\nthen\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"failed\\\"\\n exit 1\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"completed\\\"\\n exit 0\\nfi\",\n \"ActionCommandType\": 0,\n \"ActionDetail\": \"<p>使用tat通道下发stress-ng命令进行压测</p>\\n<p>命令内容:stress-ng -c 0 -l {{percentage}} --timeout {{timeout}}</p>\\n<p><a href=\\\"https://cloud.tencent.com/document/api/1340/52676\\\">tat官方文档</a></p>\\n<p><a href=\\\"https://wiki.ubuntu.com/Kernel/Reference/stress-ng\\\">stress-ng官方文档</a></p>\\n\",\n \"ResourceType\": \"CPU资源\",\n \"IsAllowed\": true,\n \"ActionBestCase\": \"\",\n \"ObjectType\": \"CVM\",\n \"MetricIdList\": []\n },\n {\n \"ActionName\": \"内存利用率高\",\n \"Desc\": \"使用stress-ng压测工具压测,支持的linux发行版:Centos7.2及以上,CoreOS 1745.5.0及以上,Debian9.0及以上,Ubuntu 16.04.1及以上\",\n \"ActionType\": \"平台\",\n \"CreateTime\": \"2022-11-29 18:08:46\",\n \"Creator\": \"系统\",\n \"UpdateTime\": \"2022-11-29 18:08:46\",\n \"RiskDesc\": \"高风险\",\n \"ActionId\": 7,\n \"AttributeId\": 1,\n \"RelationActionId\": 0,\n \"ActionCommand\": \"#!/bin/bash\\n\\nuser=$(whoami)\\nif [ !$user == 'root' ]\\nthen\\n sudo -i\\nfi\\n\\nfunction command_exists(){\\n if command -v $1 > /dev/null 2>&1; then\\n return 1\\n else\\n return 0\\n fi\\n}\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n\\nos_desc=$(cat /etc/*release)\\n# echo $os_desc\\n\\ndeclare -A os_dic\\nos_dic=([CentOS]=\\\"yum install stress-ng -y\\\" \\\\\\n [CoreOS]=\\\"docker pull alexeiled/stress-ng\\\" \\\\\\n [Debian]=\\\"apt-get install -y stress-ng\\\" \\\\\\n [Ubuntu]=\\\"apt-get install -y stress-ng\\\")\\n\\nos_name='N/A'\\n\\nfor key in $(echo ${!os_dic[*]})\\ndo\\n if [[ $os_desc =~ $key ]]\\n then\\n os_name=$key\\n echo $key\\n fi\\ndone\\n\\nif [ $os_name == 'N/A' ]\\nthen\\n echo \\\"Unsupported Linux distributions\\\"\\n exit 1\\nfi\\n\\n# os_name=$(cat /etc/*release | awk 'NR==1{print($1)}')\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"installing stress-ng...\\\"\\ncommand_exists stress-ng\\n\\nif [[ $? -eq 0 ]]\\nthen\\n ${os_dic[$os_name]}\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Checking the installation status...\\\"\\n command_exists stress-ng\\n if [[ $? -eq 0 && $os_name != 'CoreOS' ]]\\n then\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Fail to install\\\"\\n exit 1\\n else\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\n fi\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\nfi\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"Starting to perform stress test\\\"\\nif [ $os_name == \\\"CoreOS\\\" ]\\nthen\\n docker run --rm alexeiled/stress-ng --vm-bytes $(awk '/MemAvailable/{printf \\\"%d\\\\n\\\", $2 * 0.01*{{percentage}};}' < /proc/meminfo)k --vm-keep -m 1 -t {{timeout}}\\nelse\\n avaliable_mem=$(awk '/^MemAvailable:/{printf \\\"%d\\\\n\\\", $2;}' < /proc/meminfo)\\n free_mem=$(awk '/^MemFree:/{printf \\\"%d\\\\n\\\", $2;}' < /proc/meminfo)\\n buffer=$(awk '/^Buffers:/{printf \\\"%d\\\\n\\\", $2;}' < /proc/meminfo)\\n cache=$(awk '/^Cached:/{printf \\\"%d\\\\n\\\", $2;}' < /proc/meminfo)\\n if [ -n \\\"$avaliable_mem\\\" ]\\n then\\n stress-ng --vm-bytes $[$avaliable_mem*{{percentage}}/100]k --vm-keep -m 1 -t {{timeout}}\\n else\\n stress-ng --vm-bytes $[($free_mem+$buffer+$cache)*{{percentage}}/100]k --vm-keep -m 1 -t {{timeout}}\\n fi\\nfi\\n\\nif [[ !$? -eq 0 ]]\\nthen\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Failed\\\"\\n exit 1\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Completed\\\"\\n exit 0\\nfi\",\n \"ActionContent\": \"#!/bin/bash\\n\\nuser=$(whoami)\\nif [ !$user == 'root' ]\\nthen\\n sudo -i\\nfi\\n\\nfunction command_exists(){\\n if command -v $1 > /dev/null 2>&1; then\\n return 1\\n else\\n return 0\\n fi\\n}\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n\\nos_desc=$(cat /etc/*release)\\n# echo $os_desc\\n\\ndeclare -A os_dic\\nos_dic=([CentOS]=\\\"yum install stress-ng -y\\\" \\\\\\n [CoreOS]=\\\"docker pull alexeiled/stress-ng\\\" \\\\\\n [Debian]=\\\"apt-get install -y stress-ng\\\" \\\\\\n [Ubuntu]=\\\"apt-get install -y stress-ng\\\")\\n\\nos_name='N/A'\\n\\nfor key in $(echo ${!os_dic[*]})\\ndo\\n if [[ $os_desc =~ $key ]]\\n then\\n os_name=$key\\n echo $key\\n fi\\ndone\\n\\nif [ $os_name == 'N/A' ]\\nthen\\n echo \\\"Unsupported Linux distributions\\\"\\n exit 1\\nfi\\n\\n# os_name=$(cat /etc/*release | awk 'NR==1{print($1)}')\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"installing stress-ng...\\\"\\ncommand_exists stress-ng\\n\\nif [[ $? -eq 0 ]]\\nthen\\n ${os_dic[$os_name]}\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Checking the installation status...\\\"\\n command_exists stress-ng\\n if [[ $? -eq 0 && $os_name != 'CoreOS' ]]\\n then\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Fail to install\\\"\\n exit 1\\n else\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\n fi\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\nfi\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"Starting to perform stress test\\\"\\nif [ $os_name == \\\"CoreOS\\\" ]\\nthen\\n docker run --rm alexeiled/stress-ng --vm-bytes $(awk '/MemAvailable/{printf \\\"%d\\\\n\\\", $2 * 0.01*{{percentage}};}' < /proc/meminfo)k --vm-keep -m 1 -t {{timeout}}\\nelse\\n avaliable_mem=$(awk '/^MemAvailable:/{printf \\\"%d\\\\n\\\", $2;}' < /proc/meminfo)\\n free_mem=$(awk '/^MemFree:/{printf \\\"%d\\\\n\\\", $2;}' < /proc/meminfo)\\n buffer=$(awk '/^Buffers:/{printf \\\"%d\\\\n\\\", $2;}' < /proc/meminfo)\\n cache=$(awk '/^Cached:/{printf \\\"%d\\\\n\\\", $2;}' < /proc/meminfo)\\n if [ -n \\\"$avaliable_mem\\\" ]\\n then\\n stress-ng --vm-bytes $[$avaliable_mem*{{percentage}}/100]k --vm-keep -m 1 -t {{timeout}}\\n else\\n stress-ng --vm-bytes $[($free_mem+$buffer+$cache)*{{percentage}}/100]k --vm-keep -m 1 -t {{timeout}}\\n fi\\nfi\\n\\nif [[ !$? -eq 0 ]]\\nthen\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Failed\\\"\\n exit 1\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Completed\\\"\\n exit 0\\nfi\",\n \"ActionCommandType\": 0,\n \"ActionDetail\": \"<p>使用tat通道下发stress-ng命令进行压测</p>\\n<p>命令内容:stress-ng --vm-bytes $(awk '/MemAvailable/{printf \\\"%d\\\\n\\\", $2 * 0.01*{{percentage}};}' < /proc/meminfo)k --vm-keep -m 1 -t {{timeout}}</p>\\n<p><a href=\\\"https://cloud.tencent.com/document/api/1340/52676\\\">tat官方文档</a></p>\\n<p><a href=\\\"https://wiki.ubuntu.com/Kernel/Reference/stress-ng\\\">stress-ng官方文档</a></p>\",\n \"ResourceType\": \"内存资源\",\n \"IsAllowed\": true,\n \"ActionBestCase\": \"\",\n \"ObjectType\": \"CVM\",\n \"MetricIdList\": []\n },\n {\n \"ActionName\": \"磁盘分区使用率高\",\n \"Desc\": \"使用stress-ng压测工具压测,支持的linux发行版:Centos7.2及以上,CoreOS 1745.5.0及以上,Debian9.0及以上,Ubuntu 16.04.1及以上\",\n \"ActionType\": \"平台\",\n \"CreateTime\": \"2022-11-29 18:08:46\",\n \"Creator\": \"系统\",\n \"UpdateTime\": \"2022-11-29 18:08:46\",\n \"RiskDesc\": \"高风险\",\n \"ActionId\": 8,\n \"AttributeId\": 1,\n \"RelationActionId\": 0,\n \"ActionCommand\": \"#!/bin/bash\\n\\nuser=$(whoami)\\nif [ !$user == 'root' ]\\nthen\\n sudo -i\\nfi\\n\\nfunction command_exists(){\\n if command -v $1 > /dev/null 2>&1; then\\n return 1\\n else\\n return 0\\n fi\\n}\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n\\nos_desc=$(cat /etc/*release)\\n# echo $os_desc\\n\\ndeclare -A os_dic\\nos_dic=([CentOS]=\\\"yum install stress-ng -y\\\" \\\\\\n [CoreOS]=\\\"docker pull alexeiled/stress-ng\\\" \\\\\\n [Debian]=\\\"apt-get install -y stress-ng\\\" \\\\\\n [Ubuntu]=\\\"apt-get install -y stress-ng\\\")\\n\\nos_name='N/A'\\n\\nfor key in $(echo ${!os_dic[*]})\\ndo\\n if [[ $os_desc =~ $key ]]\\n then\\n os_name=$key\\n echo $key\\n fi\\ndone\\n\\nif [ $os_name == 'N/A' ]\\nthen\\n echo \\\"Unsupported Linux distributions\\\"\\n exit 1\\nfi\\n\\n# os_name=$(cat /etc/*release | awk 'NR==1{print($1)}')\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"installing stress-ng...\\\"\\ncommand_exists stress-ng\\n\\nif [[ $? -eq 0 ]]\\nthen\\n ${os_dic[$os_name]}\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Checking the installation status...\\\"\\n command_exists stress-ng\\n if [[ $? -eq 0 && $os_name != 'CoreOS' ]]\\n then\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Fail to install\\\"\\n exit 1\\n else\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\n fi\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\nfi\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"Starting to perform stress test.\\\"\\nif [ $os_name == \\\"CoreOS\\\" ]\\nthen\\n cd {{dir}} && docker run --rm alexeiled/stress-ng --iomix 1 --iomix-bytes `df -k {{dir}} | awk 'NR==2{printf(\\\"%d\\\\n\\\", ($3+$4)*0.01*{{percentage}}-$3)}'`k -t {{timeout}}\\nelse\\n cd {{dir}} && stress-ng --iomix 1 --iomix-bytes `df -k {{dir}} | awk 'NR==2{printf(\\\"%d\\\\n\\\", ($3+$4)*0.01*{{percentage}}-$3)}'`k -t {{timeout}}\\nfi\\n\\nif [[ !$? -eq 0 ]]\\nthen\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Failed\\\"\\n exit 1\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Completed\\\"\\n exit 0\\nfi\",\n \"ActionContent\": \"#!/bin/bash\\n\\nuser=$(whoami)\\nif [ !$user == 'root' ]\\nthen\\n sudo -i\\nfi\\n\\nfunction command_exists(){\\n if command -v $1 > /dev/null 2>&1; then\\n return 1\\n else\\n return 0\\n fi\\n}\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n\\nos_desc=$(cat /etc/*release)\\n# echo $os_desc\\n\\ndeclare -A os_dic\\nos_dic=([CentOS]=\\\"yum install stress-ng -y\\\" \\\\\\n [CoreOS]=\\\"docker pull alexeiled/stress-ng\\\" \\\\\\n [Debian]=\\\"apt-get install -y stress-ng\\\" \\\\\\n [Ubuntu]=\\\"apt-get install -y stress-ng\\\")\\n\\nos_name='N/A'\\n\\nfor key in $(echo ${!os_dic[*]})\\ndo\\n if [[ $os_desc =~ $key ]]\\n then\\n os_name=$key\\n echo $key\\n fi\\ndone\\n\\nif [ $os_name == 'N/A' ]\\nthen\\n echo \\\"Unsupported Linux distributions\\\"\\n exit 1\\nfi\\n\\n# os_name=$(cat /etc/*release | awk 'NR==1{print($1)}')\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"installing stress-ng...\\\"\\ncommand_exists stress-ng\\n\\nif [[ $? -eq 0 ]]\\nthen\\n ${os_dic[$os_name]}\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Checking the installation status...\\\"\\n command_exists stress-ng\\n if [[ $? -eq 0 && $os_name != 'CoreOS' ]]\\n then\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Fail to install\\\"\\n exit 1\\n else\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\n fi\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\nfi\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"Starting to perform stress test.\\\"\\nif [ $os_name == \\\"CoreOS\\\" ]\\nthen\\n cd {{dir}} && docker run --rm alexeiled/stress-ng --iomix 1 --iomix-bytes `df -k {{dir}} | awk 'NR==2{printf(\\\"%d\\\\n\\\", ($3+$4)*0.01*{{percentage}}-$3)}'`k -t {{timeout}}\\nelse\\n cd {{dir}} && stress-ng --iomix 1 --iomix-bytes `df -k {{dir}} | awk 'NR==2{printf(\\\"%d\\\\n\\\", ($3+$4)*0.01*{{percentage}}-$3)}'`k -t {{timeout}}\\nfi\\n\\nif [[ !$? -eq 0 ]]\\nthen\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Failed\\\"\\n exit 1\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Completed\\\"\\n exit 0\\nfi\",\n \"ActionCommandType\": 0,\n \"ActionDetail\": \"<p>使用tat通道下发stress-ng命令进行压测</p>\\n<p>命令内容:stress-ng --iomix 1 --iomix-bytes `df -k {{dir}} | awk 'NR==2{printf(\\\"%d\\\\n\\\", ($3+$4)*0.01*{{percentage}}-$3)}'`k -t {{timeout}}</p>\\n<p><a href=\\\"https://cloud.tencent.com/document/api/1340/52676\\\">tat官方文档</a></p>\\n<p><a href=\\\"https://wiki.ubuntu.com/Kernel/Reference/stress-ng\\\">stress-ng官方文档</a></p>\\n\",\n \"ResourceType\": \"磁盘资源\",\n \"IsAllowed\": true,\n \"ActionBestCase\": \"\",\n \"ObjectType\": \"CVM\",\n \"MetricIdList\": []\n },\n {\n \"ActionName\": \"内核故障\",\n \"Desc\": \"会触发实例重启\",\n \"ActionType\": \"平台\",\n \"CreateTime\": \"2022-11-29 18:08:46\",\n \"Creator\": \"系统\",\n \"UpdateTime\": \"2022-11-29 18:08:46\",\n \"RiskDesc\": \"高风险\",\n \"ActionId\": 9,\n \"AttributeId\": 1,\n \"RelationActionId\": 24,\n \"ActionCommand\": \"echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\" && echo 'inject kernel error success!' && echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\" && sleep 5 && echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\" && echo c > /proc/sysrq-trigger &\",\n \"ActionContent\": \"echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\" && echo 'inject kernel error success!' && echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\" && sleep 5 && echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\" && echo c > /proc/sysrq-trigger &\",\n \"ActionCommandType\": 0,\n \"ActionDetail\": \"<p>使用tat通道下发内核故障命令</p>\\n<p>命令内容:echo c > /proc/sysrq-trigger</p>\\n<p><a href=\\\"https://cloud.tencent.com/document/api/1340/52676\\\">tat官方文档</a></p>\",\n \"ResourceType\": \"CPU资源\",\n \"IsAllowed\": true,\n \"ActionBestCase\": \"\",\n \"ObjectType\": \"CVM\",\n \"MetricIdList\": []\n },\n {\n \"ActionName\": \"磁盘IO负载\",\n \"Desc\": \"使用stress-ng压测工具压测,支持的linux发行版:Centos7.2及以上,CoreOS 1745.5.0及以上,Debian9.0及以上,Ubuntu 16.04.1及以上\",\n \"ActionType\": \"平台\",\n \"CreateTime\": \"2022-11-29 18:08:46\",\n \"Creator\": \"系统\",\n \"UpdateTime\": \"2022-11-29 18:08:46\",\n \"RiskDesc\": \"高风险\",\n \"ActionId\": 10,\n \"AttributeId\": 1,\n \"RelationActionId\": 0,\n \"ActionCommand\": \"#!/bin/bash\\n\\nuser=$(whoami)\\nif [ !$user == 'root' ]\\nthen\\n sudo -i\\nfi\\n\\nfunction command_exists(){\\n if command -v $1 > /dev/null 2>&1; then\\n return 1\\n else\\n return 0\\n fi\\n}\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n\\nos_desc=$(cat /etc/*release)\\n# echo $os_desc\\n\\ndeclare -A os_dic\\nos_dic=([CentOS]=\\\"yum install stress-ng -y\\\" \\\\\\n [CoreOS]=\\\"docker pull alexeiled/stress-ng\\\" \\\\\\n [Debian]=\\\"apt-get install -y stress-ng\\\" \\\\\\n [Ubuntu]=\\\"apt-get install -y stress-ng\\\")\\n\\nos_name='N/A'\\n\\nfor key in $(echo ${!os_dic[*]})\\ndo\\n if [[ $os_desc =~ $key ]]\\n then\\n os_name=$key\\n echo $key\\n fi\\ndone\\n\\nif [ $os_name == 'N/A' ]\\nthen\\n echo \\\"Unsupported Linux distributions\\\"\\n exit 1\\nfi\\n\\n# os_name=$(cat /etc/*release | awk 'NR==1{print($1)}')\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"installing stress-ng...\\\"\\ncommand_exists stress-ng\\n\\nif [[ $? -eq 0 ]]\\nthen\\n ${os_dic[$os_name]}\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Checking the installation status...\\\"\\n command_exists stress-ng\\n if [[ $? -eq 0 && $os_name != 'CoreOS' ]]\\n then\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Fail to install\\\"\\n exit 1\\n else\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\n fi\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\nfi\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"Starting to perform stress test.\\\"\\nif [ $os_name == \\\"CoreOS\\\" ]\\nthen\\n docker run --rm alexeiled/stress-ng --vm-bytes {{bytes_num}}{{bytes_unit}} --hdd {{io_process_num}} --vm-keep -t {{timeout}}\\nelse\\n stress-ng --vm-bytes {{bytes_num}}{{bytes_unit}} --hdd {{io_process_num}} --vm-keep -t {{timeout}}\\nfi\\n\\nif [[ !$? -eq 0 ]]\\nthen\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Failed\\\"\\n exit 1\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Completed\\\"\\n exit 0\\nfi\",\n \"ActionContent\": \"#!/bin/bash\\n\\nuser=$(whoami)\\nif [ !$user == 'root' ]\\nthen\\n sudo -i\\nfi\\n\\nfunction command_exists(){\\n if command -v $1 > /dev/null 2>&1; then\\n return 1\\n else\\n return 0\\n fi\\n}\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n\\nos_desc=$(cat /etc/*release)\\n# echo $os_desc\\n\\ndeclare -A os_dic\\nos_dic=([CentOS]=\\\"yum install stress-ng -y\\\" \\\\\\n [CoreOS]=\\\"docker pull alexeiled/stress-ng\\\" \\\\\\n [Debian]=\\\"apt-get install -y stress-ng\\\" \\\\\\n [Ubuntu]=\\\"apt-get install -y stress-ng\\\")\\n\\nos_name='N/A'\\n\\nfor key in $(echo ${!os_dic[*]})\\ndo\\n if [[ $os_desc =~ $key ]]\\n then\\n os_name=$key\\n echo $key\\n fi\\ndone\\n\\nif [ $os_name == 'N/A' ]\\nthen\\n echo \\\"Unsupported Linux distributions\\\"\\n exit 1\\nfi\\n\\n# os_name=$(cat /etc/*release | awk 'NR==1{print($1)}')\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"installing stress-ng...\\\"\\ncommand_exists stress-ng\\n\\nif [[ $? -eq 0 ]]\\nthen\\n ${os_dic[$os_name]}\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Checking the installation status...\\\"\\n command_exists stress-ng\\n if [[ $? -eq 0 && $os_name != 'CoreOS' ]]\\n then\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Fail to install\\\"\\n exit 1\\n else\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\n fi\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\nfi\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"Starting to perform stress test.\\\"\\nif [ $os_name == \\\"CoreOS\\\" ]\\nthen\\n docker run --rm alexeiled/stress-ng --vm-bytes {{bytes_num}}{{bytes_unit}} --hdd {{io_process_num}} --vm-keep -t {{timeout}}\\nelse\\n stress-ng --vm-bytes {{bytes_num}}{{bytes_unit}} --hdd {{io_process_num}} --vm-keep -t {{timeout}}\\nfi\\n\\nif [[ !$? -eq 0 ]]\\nthen\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Failed\\\"\\n exit 1\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Completed\\\"\\n exit 0\\nfi\",\n \"ActionCommandType\": 0,\n \"ActionDetail\": \"<p>使用tat通道下发stress-ng命令进行压测</p>\\n<p>命令内容:stress-ng --vm-bytes {{bytes_num}}{{bytes_unit}} --hdd {{io_process_num}} --vm-keep -t {{timeout}}</p>\\n<p><a href=\\\"https://cloud.tencent.com/document/api/1340/52676\\\">tat官方文档</a></p>\",\n \"ResourceType\": \"IO资源\",\n \"IsAllowed\": true,\n \"ActionBestCase\": \"\",\n \"ObjectType\": \"CVM\",\n \"MetricIdList\": []\n },\n {\n \"ActionName\": \"内存OOM\",\n \"Desc\": \"使用stress-ng压测工具压测,支持的linux发行版:Centos7.2及以上,CoreOS 1745.5.0及以上,Debian9.0及以上,Ubuntu 16.04.1及以上\",\n \"ActionType\": \"平台\",\n \"CreateTime\": \"2023-07-04 11:20:43\",\n \"Creator\": \"系统\",\n \"UpdateTime\": \"2023-07-04 11:20:43\",\n \"RiskDesc\": \"高风险\",\n \"ActionId\": 11,\n \"AttributeId\": 1,\n \"RelationActionId\": 0,\n \"ActionCommand\": \"#!/bin/bash\\n\\nuser=$(whoami)\\nif [ !$user == 'root' ]\\nthen\\n sudo -i\\nfi\\n\\nfunction command_exists(){\\n if command -v $1 > /dev/null 2>&1; then\\n return 1\\n else\\n return 0\\n fi\\n}\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n\\nos_desc=$(cat /etc/*release)\\n# echo $os_desc\\n\\ndeclare -A os_dic\\nos_dic=([CentOS]=\\\"yum install stress-ng -y\\\" \\\\\\n [CoreOS]=\\\"docker pull alexeiled/stress-ng\\\" \\\\\\n [Debian]=\\\"apt-get install -y stress-ng\\\" \\\\\\n [Ubuntu]=\\\"apt-get install -y stress-ng\\\")\\n\\nos_name='N/A'\\n\\nfor key in $(echo ${!os_dic[*]})\\ndo\\n if [[ $os_desc =~ $key ]]\\n then\\n os_name=$key\\n echo $key\\n fi\\ndone\\n\\nif [ $os_name == 'N/A' ]\\nthen\\n echo \\\"Unsupported Linux distributions\\\"\\n exit 1\\nfi\\n\\n# os_name=$(cat /etc/*release | awk 'NR==1{print($1)}')\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"installing stress-ng...\\\"\\ncommand_exists stress-ng\\n\\nif [[ $? -eq 0 ]]\\nthen\\n ${os_dic[$os_name]}\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Checking the installation status...\\\"\\n command_exists stress-ng\\n if [[ $? -eq 0 && $os_name != 'CoreOS' ]]\\n then\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Fail to install\\\"\\n exit 1\\n else\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\n fi\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\nfi\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"Starting to perform stress test.\\\"\\nif [ $os_name == \\\"CoreOS\\\" ]\\nthen\\n docker run --rm alexeiled/stress-ng --bigheap 10 --bigheap-growth 4K -t {{timeout}}\\nelse\\n stress-ng --bigheap 10 --bigheap-growth 4K -t {{timeout}}\\nfi\\necho \\\"Completed\\\"\\n\\n\",\n \"ActionContent\": \"#!/bin/bash\\n\\nuser=$(whoami)\\nif [ !$user == 'root' ]\\nthen\\n sudo -i\\nfi\\n\\nfunction command_exists(){\\n if command -v $1 > /dev/null 2>&1; then\\n return 1\\n else\\n return 0\\n fi\\n}\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n\\nos_desc=$(cat /etc/*release)\\n# echo $os_desc\\n\\ndeclare -A os_dic\\nos_dic=([CentOS]=\\\"yum install stress-ng -y\\\" \\\\\\n [CoreOS]=\\\"docker pull alexeiled/stress-ng\\\" \\\\\\n [Debian]=\\\"apt-get install -y stress-ng\\\" \\\\\\n [Ubuntu]=\\\"apt-get install -y stress-ng\\\")\\n\\nos_name='N/A'\\n\\nfor key in $(echo ${!os_dic[*]})\\ndo\\n if [[ $os_desc =~ $key ]]\\n then\\n os_name=$key\\n echo $key\\n fi\\ndone\\n\\nif [ $os_name == 'N/A' ]\\nthen\\n echo \\\"Unsupported Linux distributions\\\"\\n exit 1\\nfi\\n\\n# os_name=$(cat /etc/*release | awk 'NR==1{print($1)}')\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"installing stress-ng...\\\"\\ncommand_exists stress-ng\\n\\nif [[ $? -eq 0 ]]\\nthen\\n ${os_dic[$os_name]}\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Checking the installation status...\\\"\\n command_exists stress-ng\\n if [[ $? -eq 0 && $os_name != 'CoreOS' ]]\\n then\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"Fail to install\\\"\\n exit 1\\n else\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\n fi\\nelse\\n echo -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\n echo \\\"stress-ng has already installed\\\"\\nfi\\n\\necho -e \\\"[\\\"`date +\\\"%Y-%m-%d %H:%M:%S\\\"`\\\"] \\\\c\\\"\\necho \\\"Starting to perform stress test.\\\"\\nif [ $os_name == \\\"CoreOS\\\" ]\\nthen\\n docker run --rm alexeiled/stress-ng --bigheap 10 --bigheap-growth 4K -t {{timeout}}\\nelse\\n stress-ng --bigheap 10 --bigheap-growth 4K -t {{timeout}}\\nfi\\necho \\\"Completed\\\"\\n\\n\",\n \"ActionCommandType\": 0,\n \"ActionDetail\": \"<p>使用tat通道下发stress-ng命令进行压测</p>\\n<p>命令内容:stress-ng --bigheap 10 --bigheap-growth 4K -t {{timeout}}</p>\\n<p><a href=\\\"https://cloud.tencent.com/document/api/1340/52676\\\">tat官方文档</a></p>\",\n \"ResourceType\": \"内存资源\",\n \"IsAllowed\": true,\n \"ActionBestCase\": \"https://cloud.tencent.com/document/product/1500/81504\",\n \"ObjectType\": \"CVM\",\n \"MetricIdList\": []\n },\n {\n \"ActionName\": \"空操作\",\n \"Desc\": \"空操作,用于测试流程,不做实际注入操作\",\n \"ActionType\": \"平台\",\n \"CreateTime\": \"2022-11-29 18:08:46\",\n \"Creator\": \"系统\",\n \"UpdateTime\": \"2022-11-29 18:08:46\",\n \"RiskDesc\": \"低风险\",\n \"ActionId\": 12,\n \"AttributeId\": 1,\n \"RelationActionId\": 13,\n \"ActionCommand\": \"调用腾讯云对应产品的API接口\",\n \"ActionContent\": \"空操作\",\n \"ActionCommandType\": 1,\n \"ActionDetail\": null,\n \"ResourceType\": \"其他\",\n \"IsAllowed\": true,\n \"ActionBestCase\": \"\",\n \"ObjectType\": \"CVM\",\n \"MetricIdList\": []\n }\n ],\n \"Total\": 45\n }\n}",
|
40
|
+
"title": "动作库列表查询"
|
41
|
+
}
|
42
|
+
],
|
43
|
+
"DescribeObjectTypeList": [
|
44
|
+
{
|
45
|
+
"document": "",
|
46
|
+
"input": "POST / HTTP/1.1\nHost: cfg.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeObjectTypeList\n<公共请求参数>\n\n{}",
|
47
|
+
"output": "{\n \"Response\": {\n \"ObjectTypeList\": [\n {\n \"ObjectTypeId\": 0,\n \"ObjectTypeTitle\": \"abc\",\n \"ObjectTypeLevelOne\": \"abc\",\n \"ObjectTypeParams\": {\n \"Key\": \"abc\",\n \"Fields\": [\n {\n \"Key\": \"abc\",\n \"Header\": \"abc\",\n \"Transfer\": \"abc\",\n \"JsonParse\": \"abc\"\n }\n ]\n },\n \"ObjectTypeJsonParse\": {\n \"NameSpace\": \"abc\",\n \"WorkloadName\": \"abc\"\n }\n }\n ],\n \"RequestId\": \"abc\"\n }\n}",
|
48
|
+
"title": "请求对象类型列表"
|
49
|
+
}
|
50
|
+
],
|
19
51
|
"DescribeTask": [
|
20
52
|
{
|
21
53
|
"document": "",
|
@@ -4345,6 +4345,16 @@
|
|
4345
4345
|
"output_required": false,
|
4346
4346
|
"type": "string",
|
4347
4347
|
"value_allowed_null": true
|
4348
|
+
},
|
4349
|
+
{
|
4350
|
+
"disabled": false,
|
4351
|
+
"document": "规则最近命中时间\n注意:此字段可能返回 null,表示取不到有效值。",
|
4352
|
+
"example": "无",
|
4353
|
+
"member": "string",
|
4354
|
+
"name": "LastHitTime",
|
4355
|
+
"output_required": false,
|
4356
|
+
"type": "string",
|
4357
|
+
"value_allowed_null": true
|
4348
4358
|
}
|
4349
4359
|
],
|
4350
4360
|
"usage": "out"
|
@@ -4866,7 +4876,7 @@
|
|
4866
4876
|
},
|
4867
4877
|
{
|
4868
4878
|
"disabled": false,
|
4869
|
-
"document": "
|
4879
|
+
"document": "已使用的地址模板数",
|
4870
4880
|
"example": "0",
|
4871
4881
|
"member": "int64",
|
4872
4882
|
"name": "UsedTemplateCount",
|
@@ -4876,7 +4886,7 @@
|
|
4876
4886
|
},
|
4877
4887
|
{
|
4878
4888
|
"disabled": false,
|
4879
|
-
"document": "
|
4889
|
+
"document": "地址模板配额数量",
|
4880
4890
|
"example": "10",
|
4881
4891
|
"member": "int64",
|
4882
4892
|
"name": "TemplateQuotaCount",
|
@@ -5398,6 +5398,16 @@
|
|
5398
5398
|
"output_required": true,
|
5399
5399
|
"type": "string",
|
5400
5400
|
"value_allowed_null": false
|
5401
|
+
},
|
5402
|
+
{
|
5403
|
+
"disabled": false,
|
5404
|
+
"document": "数据加工类型。0:标准加工任务;1:前置加工任务。\n注意:此字段可能返回 null,表示取不到有效值。",
|
5405
|
+
"example": "0",
|
5406
|
+
"member": "uint64",
|
5407
|
+
"name": "DataTransformType",
|
5408
|
+
"output_required": false,
|
5409
|
+
"type": "int",
|
5410
|
+
"value_allowed_null": true
|
5401
5411
|
}
|
5402
5412
|
],
|
5403
5413
|
"usage": "out"
|
@@ -6600,7 +6610,7 @@
|
|
6600
6610
|
"members": [
|
6601
6611
|
{
|
6602
6612
|
"disabled": false,
|
6603
|
-
"document": "
|
6613
|
+
"document": "- taskName\n按照【加工任务名称】进行过滤。\n类型:String\n必选:否\n\n- taskId\n按照【加工任务id】进行过滤。\n类型:String\n必选:否\n\n- topicId\n按照【源topicId】进行过滤。\n类型:String\n必选:否\n- status\n按照【 任务运行状态】进行过滤。 1:准备中,2:运行中,3:停止中,4:已停止\n类型:String\n必选:否\n- hasServiceLog\n按照【是否开启服务日志】进行过滤。 1:未开启,2:已开启\n类型:String\n必选:否\n- dstTopicType\n按照【目标topic类型】进行过滤。 1:固定,2:动态\n类型:String\n必选:否\n\n每次请求的Filters的上限为10,Filter.Values的上限为100。",
|
6604
6614
|
"example": "无",
|
6605
6615
|
"member": "Filter",
|
6606
6616
|
"name": "Filters",
|
@@ -8202,30 +8202,30 @@
|
|
8202
8202
|
{
|
8203
8203
|
"disabled": false,
|
8204
8204
|
"document": "导出的多媒体创作引擎媒体 Id,仅当导出目标为多媒体创作引擎媒体时有效。",
|
8205
|
-
"example": "
|
8205
|
+
"example": "5f73f8ad54953bce323f",
|
8206
8206
|
"member": "string",
|
8207
8207
|
"name": "MaterialId",
|
8208
|
-
"
|
8208
|
+
"output_required": true,
|
8209
8209
|
"type": "string",
|
8210
8210
|
"value_allowed_null": false
|
8211
8211
|
},
|
8212
8212
|
{
|
8213
8213
|
"disabled": false,
|
8214
8214
|
"document": "云点播媒资 FileId。",
|
8215
|
-
"example": "
|
8215
|
+
"example": "2c65f425b86ad532",
|
8216
8216
|
"member": "string",
|
8217
8217
|
"name": "VodFileId",
|
8218
|
-
"
|
8218
|
+
"output_required": true,
|
8219
8219
|
"type": "string",
|
8220
8220
|
"value_allowed_null": false
|
8221
8221
|
},
|
8222
8222
|
{
|
8223
8223
|
"disabled": false,
|
8224
8224
|
"document": "导出的媒资 URL。",
|
8225
|
-
"example": "
|
8225
|
+
"example": "http://cme.vod2.myqcloud.com/123/f0.mp4",
|
8226
8226
|
"member": "string",
|
8227
8227
|
"name": "URL",
|
8228
|
-
"
|
8228
|
+
"output_required": true,
|
8229
8229
|
"type": "string",
|
8230
8230
|
"value_allowed_null": false
|
8231
8231
|
},
|
@@ -8235,17 +8235,17 @@
|
|
8235
8235
|
"example": "无",
|
8236
8236
|
"member": "MediaMetaData",
|
8237
8237
|
"name": "MetaData",
|
8238
|
-
"
|
8238
|
+
"output_required": true,
|
8239
8239
|
"type": "object",
|
8240
8240
|
"value_allowed_null": true
|
8241
8241
|
},
|
8242
8242
|
{
|
8243
8243
|
"disabled": false,
|
8244
8244
|
"document": "导出视频的封面图片 URL。",
|
8245
|
-
"example": "
|
8245
|
+
"example": "http://cme.vod2.myqcloud.com/123/f0.jpg",
|
8246
8246
|
"member": "string",
|
8247
8247
|
"name": "CoverURL",
|
8248
|
-
"
|
8248
|
+
"output_required": true,
|
8249
8249
|
"type": "string",
|
8250
8250
|
"value_allowed_null": false
|
8251
8251
|
}
|
@@ -284,7 +284,7 @@
|
|
284
284
|
{
|
285
285
|
"document": " 获取任务详情。",
|
286
286
|
"input": "POST / HTTP/1.1\nHost: cme.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeTaskDetail\n<公共请求参数>\n\n{\n \"Platform\": \"test\",\n \"TaskId\": \"181xxxxxxxx9-procedurev2-b718fcee09a72470bf665cf55351d810t0\"\n}",
|
287
|
-
"output": "{\n \"Response\": {\n \"CreateTime\": \"2020-04-28T18:16:58Z\",\n \"ErrCode\": 0,\n \"ErrMsg\": \"Success.\",\n \"Progress\": 100,\n \"RequestId\": \"85b8cdac-8e18-430a-aeae-08076ac26a11\",\n \"Status\": \"SUCCESS\",\n \"TaskType\": \"VIDEO_EDIT_PROJECT_EXPORT\",\n \"VideoEditProjectOutput\": {\n \"MaterialId\": \"6866c9a7-a2ca-4d\",\n \"MetaData\": {\n \"AudioStreamInfoSet\": [\n {\n \"Bitrate\": 46552,\n \"Codec\": \"aac\",\n \"SamplingRate\": 16000\n }\n ],\n \"Bitrate\": 6917072,\n \"Container\": \"mov,mp4,m4a,3gp,3g2,mj2\",\n \"Duration\": 346.55999755859375,\n \"Height\": 1080,\n \"Rotate\": 0,\n \"Size\": 299688882,\n \"VideoStreamInfoSet\": [\n {\n \"Bitrate\": 6870520,\n \"Codec\": \"h264\",\n \"Fps\": 25,\n \"Height\": 1080,\n \"Width\": 1920\n }\n ],\n \"Width\": 1920\n },\n \"URL\": \"http://cmedemo.vod2.myqcloud.com/xxxxx/cemdemo.mp4\",\n \"VodFileId\": \"5285890802029089\"\n }\n }\n}",
|
287
|
+
"output": "{\n \"Response\": {\n \"CreateTime\": \"2020-04-28T18:16:58Z\",\n \"ErrCode\": 0,\n \"ErrMsg\": \"Success.\",\n \"Progress\": 100,\n \"RequestId\": \"85b8cdac-8e18-430a-aeae-08076ac26a11\",\n \"Status\": \"SUCCESS\",\n \"TaskType\": \"VIDEO_EDIT_PROJECT_EXPORT\",\n \"VideoEditProjectOutput\": {\n \"MaterialId\": \"6866c9a7-a2ca-4d\",\n \"MetaData\": {\n \"AudioStreamInfoSet\": [\n {\n \"Bitrate\": 46552,\n \"Codec\": \"aac\",\n \"SamplingRate\": 16000\n }\n ],\n \"Bitrate\": 6917072,\n \"Container\": \"mov,mp4,m4a,3gp,3g2,mj2\",\n \"Duration\": 346.55999755859375,\n \"Height\": 1080,\n \"Rotate\": 0,\n \"Size\": 299688882,\n \"VideoStreamInfoSet\": [\n {\n \"Bitrate\": 6870520,\n \"Codec\": \"h264\",\n \"Fps\": 25,\n \"Height\": 1080,\n \"Width\": 1920\n }\n ],\n \"Width\": 1920\n },\n \"URL\": \"http://cmedemo.vod2.myqcloud.com/xxxxx/cemdemo.mp4\",\n \"CoverURL\": \"http://cmedemo.vod2.myqcloud.com/xxxxx/cemdemo.jpg\",\n \"VodFileId\": \"5285890802029089\"\n }\n }\n}",
|
288
288
|
"title": "获取任务详情"
|
289
289
|
}
|
290
290
|
],
|
@@ -1161,6 +1161,58 @@ def doDescribeRiskCenterWebsiteRiskList(args, parsed_globals):
|
|
1161
1161
|
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1162
1162
|
|
1163
1163
|
|
1164
|
+
def doDescribeCFWAssetStatistics(args, parsed_globals):
|
1165
|
+
g_param = parse_global_arg(parsed_globals)
|
1166
|
+
|
1167
|
+
if g_param[OptionsDefine.UseCVMRole.replace('-', '_')]:
|
1168
|
+
cred = credential.CVMRoleCredential()
|
1169
|
+
elif g_param[OptionsDefine.RoleArn.replace('-', '_')] and g_param[OptionsDefine.RoleSessionName.replace('-', '_')]:
|
1170
|
+
cred = credential.STSAssumeRoleCredential(
|
1171
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.RoleArn.replace('-', '_')],
|
1172
|
+
g_param[OptionsDefine.RoleSessionName.replace('-', '_')], endpoint=g_param["sts_cred_endpoint"]
|
1173
|
+
)
|
1174
|
+
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):
|
1175
|
+
cred = credential.DefaultTkeOIDCRoleArnProvider().get_credentials()
|
1176
|
+
else:
|
1177
|
+
cred = credential.Credential(
|
1178
|
+
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
|
1179
|
+
)
|
1180
|
+
http_profile = HttpProfile(
|
1181
|
+
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
|
1182
|
+
reqMethod="POST",
|
1183
|
+
endpoint=g_param[OptionsDefine.Endpoint],
|
1184
|
+
proxy=g_param[OptionsDefine.HttpsProxy.replace('-', '_')]
|
1185
|
+
)
|
1186
|
+
profile = ClientProfile(httpProfile=http_profile, signMethod="HmacSHA256")
|
1187
|
+
if g_param[OptionsDefine.Language]:
|
1188
|
+
profile.language = g_param[OptionsDefine.Language]
|
1189
|
+
mod = CLIENT_MAP[g_param[OptionsDefine.Version]]
|
1190
|
+
client = mod.CsipClient(cred, g_param[OptionsDefine.Region], profile)
|
1191
|
+
client._sdkVersion += ("_CLI_" + __version__)
|
1192
|
+
models = MODELS_MAP[g_param[OptionsDefine.Version]]
|
1193
|
+
model = models.DescribeCFWAssetStatisticsRequest()
|
1194
|
+
model.from_json_string(json.dumps(args))
|
1195
|
+
start_time = time.time()
|
1196
|
+
while True:
|
1197
|
+
rsp = client.DescribeCFWAssetStatistics(model)
|
1198
|
+
result = rsp.to_json_string()
|
1199
|
+
try:
|
1200
|
+
json_obj = json.loads(result)
|
1201
|
+
except TypeError as e:
|
1202
|
+
json_obj = json.loads(result.decode('utf-8')) # python3.3
|
1203
|
+
if not g_param[OptionsDefine.Waiter] or search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj) == g_param['OptionsDefine.WaiterInfo']['to']:
|
1204
|
+
break
|
1205
|
+
cur_time = time.time()
|
1206
|
+
if cur_time - start_time >= g_param['OptionsDefine.WaiterInfo']['timeout']:
|
1207
|
+
raise ClientError('Request timeout, wait `%s` to `%s` timeout, last request is %s' %
|
1208
|
+
(g_param['OptionsDefine.WaiterInfo']['expr'], g_param['OptionsDefine.WaiterInfo']['to'],
|
1209
|
+
search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj)))
|
1210
|
+
else:
|
1211
|
+
print('Inquiry result is %s.' % search(g_param['OptionsDefine.WaiterInfo']['expr'], json_obj))
|
1212
|
+
time.sleep(g_param['OptionsDefine.WaiterInfo']['interval'])
|
1213
|
+
FormatOutput.output("action", json_obj, g_param[OptionsDefine.Output], g_param[OptionsDefine.Filter])
|
1214
|
+
|
1215
|
+
|
1164
1216
|
def doStopRiskCenterTask(args, parsed_globals):
|
1165
1217
|
g_param = parse_global_arg(parsed_globals)
|
1166
1218
|
|
@@ -2234,6 +2286,7 @@ ACTION_MAP = {
|
|
2234
2286
|
"DescribeAssetViewVulRiskList": doDescribeAssetViewVulRiskList,
|
2235
2287
|
"DescribeVULRiskDetail": doDescribeVULRiskDetail,
|
2236
2288
|
"DescribeRiskCenterWebsiteRiskList": doDescribeRiskCenterWebsiteRiskList,
|
2289
|
+
"DescribeCFWAssetStatistics": doDescribeCFWAssetStatistics,
|
2237
2290
|
"StopRiskCenterTask": doStopRiskCenterTask,
|
2238
2291
|
"CreateRiskCenterScanTask": doCreateRiskCenterScanTask,
|
2239
2292
|
"DescribeGatewayAssets": doDescribeGatewayAssets,
|
@@ -49,6 +49,13 @@
|
|
49
49
|
"output": "DescribeAssetViewVulRiskListResponse",
|
50
50
|
"status": "online"
|
51
51
|
},
|
52
|
+
"DescribeCFWAssetStatistics": {
|
53
|
+
"document": "云防资产中心统计数据",
|
54
|
+
"input": "DescribeCFWAssetStatisticsRequest",
|
55
|
+
"name": "云防资产中心统计数据",
|
56
|
+
"output": "DescribeCFWAssetStatisticsResponse",
|
57
|
+
"status": "online"
|
58
|
+
},
|
52
59
|
"DescribeCVMAssetInfo": {
|
53
60
|
"document": "cvm详情",
|
54
61
|
"input": "DescribeCVMAssetInfoRequest",
|
@@ -5367,7 +5374,7 @@
|
|
5367
5374
|
{
|
5368
5375
|
"disabled": false,
|
5369
5376
|
"document": "过滤内容",
|
5370
|
-
"example": "
|
5377
|
+
"example": "{}",
|
5371
5378
|
"member": "Filter",
|
5372
5379
|
"name": "Filter",
|
5373
5380
|
"required": false,
|
@@ -5376,7 +5383,7 @@
|
|
5376
5383
|
{
|
5377
5384
|
"disabled": false,
|
5378
5385
|
"document": "资产标签",
|
5379
|
-
"example": "
|
5386
|
+
"example": "[]",
|
5380
5387
|
"member": "AssetTag",
|
5381
5388
|
"name": "Tags",
|
5382
5389
|
"required": false,
|
@@ -5477,6 +5484,133 @@
|
|
5477
5484
|
],
|
5478
5485
|
"type": "object"
|
5479
5486
|
},
|
5487
|
+
"DescribeCFWAssetStatisticsRequest": {
|
5488
|
+
"document": "DescribeCFWAssetStatistics请求参数结构体",
|
5489
|
+
"members": [],
|
5490
|
+
"type": "object"
|
5491
|
+
},
|
5492
|
+
"DescribeCFWAssetStatisticsResponse": {
|
5493
|
+
"document": "DescribeCFWAssetStatistics返回参数结构体",
|
5494
|
+
"members": [
|
5495
|
+
{
|
5496
|
+
"disabled": false,
|
5497
|
+
"document": "网络资产总数",
|
5498
|
+
"example": "无",
|
5499
|
+
"member": "int64",
|
5500
|
+
"name": "NetworkTotal",
|
5501
|
+
"output_required": true,
|
5502
|
+
"type": "int",
|
5503
|
+
"value_allowed_null": false
|
5504
|
+
},
|
5505
|
+
{
|
5506
|
+
"disabled": false,
|
5507
|
+
"document": "资产clb数量",
|
5508
|
+
"example": "无",
|
5509
|
+
"member": "int64",
|
5510
|
+
"name": "ClbTotal",
|
5511
|
+
"output_required": true,
|
5512
|
+
"type": "int",
|
5513
|
+
"value_allowed_null": false
|
5514
|
+
},
|
5515
|
+
{
|
5516
|
+
"disabled": false,
|
5517
|
+
"document": "nat数量",
|
5518
|
+
"example": "无",
|
5519
|
+
"member": "int64",
|
5520
|
+
"name": "NatTotal",
|
5521
|
+
"output_required": true,
|
5522
|
+
"type": "int",
|
5523
|
+
"value_allowed_null": false
|
5524
|
+
},
|
5525
|
+
{
|
5526
|
+
"disabled": false,
|
5527
|
+
"document": "公网ip数量",
|
5528
|
+
"example": "无",
|
5529
|
+
"member": "int64",
|
5530
|
+
"name": "PublicAssetTotal",
|
5531
|
+
"output_required": true,
|
5532
|
+
"type": "int",
|
5533
|
+
"value_allowed_null": false
|
5534
|
+
},
|
5535
|
+
{
|
5536
|
+
"disabled": false,
|
5537
|
+
"document": "主机数量",
|
5538
|
+
"example": "无",
|
5539
|
+
"member": "int64",
|
5540
|
+
"name": "CVMAssetTotal",
|
5541
|
+
"output_required": true,
|
5542
|
+
"type": "int",
|
5543
|
+
"value_allowed_null": false
|
5544
|
+
},
|
5545
|
+
{
|
5546
|
+
"disabled": false,
|
5547
|
+
"document": "配置风险",
|
5548
|
+
"example": "无",
|
5549
|
+
"member": "int64",
|
5550
|
+
"name": "CFGTotal",
|
5551
|
+
"output_required": true,
|
5552
|
+
"type": "int",
|
5553
|
+
"value_allowed_null": false
|
5554
|
+
},
|
5555
|
+
{
|
5556
|
+
"disabled": false,
|
5557
|
+
"document": "端口风险",
|
5558
|
+
"example": "无",
|
5559
|
+
"member": "int64",
|
5560
|
+
"name": "PortTotal",
|
5561
|
+
"output_required": true,
|
5562
|
+
"type": "int",
|
5563
|
+
"value_allowed_null": false
|
5564
|
+
},
|
5565
|
+
{
|
5566
|
+
"disabled": false,
|
5567
|
+
"document": "内容风险",
|
5568
|
+
"example": "无",
|
5569
|
+
"member": "int64",
|
5570
|
+
"name": "WebsiteTotal",
|
5571
|
+
"output_required": true,
|
5572
|
+
"type": "int",
|
5573
|
+
"value_allowed_null": false
|
5574
|
+
},
|
5575
|
+
{
|
5576
|
+
"disabled": false,
|
5577
|
+
"document": "风险服务暴露",
|
5578
|
+
"example": "无",
|
5579
|
+
"member": "int64",
|
5580
|
+
"name": "ServerTotal",
|
5581
|
+
"output_required": true,
|
5582
|
+
"type": "int",
|
5583
|
+
"value_allowed_null": false
|
5584
|
+
},
|
5585
|
+
{
|
5586
|
+
"disabled": false,
|
5587
|
+
"document": "弱口令风险",
|
5588
|
+
"example": "无",
|
5589
|
+
"member": "int64",
|
5590
|
+
"name": "WeakPasswordTotal",
|
5591
|
+
"output_required": true,
|
5592
|
+
"type": "int",
|
5593
|
+
"value_allowed_null": false
|
5594
|
+
},
|
5595
|
+
{
|
5596
|
+
"disabled": false,
|
5597
|
+
"document": "漏洞风险",
|
5598
|
+
"example": "无",
|
5599
|
+
"member": "int64",
|
5600
|
+
"name": "VULTotal",
|
5601
|
+
"output_required": true,
|
5602
|
+
"type": "int",
|
5603
|
+
"value_allowed_null": false
|
5604
|
+
},
|
5605
|
+
{
|
5606
|
+
"document": "唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。",
|
5607
|
+
"member": "string",
|
5608
|
+
"name": "RequestId",
|
5609
|
+
"type": "string"
|
5610
|
+
}
|
5611
|
+
],
|
5612
|
+
"type": "object"
|
5613
|
+
},
|
5480
5614
|
"DescribeCVMAssetInfoRequest": {
|
5481
5615
|
"document": "DescribeCVMAssetInfo请求参数结构体",
|
5482
5616
|
"members": [
|
@@ -56,6 +56,14 @@
|
|
56
56
|
"title": "success1"
|
57
57
|
}
|
58
58
|
],
|
59
|
+
"DescribeCFWAssetStatistics": [
|
60
|
+
{
|
61
|
+
"document": "资产中心统计",
|
62
|
+
"input": "POST / HTTP/1.1\nHost: csip.tencentcloudapi.com\nContent-Type: application/json\nX-TC-Action: DescribeCFWAssetStatistics\n<公共请求参数>\n\n{}",
|
63
|
+
"output": "{\n \"Response\": {\n \"NetworkTotal\": 0,\n \"ClbTotal\": 0,\n \"NatTotal\": 0,\n \"PublicAssetTotal\": 0,\n \"CVMAssetTotal\": 0,\n \"CFGTotal\": 0,\n \"PortTotal\": 0,\n \"WebsiteTotal\": 0,\n \"ServerTotal\": 0,\n \"WeakPasswordTotal\": 0,\n \"VULTotal\": 0,\n \"RequestId\": \"abc\"\n }\n}",
|
64
|
+
"title": "资产中心统计"
|
65
|
+
}
|
66
|
+
],
|
59
67
|
"DescribeCVMAssetInfo": [
|
60
68
|
{
|
61
69
|
"document": "接口测试",
|