All Products
Search
Document Center

Application Real-Time Monitoring Service:CreateTimingSyntheticTask

Last Updated:Sep 20, 2024

Creates a scheduled synthetic test task.

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
arms:CreateTimingSyntheticTaskcreate
  • SyntheticTask
    acs:arms:{#regionId}:{#accountId}:synthetictask/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID.

cn-hangzhou
NamestringYes

The name of the task.

demo-test
TaskTypeintegerYes

The type of the task. Valid values:

1: ICMP. 2: TCP. 3: DNS. 4: HTTP. 5: website speed measurement. 6: file download.

4
MonitorConfobjectYes

The monitoring configurations.

NetICMPobjectNo

The parameters of the ICMP synthetic test. This parameter is required if the TaskType parameter is set to 1.

TargetUrlstringYes

The destination IP address or domain name.

www.example.com
IntervallongNo

The interval at which ICMP packets are sent. Unit: milliseconds. Minimum value: 200. Maximum value: 2000. Default value: 200.

200
PackageNumintegerNo

The number of ICMP packets that are sent. Minimum value: 1. Maximum value: 50. Default value: 4.

4
PackageSizeintegerNo

The size of each ICMP packet. Unit: bytes. Valid values: 32, 64, 128, 256, 512, 1024, 1080, and 1450.

32
SplitPackagebooleanNo

Specifies whether to split ICMP packets. Default value: true.

true
TimeoutlongNo

The timeout period for the ICMP synthetic test. Unit: milliseconds. Minimum value: 1000. Maximum value: 300000. Default value: 20000.

20000
TracertEnablebooleanNo

Specifies whether to enable the tracert command. Default value: true.

true
TracertNumMaxintegerNo

The maximum number of hops for the tracert command. Minimum value: 1. Maximum value: 128. Default value: 20.

20
TracertTimeoutlongNo

The timeout period of the tracert command. Unit: milliseconds. Minimum value: 1000. Maximum value: 300000. Default value: 60000.

60000
NetTCPobjectNo

The parameters of the TCP synthetic test. This parameter is required if the TaskType parameter is set to 2.

TargetUrlstringYes

The IP address of the destination host.

www.example.com
ConnectTimesintegerNo

The number of TCP connections that are established. Minimum value: 1. Maximum value: 16. Default value: 4.

4
IntervallongNo

The interval at which TCP connections are established. Unit: milliseconds. Minimum value: 200. Maximum value: 10000. Default value: 200.

200
TimeoutlongNo

The timeout period for the TCP synthetic test. Unit: milliseconds. Minimum value: 1000. Maximum value: 300000. Default value: 20000.

20000
TracertEnablebooleanNo

Specifies whether to enable the tracert command. Default value: true.

true
TracertNumMaxintegerNo

The maximum number of hops for the tracert command. Minimum value: 1. Maximum value: 128. Default value: 20.

20
TracertTimeoutlongNo

The timeout period of the tracert command. Unit: milliseconds. Minimum value: 1000. Maximum value: 300000. Default value: 60000.

60000
NetDNSobjectNo

The parameters of the DNS synthetic test. This parameter is required if the TaskType parameter is set to 3.

TargetUrlstringYes

The destination domain name.

www.aliyun.com
DnsServerIpTypeintegerNo

The IP version of the DNS server.

  • 0 (default): IPv4.
  • 1: IPv6.
  • 2: A version is automatically selected.
0
NsServerstringNo

The IP address of the DNS server. Default value: 114.114.114.114.

114.114.114.114
QueryMethodintegerNo

The DNS query method. Valid values:

  • 0 (default): recursive
  • 1: iterative
0
TimeoutlongNo

The timeout period for the DNS synthetic test. Unit: milliseconds. Minimum value: 1000. Maximum value: 45000. Default value: 5000.

5000
ApiHTTPobjectNo

The parameters of the HTTP(S) synthetic test.

TargetUrlstringYes

The URL or request path for synthetic monitoring.

http://www.demo.com/api/list
MethodstringNo

The request method. Valid values: GET and POST.

GET
RequestHeadersobjectNo

The HTTP request header.

stringNo

Format: JSON map.

{ "key1": "value1", "key2": "value2" }
RequestBodyobjectNo

The HTTP request body.

ContentstringNo

The content of the request body. Format: JSON string. The parameter is required if the Type parameter is set to text/plain, application/json, application/xml, or text/html. Format: JSON string.

{ "key1": "value1", "key2": "value2" }
TypestringNo

The type of the request body. Valid values: text/plain, application/json, application/x-www-form-urlencoded, multipart/form-data, application/xml, and text/html.

application/json
ConnectTimeoutlongNo

The connection timeout period. Unit: milliseconds. Default value: 5000. Minimum value: 1000. Maximum value: 300000.

5000
TimeoutlongNo

The timeout period. Unit: milliseconds. Default value: 10000. Minimum value: 1000. Maximum value: 300000.

10000
CheckCertbooleanNo

Specifies whether to verify the certificate. Default value: no.

true
ProtocolAlpnProtocolintegerNo

The ALPN protocol version. You can configure this parameter when you perform an HTTPS synthetic test on a WAP mobile client. Valid values:

0: default

1: http/1.1

2: h2

3: disables the ALPN protocol

1
WebsiteobjectNo

The parameters of the website speed measurement.

TargetUrlstringYes

The URL of the website.

https://www.aliyun.com
AutomaticScrollingintegerNo

Specifies whether to automatically scroll up and down the screen to load a page.

  • 0 (default): no
  • 1: yes
0
CustomHeaderintegerNo

Specifies whether to create a custom header.

  • 0 (default): No custom header is created.
  • 1: A custom header is created for the first packet.
  • 2: A custom header is created for all packets.
0
CustomHeaderContentobjectNo

The custom header. Format: JSON map.

stringNo

JSON Map

{ "key1": "value1", "key2": "value2" }
DisableCacheintegerNo

Specifies whether to disable caching.

  • 0: no
  • 1 (default): yes
1
DisableCompressionintegerNo

Specifies whether to accept compressed files based on the HTTP Accept-Encoding request header. Valid values: 0: no. 1: yes. Default value: 0.

0
FilterInvalidIPintegerNo

Specifies whether to exclude invalid IP addresses. Valid values: 0: yes. 1: no. Default value: 0.

0
IgnoreCertificateErrorintegerNo

Specifies whether to ignore certificate errors during certificate verification in the SSL handshake process and continue browsing. Valid values: 0: no. 1: yes. Default value: 1.

1
MonitorTimeoutlongNo

The monitoring timeout period. Unit: milliseconds. This parameter is optional. Default value: 20000.

20000
RedirectionintegerNo

Specifies whether to continue browsing after redirection. Valid values: 0: no. 1: yes. Default value: 1.

1
SlowElementThresholdlongNo

The time threshold that is used to define a slow element. Unit: milliseconds. Default value: 5000. Minimum value: 1. Maximum value: 300000.

5000
WaitCompletionTimelongNo

The maximum waiting time. Unit: milliseconds. Default value: 5000. Minimum value: 5000. Maximum value: 300000.

5000
VerifyStringBlackliststringNo

An arbitrary string in the source code of the page for verification. If the source code returned by the client contains a string that is in the blacklist, the 650 error code is reported, which indicates that the string fails to be verified. Separate multiple strings with vertical bars (|).

error
VerifyStringWhiteliststringNo

An arbitrary string in the source code of the page for verification. If the source code returned by the client contains a string that is not in the whitelist, the 650 error code is reported, which indicates that the string fails to be verified. Separate multiple strings with vertical bars (|).

success
ElementBlackliststringNo

The elements not to be loaded in the page loading process.

www.example.com/a.jpg
DNSHijackWhiteliststringNo

If the IP address or CNAME record resolved from a domain name is not included in the DNS whitelist, you cannot access the domain name, or an IP address that belongs to a different domain name is returned. If the IP address or CNAME record is included in the DNS whitelist, DNS hijacking does not occur.

Format: <domain name>:<objects>. The objects can be IP addresses, wildcard mask, subnet mask, or CNAME records. Separate multiple objects with vertical bars (|). Example: www.aliyun.com:203.0.3.55|203.3.44.67. It indicates that all IP addresses that belong to the www.aliyun.com domain name except 203.0.3.55 and 203.3.44.67 are hijacked.

www.aliyun.com:203.0.3.55|203.3.44.67
PageTamperstringNo

Elements that are not included in the whitelist and appear on the page are tampered with. These elements can be pop-up ads, floating ads, and page redirection.

Format: <domain name>:<elements>. The elements can be wildcard masks. Separate multiple elements with vertical bars (|). Example: www.aliyun.com:|/cc/bb/a.gif|/vv/bb/cc.jpg. It indicates that all elements that belong to the www.aliyun.com domain name except the basic documents, /cc/bb/a.gif, and /vv/bb/cc.jpg are tampered with.

www.aliyun.com:|/cc/bb/a.gif|/vv/bb/cc.jpg
FlowHijackJumpTimesintegerNo

The total number of elements on the page.

10
FileDownloadobjectNo

The parameters of file downloading.

TargetUrlstringYes

The URL that is used to download the file.

https://img.alicdn.com/tfs/TB13DzOjXP7gK0jSZFjXXc5aXXa-212-48.png
DownloadKernelintegerNo

The kernel type. Valid values:

  • 1: curl
  • 0: WinInet

Default value: 1

1
QuickProtocolintegerNo

The QUIC protocol type. Valid values:

  • 1: HTTP/1
  • 2: HTTP/2
  • 3: HTTP/3

Default value: 1

1
ConnectionTimeoutlongNo

Unit: milliseconds. Minimum value: 1000. Maximum value: 120000. Default value: 5000.

5000
MonitorTimeoutlongNo

The monitoring timeout period. Unit: milliseconds. Minimum value: 1000. Maximum value: 120000. Default value: 60000.

60000
CustomHeaderContentobjectNo

The content of the custom request header.

stringNo

Format: JSON map.

{ "key1": "value1", "key2": "value2" }
IgnoreCertificateStatusErrorintegerNo

Specifies whether to ignore certificate status errors. Valid values: 0: no. 1: yes. Default value: 1.

1
IgnoreCertificateUntrustworthyErrorintegerNo

Specifies whether to ignore certificate incredibility. Valid values: 0: no. 1: yes. Default value: 1.

1
IgnoreInvalidHostErrorintegerNo

Specifies whether to ignore host invalidity. Valid values: 0: no. 1: yes. Default value: 1.

1
RedirectionintegerNo

Specifies whether to support redirection. Valid values: 0: no. 1: yes. Default value: 1.

1
TransmissionSizelongNo

The maximum file size of a single transfer. Unit: KB. Minimum value: 1. Maximum value: 20480. Valid values: 2048.

2048
IgnoreCertificateCanceledErrorintegerNo

Specifies whether to ignore certificate revocation errors. Valid values: 0: no. 1: yes. Default value: 1.

1
IgnoreCertificateAuthErrorintegerNo

Specifies whether to ignore CA certificate authentication errors. Valid values: 0: no. 1: yes. Default value: 1.

1
IgnoreCertificateOutOfDateErrorintegerNo

Specifies whether to ignore certificate invalidity. Valid values: 0: no. 1: yes. Default value: 1.

1
IgnoreCertificateUsingErrorintegerNo

Specifies whether to ignore certificate usage errors. Valid values: 0: no. 1: yes. Default value: 1.

1
VerifyWayintegerNo

The verification method. Valid values:

  • 0: no verification
  • 1: string verification
  • 2: MD5 verification
0
ValidateKeywordsstringNo

The keyword that is used in verification.

aliyun
WhiteListstringNo

The whitelisted objects that are used to avoid DNS hijacking. The objects can be IP addresses, wildcard mask, subnet mask, or CNAME records. Separate multiple objects with vertical bars (|). Example: www.aliyun.com:203.0.3.55|203.3.44.67. It indicates that all IP addresses that belong to the www.aliyun.com domain name except 203.0.3.55 and 203.3.44.67 are hijacked.

www.aliyun.com:203.0.3.55|203.3.44.67
StreamobjectNo

The parameters of the streaming-media synthetic test.

TargetUrlstringNo

The resource URL of the streaming media.

http://www.aliyun.com/stream/test.mp4
StreamTypeintegerNo

Specifies whether the resource is a video or audio. Valid values: 0: video. 1: audio.

0
StreamMonitorTimeoutintegerNo

The monitoring duration. Unit: seconds. Maximum and default value: 60.

30
StreamAddressTypeintegerNo

The address type of the resource. Valid values:

  • 1: resource URL
  • 0 (default): page URL
0
PlayerTypeintegerNo

The player. Default value: 12. Valid values:

  • 12: VLC
  • 2: Flash Player
12
CustomHeaderContentobjectNo

The custom header. Format: JSON map.

stringNo

The custom header. Format: JSON map.

{ "key1": "value1", "key2": "value2" }
WhiteListstringNo

The whitelisted objects that are used to avoid DNS hijacking. The objects can be IP addresses, wildcard mask, subnet mask, or CNAME records. Separate multiple objects with vertical bars (|). Example: www.aliyun.com:203.0.3.55|203.3.44.67. It indicates that all IP addresses that belong to the www.aliyun.com domain name except 203.0.3.55 and 203.3.44.67 are hijacked.

www.aliyun.com:203.0.3.55|203.3.44.67
MonitorCategoryintegerYes

The detection point type. Valid values:

  • 1: PC
  • 2: mobile device
1
Monitorsarray<object>Yes

The list of detection points.

objectYes
CityCodestringYes

The city code.

100023
OperatorCodestringYes

The carrier code.

1
ClientTypeintegerYes

The client type of the detection point. Valid values:

  • 1: data center
  • 2: Internet
  • 3: mobile device
  • 4: ECS instance
1
FrequencystringYes

The detection frequency. Valid values: 1m, 5m, 10m, 15m, 20m, 30m, 1h, 2h, 3h, 4h, 6h, 8h, 12h, and 24h.

5m
CustomPeriodobjectNo

The general settings.

EndHourintegerYes

The custom host settings.

22
StartHourintegerYes

The list of hosts.

8
CommonSettingobjectNo

The general settings.

CustomHostobjectNo

The custom host settings.

Hostsarray<object>Yes

The list of hosts.

objectYes

The custom host settings.

DomainstringYes

The domain name.

www.aliyun.com
IpTypeintegerYes

The IP version. Valid values:

  • 0: A version is automatically selected.
  • 1: IPv4.
  • 2: IPv6.
0
IpsarrayYes

The list of IP addresses.

stringYes

The IP address.

10.176.141.63
SelectTypeintegerYes

The selection mode. Valid values:

  • 0: random
  • 1: polling
0
IpTypeintegerNo

The IP version. Valid values:

  • 0: A version is automatically selected.
  • 1: IPv4.
  • 2: IPv6.
0
MonitorSamplesintegerNo

Specifies whether to evenly distribute monitoring samples. Valid values:

  • 0: no
  • 1: yes
0
IsOpenTracebooleanNo

Specifies whether to enable tracing.

true
TraceClientTypeintegerNo

The type of the client for tracing. Valid values:

  • 0: ARMS agent
  • 1: OpenTelemetry
  • 2: Jaeger
1
XtraceRegionstringNo

The region to which trace data is reported.

cn-hangzhou
CustomVPCSettingobjectNo

The information about the virtual private cloud (VPC). If the destination URL is an Alibaba Cloud internal endpoint, you need to configure a VPC.

RegionIdstringNo

The region ID.

cn-hangzhou
VpcIdstringNo

VPC ID.

vpc-bp1muectbr8f90vjxxxxx
VSwitchIdstringNo

The vSwitch ID.

vsw-bp14crq29vpycxp8xxxxx
SecureGroupIdstringNo

The ID of the security group to which the client belongs. The security group specifies the inbound and outbound rules of the client for the VPC. You need to allow the security group to which the client belongs to access the security group to which the VPC belongs. Otherwise, the client cannot access resources in the VPC.

sg-bp13wzf9vuwegmpxxxxx
CustomPrometheusSettingobjectNo

The reserved parameters.

PrometheusLabelsobjectNo

A reserved parameter.

stringNo

A reserved parameter.

null
PrometheusClusterIdstringNo

A reserved parameter.

null
PrometheusClusterRegionstringNo

A reserved parameter.

null
AvailableAssertionsarray<object>No

The list of assertions.

objectYes
TypestringYes

The assertion type. Valid values: HttpResCode, HttpResHead, HttpResBody, HttpResBodyJson, HttpResponseTime, IcmpPackLoss (packet loss rate), IcmpPackMaxLatency (maximum packet latency), IcmpPackAvgLatency (average packet latency), TraceRouteHops (number of hops), DnsARecord (A record), DnsCName (CNAME), websiteTTFB (time to first packet), websiteTTLB (time to last packet), websiteFST (first paint time), websiteFFST (first meaningful paint), websiteOnload (full loaded time). For more information, see the following description.

DnsARecord
TargetstringNo

The check target. If you set the type parameter to HttpResCode, HttpResBody, or HttpResponseTime, you do not need to set the target parameter. If you set the type parameter to HttpResHead, you must specify the key in the header. If you set the type parameter to HttpResBodyJson, use jsonPath.

key
OperatorstringYes

The condition. gt: greater than. gte: greater than or equal to. lt: less than. lte: less than or equal to. eq: equal to. neq: not equal to. ctn: contain. nctn: does not contain. exist: exist. n_exist: does not exist. belong: belong to. n_belong: does not belong to. reg_match: regular expression.

eq
ExpectstringYes

The expected value.

200
ResourceGroupIdstringNo

The parameter is optional.

xxxx
Tagsarray<object>No

The tag list.

objectNo
KeystringNo

The key of the tag.

Key
ValuestringNo

The value of the tag.

500

Assertion description:

HTTP synthetic tests

If the type parameter is set to HttpResCode, the Operator parameter supports the following values: eq, neq, gt, gte, lt, lte, belong, and n_belong. If the type parameter is set to HttpResHead, the Operator parameter supports all values. If the type parameter is set to HttpResBody, the Operator parameter supports all values. If the type parameter is set to HttpResBodyJson, the Operator parameter supports all values. If the type parameter is set to HttpResponseTime, the Operator parameter supports the following values: gt, gte, lt, lte, eq, and belong.

ICMP synthetic tests

If the type parameter is set to IcmpPackLoss, the Operator parameter supports the following values: gt, gte, lt, lte, eq, and belong. If the type parameter is set to IcmpPackMaxLatency, the Operator parameter supports the following values: gt, gte, lt, lte, eq, and belong. If the type parameter is set to IcmpPackAvgLatency, the Operator parameter supports the following values: gt, gte, lt, lte, eq, and belong. If the type parameter is set to TraceRouteHops, the Operator parameter supports the following values: gt, gte, lt, lte, eq, and belong.

DNS synthetic tests

If the type parameter is set to DnsCName, the Operator parameter supports the following values: eq, ctn, nctn, reg_match, not_reg_match. CNAME records can be selectively displayed. If the type parameter is set to DnsCName, the Operator parameter supports the following values: eq, ctn, nctn, reg_match, not_reg_match. CNAME records can be selectively displayed.

Website speed measurement

If the type parameter is set to websiteTTFB, the Operator parameter supports the following values: gt, gte, lt, lte, eq, and belong. If the type parameter is set to websiteTTLB, the Operator parameter supports the following values: gt, gte, lt, lte, eq, and belong. If the type parameter is set to websiteFST, the Operator parameter supports the following values: gt, gte, lt, lte, eq, and belong. If the type parameter is set to websiteFFST, the Operator parameter supports the following values: gt, gte, lt, lte, eq, and belong. If the type parameter is set to websiteOnload, the Operator parameter supports the following values: gt, gte, lt, lte, eq, and belong.

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

Id of the request

53B5874D-EBC1-5567-B787-E4B7267F5CEB
Successboolean

Indicates whether the request was successful. Valid values: true and false.

true
Codelong

The HTTP status code returned. The status code 200 indicates that the request was successful.

200
Messagestring

The message returned.

success
Dataobject

The struct returned.

TaskIdstring

The ID of the synthetic monitoring task.

5308a2691f59422c8c3b7aeccec9cd3b
Statusstring

The task status. Valid values:

  • INIT: The task is in the initial state.
  • RELEASE: The task is being parsed.
  • RUNNING: The task is running.
  • STOP: The task is suspended.
  • SYSTEM_STOP: The task is suspended by the system.
  • CANCEL: The task is canceled.
  • SYSTEM_CANCEL: The task is canceled by the system.
  • DONE: The task is complete.
RUNNING

Examples

Sample success responses

JSONformat

{
  "RequestId": "53B5874D-EBC1-5567-B787-E4B7267F5CEB",
  "Success": true,
  "Code": 200,
  "Message": "success",
  "Data": {
    "TaskId": "5308a2691f59422c8c3b7aeccec9cd3b",
    "Status": "RUNNING"
  }
}

Error codes

HTTP status codeError codeError messageDescription
400ParameterMissing%s-
400ParameterIllegal%s-
400TaskQuotaLimit%s-
400ParameterRegionIllegal%s-
400DuplicateTagKeyParam tagKey is duplicate.-
400TagNumOUTthe number of tag is out .-
400NoPermissionUSERuser no permission-
403RAMNotAuthorize%s-
403STSNotAuthorize%s-
403IllegalUserAccess%s-
403CommercialStatusException%s-
403SyntheticTrailExpired%s-
403SyntheticInDebt%s-
403SyntheticDailyTimesExhausted%s-
403SyntheticDailyLimit%s-
403APINotAuthorizeThe current user is not authorized to access the interface.The current user is not authorized to access the interface.
403INNER_PROHIBIT-

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

Change history

Change timeSummary of changesOperation
2024-04-12The Error code has changedView Change Details
2024-03-14The Error code has changedView Change Details
2024-03-01The Error code has changedView Change Details
2024-02-23The Error code has changedView Change Details
2023-10-26The Error code has changedView Change Details
2023-09-08The Error code has changedView Change Details