Domain name for API request: cfg.tencentcloudapi.com.
This API is used to obtain the action list of Chaotic Fault Generator.
A maximum of 100 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: DescribeActionLibraryList. |
Version | Yes | String | Common Params. The value used for this API: 2021-08-20. |
Region | No | String | Common Params. This parameter is not required. |
Limit | Yes | Integer | 0-100 |
Offset | Yes | Integer | Default value: 0 |
ObjectType | Yes | Integer | Object type ID |
Filters.N | No | Array of ActionFilter | Keyword value {"action name": "a_title", "description": "a_desc", "action type": "a_type", "creation time": "a_create_time", "level-2 type": "a_resource_type"} |
Attribute.N | No | Array of Integer | Action type. 1: fault action; 2: recovery action. |
ActionIds.N | No | Array of Integer | Filter item - action ID |
Parameter Name | Type | Description |
---|---|---|
Results | Array of ActionLibraryListResult | Query result list |
Total | Integer | Number of matching records |
RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
This example shows you how to query the data in the list of the action library.
POST / HTTP/1.1
Host: cfg.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeActionLibraryList
<Common request parameters>
{
"Limit": 10,
"Offset": 0,
"Filters": [
{
"Keyword": "a_type",
"Values": [
"1"
]
}
],
"ObjectType": 1,
"Attribute": [
1
]
}
{
"Response": {
"RequestId": "cZ6m0xYnnDreBNJm",
"Results": [
{
"ActionName": "Shut down (testing)",
"Desc": "Shut down the CVM.",
"ActionType": "Platform",
"CreateTime": "2023-07-04 11:20:43",
"Creator": "System",
"UpdateTime": "2023-07-04 11:20:43",
"RiskDesc": "High risk",
"ActionId": 1,
"AttributeId": 1,
"RelationActionId": 2,
"ActionCommand": "Call the API interfaces of Tencent Cloud's corresponding products.",
"ActionContent": "Call the cloud API StopInstances.",
"ActionCommandType": 1,
"ActionDetail": "<p>Call the cloud API <a href=\"https://www.tencentcloud.com/document/product/213/15743?from_cn_redirect=1\">StopInstances</a> to shut down CVMs.</p>",
"ResourceType": "Server resources",
"IsAllowed": true,
"ActionBestCase": "https://www.tencentcloud.com/document/product/1500/74357?from_cn_redirect=1",
"ObjectType": "CVM",
"MetricIdList": [
614,
615
]
},
{
"ActionName": "Start up",
"Desc": "Start up the CVM.",
"ActionType": "Platform",
"CreateTime": "2022-11-29 18:08:46",
"Creator": "System",
"UpdateTime": "2022-11-29 18:08:46",
"RiskDesc": "High risk",
"ActionId": 2,
"AttributeId": 2,
"RelationActionId": 1,
"ActionCommand": "Call the API interfaces of Tencent Cloud's corresponding products.",
"ActionContent": "Call the cloud API StartInstances.",
"ActionCommandType": 1,
"ActionDetail": "<p>Call the cloud API <a href=\"https://www.tencentcloud.com/document/product/213/15735?from_cn_redirect=1\">StartInstances</a> to start CVMs.</p>",
"ResourceType": "Server resources",
"IsAllowed": true,
"ActionBestCase": "",
"ObjectType": "CVM",
"MetricIdList": []
},
{
"ActionName": "Restart",
"Desc": "Restart",
"ActionType": "Platform",
"CreateTime": "2023-05-24 15:33:39",
"Creator": "System",
"UpdateTime": "2023-05-24 15:33:39",
"RiskDesc": "High risk",
"ActionId": 3,
"AttributeId": 1,
"RelationActionId": 0,
"ActionCommand": "Call the API interfaces of Tencent Cloud's corresponding products.",
"ActionContent": "Call the cloud API RebootInstances.",
"ActionCommandType": 1,
"ActionDetail": "<p>Call the cloud API <a href=\"https://www.tencentcloud.com/document/product/213/15742?from_cn_redirect=1\">RebootInstances</a> to restart CVMs.</p>",
"ResourceType": "Server resources",
"IsAllowed": true,
"ActionBestCase": "https://tcloud4api.woa.com/document/product/1607/88863?!preview&!document=1",
"ObjectType": "CVM",
"MetricIdList": []
},
{
"ActionName": "Check for high disk partition usage",
"Desc": "Use the stress-ng stress testing tool to perform stress testing. Supported Linux distributions: Centos7.2 and later; CoreOS 1745.5.0 and later; Debian9.0 and later; Ubuntu 16.04.1 and later",
"ActionType": "Platform",
"CreateTime": "2022-11-29 18:08:46",
"Creator": "System",
"UpdateTime": "2022-11-29 18:08:46",
"RiskDesc": "High risk",
"ActionId": 4,
"AttributeId": 1,
"RelationActionId": 0,
"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",
"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",
"ActionCommandType": 0,
"ActionDetail": "<p>Use the tat channel to deliver the stress-ng command for stress testing.</p>\n<p>Command content: stress-ng -c 0 -l {{percentage}} --timeout {{timeout}}</p>\n<p><a href=\"https://cloud.tencent.com/document/api/1340/52676\">tat official documentation</a></p>\n<p><a href=\"https://wiki.ubuntu.com/Kernel/Reference/stress-ng\">stress-ng official documentation</a></p>\n",
"ResourceType": "CPU resources",
"IsAllowed": true,
"ActionBestCase": "",
"ObjectType": "CVM",
"MetricIdList": []
},
{
"ActionName": "Check for high memory utilization",
"Desc": "Use the stress-ng stress testing tool to perform stress testing. Supported Linux distributions: Centos7.2 and later; CoreOS 1745.5.0 and later; Debian9.0 and later; Ubuntu 16.04.1 and later",
"ActionType": "Platform",
"CreateTime": "2022-11-29 18:08:46",
"Creator": "System",
"UpdateTime": "2022-11-29 18:08:46",
"RiskDesc": "High risk",
"ActionId": 7,
"AttributeId": 1,
"RelationActionId": 0,
"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",
"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",
"ActionCommandType": 0,
"ActionDetail": "<p> Use the tat channel to issue the stress-ng command for stress testing</p> \n<p> Command content: 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 official documentation</a></p>\n<p><a href=\"https://wiki.ubuntu.com/Kernel/Reference/stress-ng\">stress-ng official documentation</a></p>",
"ResourceType": "Memory resources",
"IsAllowed": true,
"ActionBestCase": "",
"ObjectType": "CVM",
"MetricIdList": []
},
{
"ActionName": "Check for high disk partition utilization",
"Desc": "Use the stress-ng stress testing tool to perform stress testing. Supported Linux distributions: Centos7.2 and later; CoreOS 1745.5.0 and later; Debian9.0 and later; Ubuntu 16.04.1 and later",
"ActionType": "Platform",
"CreateTime": "2022-11-29 18:08:46",
"Creator": "System",
"UpdateTime": "2022-11-29 18:08:46",
"RiskDesc": "High risk",
"ActionId": 8,
"AttributeId": 1,
"RelationActionId": 0,
"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",
"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",
"ActionCommandType": 0,
"ActionDetail": "<p>Use the tat channel to deliver the stress-ng command for stress testing</p>\n<p>Command content: 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 official documentation</a></p>\n<p><a href=\"https://wiki.ubuntu.com/Kernel/Reference/stress-ng\">stress-ng official documentation</a></p>\n",
"ResourceType": "Disk resources",
"IsAllowed": true,
"ActionBestCase": "",
"ObjectType": "CVM",
"MetricIdList": []
},
{
"ActionName": "Kernel Fault",
"Desc": "Trigger the restart of instances",
"ActionType": "Platform",
"CreateTime": "2022-11-29 18:08:46",
"Creator": "System",
"UpdateTime": "2022-11-29 18:08:46",
"RiskDesc": "High risk",
"ActionId": 9,
"AttributeId": 1,
"RelationActionId": 24,
"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 &",
"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 &",
"ActionCommandType": 0,
"ActionDetail": "<p>Use the tat channel to deliver kernel fault commands</p>\n<p>Command content: echo c > /proc/sysrq-trigger</p>\n<p><a href=\"https://cloud.tencent.com/document/api/1340/52676\">tat official documentation</a></p>",
"ResourceType": "CPU resources",
"IsAllowed": true,
"ActionBestCase": "",
"ObjectType": "CVM",
"MetricIdList": []
},
{
"ActionName": "Check disk IO load",
"Desc": "Use the stress-ng stress testing tool to perform stress testing. Supported Linux distributions: Centos7.2 and later; CoreOS 1745.5.0 and later; Debian9.0 and later; Ubuntu 16.04.1 and later",
"ActionType": "Platform",
"CreateTime": "2022-11-29 18:08:46",
"Creator": "System",
"UpdateTime": "2022-11-29 18:08:46",
"RiskDesc": "High risk",
"ActionId": 10,
"AttributeId": 1,
"RelationActionId": 0,
"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",
"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",
"ActionCommandType": 0,
"ActionDetail": "<p>Use the tat channel to deliver the stress-ng command for stress testing.</p>\n<p>Command content: 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 official documentation</a></p>",
"ResourceType": "IO resources",
"IsAllowed": true,
"ActionBestCase": "",
"ObjectType": "CVM",
"MetricIdList": []
},
{
"ActionName": "Check for OOM",
"Desc": "Use the stress-ng stress testing tool to perform stress testing. Supported Linux distributions: Centos7.2 and later; CoreOS 1745.5.0 and later; Debian9.0 and later; Ubuntu 16.04.1 and later",
"ActionType": "Platform",
"CreateTime": "2023-07-04 11:20:43",
"Creator": "System",
"UpdateTime": "2023-07-04 11:20:43",
"RiskDesc": "High risk",
"ActionId": 11,
"AttributeId": 1,
"RelationActionId": 0,
"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",
"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",
"ActionCommandType": 0,
"ActionDetail": "<p>Use the tat channel to deliver the stress-ng command for stress testing</p>\n<p>Command content: stress-ng --bigheap 10 --bigheap-growth 4K -t {{timeout}}</p>\n<p><a href=\"https://cloud.tencent.com/document/api/1340/52676\">tat official documentation</a></p>",
"ResourceType": "Memory resources",
"IsAllowed": true,
"ActionBestCase": "https://www.tencentcloud.com/document/product/1500/81504?from_cn_redirect=1",
"ObjectType": "CVM",
"MetricIdList": []
},
{
"ActionName": "Empty operation",
"Desc": "Empty operation. It is used to test the process with no actual injection operation.",
"ActionType": "Platform",
"CreateTime": "2022-11-29 18:08:46",
"Creator": "System",
"UpdateTime": "2022-11-29 18:08:46",
"RiskDesc": "Low risk",
"ActionId": 12,
"AttributeId": 1,
"RelationActionId": 13,
"ActionCommand": "Call the API interfaces of Tencent Cloud's corresponding products.",
"ActionContent": "Empty operation",
"ActionCommandType": 1,
"ActionDetail": null,
"ResourceType": "Other",
"IsAllowed": true,
"ActionBestCase": "",
"ObjectType": "CVM",
"MetricIdList": []
}
],
"Total": 45
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
InternalError | Internal error. |
InvalidParameter | Parameter error. |
InvalidParameterValue | Parameter value error. |
MissingParameter | Parameters are missing |
UnsupportedOperation | The operation is not supported. |
Was this page helpful?