Creates site monitoring tasks.
Operation description
This topic provides an example on how to create a site monitoring task named HangZhou_ECS1
. The URL that is monitored by the task is https://www.aliyun.com
and the type of the task is HTTP
. The returned result shows that the site monitoring task is created. The name of the site monitoring task is HangZhou_ECS1
and the task ID is 679fbe4f-b80b-4706-91b2-5427b43e****
.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
cms:BatchCreateInstantSiteMonitor | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
TaskList | array<object> | Yes | The site monitoring tasks. Note
You must create at least one site monitoring task. You must specify all of the Address , TaskName , and TaskType parameters in each request.
| |
object | Yes | |||
Address | string | No | The URL or IP address that is monitored by the task. Note
You must create at least one site monitoring task. You must specify all of the Address , TaskName , and TaskType parameters in each request.
| https://www.aliyun.com |
IspCities | string | No | The detection points. If you leave this parameter empty, the system randomly selects three detection points. The value is a For information about how to obtain detection points, see DescribeSiteMonitorISPCityList . | [{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}] |
OptionsJson | string | No | The extended options of the protocol that is used by the site monitoring task. The options vary based on the protocol. | {"time_out":5000} |
TaskName | string | No | The name of the site monitoring task. The name must be 4 to 100 characters in length, and can contain letters, digits, and underscores (_). Note
You must create at least one site monitoring task. You must specify all of the Address , TaskName , and TaskType parameters in each request.
| HangZhou_ECS1 |
TaskType | string | No | The type of the site monitoring task. Valid values: HTTP, PING, TCP, UDP, DNS, SMTP, POP3, and FTP. Note
You must create at least one site monitoring task. You must specify all of the Address , TaskName , and TaskType parameters in each request.
| HTTP |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "7AE72720-2C96-5446-9F2B-308C7CEDFF1A",
"Message": "successful",
"Success": true,
"Data": [
{
"TaskName": "HangZhou_ECS1",
"TaskId": "679fbe4f-b80b-4706-91b2-5427b43e****"
}
],
"Code": "200"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidParameterValue | Illegal parameters. | Illegal parameters. |
400 | ParameterInvalid | The parameter is missing or invalid. %s | - |
403 | InvalidAuthorization | %s | - |
404 | ResourceNotFound | The specified resource is not found. | The specified resource is not found. |
429 | ResourceOverLimit | The resource has exceeded the limit. %s | - |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2022-07-21 | Add Operation | View Change Details |