All Products
Search
Document Center

CloudMonitor:BatchCreateInstantSiteMonitor

Last Updated:Jul 26, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
cms:BatchCreateInstantSiteMonitorcreate
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
TaskListarray<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.
objectYes
AddressstringNo

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
IspCitiesstringNo

The detection points. If you leave this parameter empty, the system randomly selects three detection points.

The value is a JSON array. Example: {"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}. The values of the city field indicate Beijing, Hangzhou, and Qingdao.

For information about how to obtain detection points, see DescribeSiteMonitorISPCityList .

[{"city":"546","isp":"465"},{"city":"572","isp":"465"},{"city":"738","isp":"465"}]
OptionsJsonstringNo

The extended options of the protocol that is used by the site monitoring task. The options vary based on the protocol.

{"time_out":5000}
TaskNamestringNo

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
TaskTypestringNo

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

ParameterTypeDescriptionExample
object

None.

RequestIdstring

The request ID.

7AE72720-2C96-5446-9F2B-308C7CEDFF1A
Messagestring

The returned message.

successful
Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true
Dataarray<object>

The information about the site monitoring task.

[{"taskName": "HangZhou_ECS1", "taskId": "679fbe4f-b80b-4706-91b2-5427b43e****"}]
object
TaskNamestring

The name of the site monitoring task.

HangZhou_ECS1
TaskIdstring

The ID of the site monitoring task.

679fbe4f-b80b-4706-91b2-5427b43e****
Codestring

The HTTP status code.

Note The status code 200 indicates that the request was successful.
200

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError messageDescription
400InvalidParameterValueIllegal parameters.Illegal parameters.
400ParameterInvalidThe parameter is missing or invalid. %s-
403InvalidAuthorization%s-
404ResourceNotFoundThe specified resource is not found.The specified resource is not found.
429ResourceOverLimitThe resource has exceeded the limit. %s-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-07-21Add OperationView Change Details