ModifySiteMonitor

Updated at:

Modifies a site monitoring task.

Operation description

This operation modifies an existing site monitoring task. Before calling this operation, call DescribeSiteMonitorList to query the tasks under the target account and obtain the TaskId. If no task exists, call CreateSiteMonitor to create one first. Before creating a task, call DescribeMonitorResourceQuotaAttribute to check the quota and usage of ResourceQuota.SiteMonitorTask, as well as the SuitInfo package information. If no available quota exists, adjust the package or quota first.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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 probe information. The value is a JSON array. Example: [{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}]. The city values correspond to Beijing, Hangzhou, and Qingdao, respectively.

Note

You can call the DescribeSiteMonitorISPCityList operation to obtain the 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 extension options for the protocol type of the monitoring task. Different protocol types correspond to different extension options.

{"time_out":5000}

AlertIds

string

No

The ID of the alert rule. The alert rule must already exist in CloudMonitor. You can call the DescribeMetricRuleList operation to query the alert rule ID. 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 detection period. You can only select a specific time period from Monday to Sunday for detection.

{"start_hour":0,"end_hour":24, "days":[0], "time_zone":"Local"}

Site monitoring supports the following eight task types. The extension parameters (OptionsJson) for each task type are described in the following tables.

  • HTTP.

NameTypeDescription
http_methodStringThe HTTP request method. Valid values: GET, POST, and HEAD. Default value: GET.
headerStringThe custom HTTP headers separated by line breaks (\n).
The format of each header must comply with the HTTP protocol, which uses key-value pairs separated by colons.

cookieStringThe cookie. The format is the same as that of a standard HTTP request.
request_contentStringThe request content. Valid formats: JSON and form. If this parameter is not specified, the request does not contain a body.
response_contentStringThe expected response content. During probing, the system checks the first 64 bytes returned by the HTTP server.
match_ruleStringThe matching rule. Valid values:
0: The probing is successful if the response does not contain the response_content.
1: The probing is successful if the response contains the response_content.




usernameStringThe username. If this parameter is specified, the HTTP request carries the BasicAuth header.
passwordStringThe password for HTTP request authentication.
time_outintThe timeout period. Unit: milliseconds. Default value: 5.
max_redirectintThe maximum number of redirects. Default value: 5 for ECS probes and 2 for carrier probes.
To disable redirects, set this parameter to 0.
Valid values: 0 to 50.




  • PING

NameTypeDescription
failure_rateintThe failure rate threshold. If the PING failure rate exceeds this value, the probing fails and 610 (PingAllFail) or 615 (PingPartialFail) is returned.
Default value: 0.1.

ping_numintThe number of PING requests. Default value: 20.
Valid values: 1 to 100.

  • DNS.

NameTypeDescription
dns_serverstringThe address of the DNS server. The value can be a domain name or an IP address.
dns_typestringThe DNS query type. Valid values: A, NS, CNAME, MX, TXT, and ANY.
expect_valuestringThe list of expected values separated by spaces.
match_rulestringThe relationship between the expected value list and the DNS record list. If the specified relationship is not met, the probing fails.
Empty string or IN_DNS: The expected value list is a subset of the DNS record list.
DNS_IN: The DNS record list is a subset of the expected value list.
EQUAL: The DNS record list is equal to the expected value list.
ANY: The DNS record list and the expected value list have a non-empty intersection.










  • FTP.

NameTypeDescription
portintThe port number of the FTP server. If this parameter is not specified, the default value is used. Default value: 21 for FTP and 990 for FTPS.
usernamestringThe FTP username. If this parameter is not specified, anonymous logon is used.
passwordstringThe FTP password.
  • POP3/SMTP.

NameTypeDescription
portintThe port number of the POP3 server. Default value: 110 for POP3 and 995 for POP3S.
usernamestringThe POP3/SMTP username.
passwordstringThe POP3/SMTP password.
  • TCP/UDP.

NameTypeDescription
portintThe port number of the TCP/UDP server.
request_contentstringThe request content. If request_format is set to hex, the value of request_content is in hexadecimal compact format.
request_formatstringThe request format. If request_format is set to a value other than hex, the value of request_content is sent to the TCP/UDP server as a plain string.
response_contentstringThe response content. If the content returned by the TCP/UDP server does not contain the response_content, the probing fails.
If response_format is set to hex, the value of response_content is in hexadecimal compact format.
If response_format is set to a value other than hex, the value of response_content is a plain string.




Response elements

Element

Type

Description

Example

object

Code

string

The status code.

Note

A value of 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: The operation was successful.

  • false: The operation failed.

true

Data

object

The details of the node modification 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 DryRunOperation Request validation has been passed with DryRun flag set.
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.