Modifies a site monitoring task by calling the ModifySiteMonitor operation.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cms:ModifySiteMonitor |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Address |
string |
No |
The URL or IP address of the monitoring task. |
http://www.aliyun.com |
| TaskId |
string |
Yes |
The ID of the monitoring task. |
2c8dbdf9-a3ab-46a1-85a4-f094965e**** |
| TaskName |
string |
No |
The name of the monitoring task. The name must be 4 to 100 characters in length and can contain letters, digits, underscores (_), and Chinese characters. |
HanZhou_ECS2 |
| Interval |
string |
No |
The monitoring frequency. Valid values: 1, 5, and 15. Unit: minutes. Default value: 1. |
1 |
| IspCities |
string |
No |
The detection point information. The value is in JSONArray format, for example: Note
You can call the DescribeSiteMonitorISPCityList operation to query detection point information. For more information, see DescribeSiteMonitorISPCityList. If this parameter is left empty, the system randomly selects three detection points. |
[{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}] |
| OptionsJson |
string |
No |
The advanced extended options for the protocol type of the monitoring task. Different protocol types correspond to different extended options. |
{"time_out":5000} |
| AlertIds |
string |
No |
The ID of the alert rule. The ID of an existing alert rule in CloudMonitor. You can call the DescribeMetricRuleList operation to query alert rule IDs. For more information, see DescribeMetricRuleList. |
49f7c317-7645-4cc9-94fd-ea42e122**** |
| IntervalUnit |
string |
No |
The unit of the monitoring metrics. Unit: milliseconds (ms). |
ms |
| CustomSchedule |
string |
No |
The custom monitoring schedule. You can select a specific time period from Monday to Sunday for monitoring. |
{"start_hour":0,"end_hour":24, "days":[0], "time_zone":"Local"} |
Site monitoring supports the following eight task types. The extended options (OptionsJson) for each task type are described in the following tables.
HTTP.
| Name | Type | Description |
| http_method | String | The HTTP request method. Valid values: GET, POST, and HEAD. Default value: GET. |
| header | String | Custom HTTP headers separated by line feeds (\n). Each header must comply with the HTTP protocol format (key-value pairs separated by a colon). |
| cookie | String | The cookie, which follows the standard HTTP request format. |
| request_content | String | The request content. Two formats are supported: JSON and form. If this parameter is not specified, the request does not contain a body. |
| response_content | String | The expected response content. During monitoring, the first 64 bytes returned by the HTTP server are checked. |
| match_rule | String | 0: The monitoring is successful if the response does not contain response_content. 1: The monitoring is successful if the response contains response_content. |
| username | String | If a username is provided, a BasicAuth header is included in the HTTP request. |
| password | String | The password for HTTP request authentication. |
| time_out | int | The timeout period. Unit: milliseconds. Default value: 5. |
| max_redirect | int | The maximum number of redirects. The default value is 5 for ECS detection points and 2 for carrier detection points. To disable redirects, set this parameter to 0. Valid values: 0 to 50. |
PING.
| Name | Type | Description |
| failure_rate | int | If the PING failure rate exceeds this value, the monitoring fails and returns 610 (PingAllFail) or 615 (PingPartialFail). Default value: 0.1. |
| ping_num | int | The number of PING attempts. Default value: 20. Valid values: 1 to 100. |
DNS.
| Name | Type | Description |
| dns_server | string | The address of the DNS server. The value can be a domain name or an IP address. |
| dns_type | string | The DNS query type. Valid values: A, NS, CNAME, MX, TXT, and ANY. |
| expect_value | string | The list of expected values separated by whitespace characters. |
| match_rule | string | The relationship between the expected value list and the DNS list. If the specified relationship is not met, the monitoring fails. Empty string or IN_DNS: The expected value list is a subset of the DNS list. DNS_IN: The DNS list is a subset of the expected value list. EQUAL: The DNS list is equal to the expected value list. ANY: The DNS list and the expected value list have a non-empty intersection. |
FTP.
| Name | Type | Description |
| port | int | The port number of the FTP server. If this parameter is not specified, the default value is used. Default value for FTP: 21. Default value for FTPs: 990. |
| username | string | The FTP username. If this parameter is not specified, anonymous login is used. |
| password | string | The FTP password. |
POP3/SMTP.
| Name | Type | Description |
| port | int | The port number of the POP3 server. Default value for POP3: 110. Default value for POP3s: 995. |
| username | string | The username for POP3/SMTP. |
| password | string | The password for POP3/SMTP. |
TCP/UDP.
| Name | Type | Description |
| port | int | The port of the TCP/UDP server. |
| request_content | string | The request content. If request_format is set to hex, the value of request_content is in hexadecimal compact format. |
| request_format | string | If request_format is set to other values, request_content is sent to the TCP/UDP server as a plain string. |
| response_content | string | The response content. If the content returned by the TCP/UDP server does not contain response_content, the monitoring fails. If response_format is set to hex, the value of response_content is in hexadecimal compact format. If response_content is set to other values, response_content is a plain string. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The status code. Note
The value 200 indicates success. |
200 |
| Message |
string |
The returned message. |
successful |
| RequestId |
string |
The request ID. |
68192f5d-0d45-4b98-9724-892813f86c71 |
| Success |
string |
Indicates whether the operation was successful. Valid values:
|
true |
| Data |
object |
The details of the node task result. |
|
| count |
integer |
The number of monitoring tasks. |
1 |
Examples
Success response
JSON format
{
"Code": "200",
"Message": "successful",
"RequestId": "68192f5d-0d45-4b98-9724-892813f86c71",
"Success": "true",
"Data": {
"count": 1
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidQueryParameter | %s | |
| 400 | IllegalAddress | Illegal HTTP address | |
| 400 | OperationError | Operation failed | |
| 400 | TaskNotExists | Task does not exist | |
| 400 | OperatorInvalid | %s | |
| 400 | NameRepeat | Task name repeat | |
| 400 | CreateAlarmError | Create alarm error | |
| 400 | NameNotExists | Task name not exists | |
| 400 | OperatorCityInvalid | Invalid Isp. | Invalid Isp |
| 401 | AccessDeniedException | You donot have sufficient access to perform this action. | |
| 500 | InternalError | %s | |
| 500 | InternetServerError | System internal error. | System internal error |
| 402 | LimitExceeded | The quota for this customer had been reached. | |
| 403 | Forbidden | You are not authorized to operate the specified resource. | No permission, please use RAM to authorize |
| 403 | RestrictedUser | The user's operation is restricted, please register NAAM product code. | |
| 403 | UnauthorizedTasks | You are not permitted to operate the specified tasks. | You are not permitted to operate the specified tasks. |
| 404 | TaskNotExist | The specified task does not exist. | The specified task does not exist. |
| 406 | ExceedingQuota | Exceeding quota limits. | The number of tasks exceeds the limit |
| 429 | ThrottlingException | The request was denied due to request throttling. | |
| 409 | %s | %s |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.