You can call the BatchCreateInstantSiteMonitor operation to create a batch of site monitoring tasks.
Operation description
This topic provides an example of how to create a site monitoring task named HangZhou_ECS1. The task uses the HTTP protocol to monitor https://www.aliyun.com. The response shows that the task is successfully created with the name HangZhou_ECS1 and the ID 679fbe4f-b80b-4706-91b2-5427b43e****.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cms:BatchCreateInstantSiteMonitor |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| TaskList |
array<object> |
Yes |
The list of site monitoring tasks. Note
You must create at least one site monitoring task. The |
|
|
object |
No |
The list of site monitoring tasks. |
||
| Address |
string |
No |
The URL or IP address of the site monitoring task. Note
You must create at least one site monitoring task. The |
https://www.aliyun.com |
| IspCities |
string |
No |
The information about the detection points. If you leave this parameter empty, the system randomly selects three detection points. The value must be a For more information about how to obtain detection point information, see DescribeSiteMonitorISPCityList. |
[{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}] |
| OptionsJson |
string |
No |
The advanced extension options for the protocol type of the site monitoring task. Different protocol types correspond to different extension options. |
{"time_out":5000} |
| TaskName |
string |
No |
The name of the site monitoring task. The name of the site monitoring task. Note
You must create at least one site monitoring task. The |
HangZhou_ECS1 |
| TaskType |
string |
No |
The protocol type of the monitoring task. Valid values: HTTP, PING, TCP, UDP, DNS, SMTP, POP3, and FTP. Note
You must create at least one site monitoring task. The |
HTTP |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
None. |
||
| RequestId |
string |
The request ID. |
7AE72720-2C96-5446-9F2B-308C7CEDFF1A |
| Message |
string |
The returned message. |
successful |
| Success |
boolean |
Indicates whether the operation was successful. Valid values:
|
true |
| Data |
array<object> |
The information about the site monitoring tasks. |
[{"taskName": "HangZhou_ECS1", "taskId": "679fbe4f-b80b-4706-91b2-5427b43e****"}] |
|
object |
The information about the site monitoring tasks. |
||
| TaskName |
string |
The name of the site monitoring task. |
HangZhou_ECS1 |
| TaskId |
string |
The ID of the site monitoring task. |
679fbe4f-b80b-4706-91b2-5427b43e**** |
| Code |
string |
The status code. Note
A value of 200 indicates that the request was successful. |
200 |
Examples
Success response
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 | Forbidden | You are not authorized to operate the specified resource. | No permission, please use RAM to authorize |
| 404 | ResourceNotFound | The specified resource is not found. | The specified resource is not found. |
| 429 | ResourceOverLimit | The resource has exceeded the limit. %s |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.