创建定时拨测任务(新版)。
接口说明
云拨测目前仅在杭州 region 提供服务,使用 SDK 或 OpenAPI 时请选择杭州 region 对应的服务接入点。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| RegionId |
string |
是 |
地域 ID。 |
cn-hangzhou |
| Name |
string |
是 |
拨测任务名称,不允许重复。 |
demo-test |
| TaskType |
integer |
是 |
任务类型:
|
4 |
| MonitorConf |
object |
是 |
监测配置。 |
|
| NetICMP |
object |
否 |
ICMP 拨测配置参数。当 TaskType 为 1 时必填。 |
|
| TargetUrl |
string |
是 |
拨测目标地址,只能输入 P 地址或者域名。 |
www.example.com |
| Interval |
integer |
否 |
ICMP(Ping)数据包发送的时间间隔。单位为毫秒(ms),最小值为 200,最大值为 2000,默认为 200。 |
200 |
| PackageNum |
integer |
否 |
发送 ICMP(Ping)数据包的数量。最小值为 1,最大值为 50,默认为 4。 |
4 |
| PackageSize |
integer |
否 |
发送 ICMP(Ping)数据包的大小。单位为 byte,ICMP(PING)包大小只限 32、64、128、256、512、1024、1080、1450。 |
32 |
| SplitPackage |
boolean |
否 |
是否拆分 ICMP(Ping)数据包。默认为 true。 |
true |
| Timeout |
integer |
否 |
ICMP 拨测的超时时间。单位为毫秒(ms),最小值为 1000,最大值为 300000,默认为 20000。 |
20000 |
| TracertEnable |
boolean |
否 |
是否开启 tracert。默认为 true。 |
true |
| TracertNumMax |
integer |
否 |
tracert 的最大跃点数。最小值为 1,最大值为 128,默认为 20。 |
20 |
| TracertTimeout |
integer |
否 |
tracert 的超时时间。单位为毫秒(ms),最小值为 1000,最大值为 300000,默认为 60000。 |
60000 |
| NetTCP |
object |
否 |
TCP 拨测的配置参数。当 TaskType 为 2 时必填。 |
|
| TargetUrl |
string |
是 |
拨测目标地址(主机)。 |
www.example.com |
| ConnectTimes |
integer |
否 |
建立 TCP 连接的次数。最小值为 1,最大值为 16,默认为 4。 |
4 |
| Interval |
integer |
否 |
建立 TCP 连接的时间间隔。单位为毫秒(ms),最小值为 200,最大值为 10000,默认为 200。 |
200 |
| Timeout |
integer |
否 |
TCP 拨测超时时间。单位为毫秒(ms),最小值为 1000,最大值为 300000,默认为 20000。 |
20000 |
| TracertEnable |
boolean |
否 |
是否开启 tracert。默认为 true。 |
true |
| TracertNumMax |
integer |
否 |
tracert 的最大跃点数。最小值为 1,最大值为 128,默认为 20。 |
20 |
| TracertTimeout |
integer |
否 |
tracert 的超时时间。单位为毫秒(ms),最小值为 1000,最大值为 300000,默认为 60000。 |
60000 |
| NetDNS |
object |
否 |
DNS 拨测的配置参数。当 TaskType 为 3 时必填。 |
|
| TargetUrl |
string |
是 |
DNS 拨测的目标地址(域名)。 |
www.aliyun.com |
| DnsServerIpType |
integer |
否 |
DNS 服务器 IP 类型。
|
0 |
| NsServer |
string |
否 |
NS 服务器 IP,默认 114.114.114.114。 |
114.114.114.114 |
| QueryMethod |
integer |
否 |
DNS 查询方式。
|
0 |
| Timeout |
integer |
否 |
DNS 拨测超时时间。单位为毫秒(ms),最小值为 1000,最大值为 45000,默认为 5000。 |
5000 |
| ApiHTTP |
object |
否 |
HTTP(S)类型任务配置信息。 |
|
| TargetUrl |
string |
是 |
拨测目标地址(请求路径)。 |
http://www.demo.com/api/list |
| Method |
string |
否 |
HTTP 方法,GET 或 POST。 |
GET |
| RequestHeaders |
object |
否 |
HTTP 请求头。 |
|
|
string |
否 |
JSON Map 格式。 |
{ "key1": "value1", "key2": "value2" } |
|
| RequestBody |
object |
否 |
HTTP 请求体。 |
|
| Content |
string |
否 |
请求体内容,为 JSON 字符串格式。当 type 为 text/plain,application/json,application/xml,text/html,content 内容转为 JSON 字符串即可。 |
{ "key1": "value1", "key2": "value2" } |
| Type |
string |
否 |
请求体类型,支持:text/plain、application/json、application/x-www-form-urlencoded、multipart/form-data、application/xml、text/html |
application/json |
| ConnectTimeout |
integer |
否 |
连接超时, 单位 ms,默认 5000,可选范围:1000~300000ms。 |
5000 |
| Timeout |
integer |
否 |
超时时间,单位 ms,默认 10000,可选范围:1000~300000ms。 |
10000 |
| CheckCert |
boolean |
否 |
是否校验证书,默认为否。 |
true |
| ProtocolAlpnProtocol |
integer |
否 |
ALPN 协议版本(wap 移动端并且是 HTTPS 任务时可配置): 0-default 系统默认行为 1-http/1.1 2-h2 3-off 关闭,不启用 alpn_protocol |
1 |
| Website |
object |
否 |
网站测速类型任务配置。 |
|
| TargetUrl |
string |
是 |
目标 URL。 |
https://www.aliyun.com |
| AutomaticScrolling |
integer |
否 |
是否支持自动滚动屏幕,加载页面。
|
0 |
| CustomHeader |
integer |
否 |
自定义 header。
|
0 |
| CustomHeaderContent |
object |
否 |
自定义 header,JSON Map 格式。 |
|
|
string |
否 |
JSON Map |
{ "key1": "value1", "key2": "value2" } |
|
| DisableCache |
integer |
否 |
是否禁用缓存。
|
1 |
| DisableCompression |
integer |
否 |
通过 Accept-Encoding 字段判断是否接受压缩文件,0-不禁用,1-禁用,默认为 0。 |
0 |
| FilterInvalidIP |
integer |
否 |
是否过滤非有效 IP 参数非法,0:过滤,1:不过滤,默认 0。 |
0 |
| IgnoreCertificateError |
integer |
否 |
是否忽略在 SSL 握手中证书校验过程中的证书错误而继续浏览,0-不忽略,1-忽略,默认为 1。 |
1 |
| MonitorTimeout |
integer |
否 |
监测超时,单位为 ms。非必填,默认 20000。 |
20000 |
| Redirection |
integer |
否 |
当出现重定向后,是否要继续浏览, 0-否,1-是,默认是 1。 |
1 |
| SlowElementThreshold |
integer |
否 |
慢元素阈值,单位为 ms,默认 5000,可选范围为 1~300000ms。 |
5000 |
| WaitCompletionTime |
integer |
否 |
最大等待完成时间,单位为 ms,默认 5000,可选范围为:5000~300000ms。 |
5000 |
| VerifyStringBlacklist |
string |
否 |
验证字符串即监测页面源代码中的某个任意字符串。若客户端返回的源码中包含任一黑名单中的字符串则报 650 验证字符串失败的错误。多个字符串以竖线(|)隔开。 |
error |
| VerifyStringWhitelist |
string |
否 |
验证字符串即监测页面源代码中的某个任意字符串。客户端返回的源码必须包含所有白名单中的字符串,否则报 650 验证字符串失败的错误。多个字符串以竖线(|)隔开。 |
success |
| ElementBlacklist |
string |
否 |
在页面加载过程中如果出现元素黑名单中配置的元素,不会请求加载该元素 。 |
www.example.com/a.jpg |
| DNSHijackWhitelist |
string |
否 |
域名(例如 www.aliyun.com)解析时,解析出的 IP 地址或者 CNAME 不在 DNS 劫持白名单内,用户就会访问失败或者返回一个非 Aliyun 的目标 IP;若解析结果中的 IP 或者 CNAME 在 DNS 白名单内,则会被认定为没有发生 DNS 劫持。 填写格式:域名:匹配规则。匹配规则支持 IP、IP 通配符、子网掩码和 CNAME,可以填写多个匹配规则,多个匹配规则以竖线(|)隔开。例如:www.aliyun.com:203.0.3.55|203.3.44.67,表示 www.aliyun.com 域名下除 203.0.3.55 和 203.3.44.67 之外的其他 IP 都是被劫持的。 |
www.aliyun.com:203.0.3.55|203.3.44.67 |
| PageTamper |
string |
否 |
监测页面出现了域名设置之外的元素都属于页面被篡改。常见的表现形式为弹出广告、浮动广告、跳转等。 填写格式:域名:元素。元素支持填写通配符,可以填写多个元素,多个元素以竖线(|)隔开。例如:www.aliyun.com:|/cc/bb/a.gif|/vv/bb/cc.jpg,表示 www.aliyun.com 域名下除基础文档、/cc/bb/a.gif 和/vv/bb/cc.jpg 之外的其他元素都属于页面被篡改。 |
www.aliyun.com:|/cc/bb/a.gif|/vv/bb/cc.jpg |
| FlowHijackJumpTimes |
integer |
否 |
识别元素:设置浏览页面元素总个数。 |
10 |
| FlowHijackLogo |
string |
否 |
劫持标识:设置匹配的关键信息。填写劫持判断关键字或关键元素,允许带星号(*)。 |
aliyun |
| FileDownload |
object |
否 |
文件下载类型任务配置。 |
|
| TargetUrl |
string |
是 |
文件下载链接。 |
https://img.alicdn.com/tfs/TB13DzOjXP7gK0jSZFjXXc5aXXa-212-48.png |
| DownloadKernel |
integer |
否 |
下载内核。
默认 1 |
1 |
| QuickProtocol |
integer |
否 |
Quick 协议
默认 1 |
1 |
| ConnectionTimeout |
integer |
否 |
连接超时时间,ms,默认 5000,可选范围:1000~120000ms 之间。 |
5000 |
| MonitorTimeout |
integer |
否 |
监测超时时间,ms,默认 60000,可选范围:1000~120000ms 之间。 |
60000 |
| CustomHeaderContent |
object |
否 |
自定义请求头内容,JSON Map。 |
|
|
string |
否 |
JSON Map。 |
{ "key1": "value1", "key2": "value2" } |
|
| IgnoreCertificateStatusError |
integer |
否 |
证书状态错误忽略,0:不忽略,1:忽略,默认 1。 |
1 |
| IgnoreCertificateUntrustworthyError |
integer |
否 |
证书不可信忽略,0:不忽略,1:忽略,默认 1。 |
1 |
| IgnoreInvalidHostError |
integer |
否 |
主机无效错误忽略,0:不忽略,1:忽略,默认 1。 |
1 |
| Redirection |
integer |
否 |
是否支持重定向, 0:不支持,1:支持,默认 1。 |
1 |
| TransmissionSize |
integer |
否 |
传输大小,KB,默认 2048KB,文件下载的传输大小必须在 1~20480KB 之间。 |
2048 |
| IgnoreCertificateCanceledError |
integer |
否 |
忽略证书撤销错误 0:不忽略,1:忽略,默认 1。 |
1 |
| IgnoreCertificateAuthError |
integer |
否 |
忽略 CA 证书授权错误 0:不忽略,1:忽略,默认 1。 |
1 |
| IgnoreCertificateOutOfDateError |
integer |
否 |
忽略证书过期错误 0:不忽略,1:忽略,默认 1。 |
1 |
| IgnoreCertificateUsingError |
integer |
否 |
忽略证书使用错误 0:不忽略,1:忽略,默认 1。 |
1 |
| VerifyWay |
integer |
否 |
验证方式。
|
0 |
| ValidateKeywords |
string |
否 |
验证关键词。 |
aliyun |
| WhiteList |
string |
否 |
DNS 劫持白名单。匹配规则支持 IP、IP 通配符、子网掩码和 CNAME,可以填写多个匹配规则,多个匹配规则以竖线(|)隔开。例如:www.aliyun.com:203.0.3.55|203.3.44.67,表示 www.aliyun.com 域名下除 203.0.3.55 和 203.3.44.67 之外的其他 IP 都是被劫持的。 |
www.aliyun.com:203.0.3.55|203.3.44.67 |
| Stream |
object |
否 |
流媒体拨测配置。 |
|
| TargetUrl |
string |
否 |
流媒体资源地址。 |
http://www.aliyun.com/stream/test.mp4 |
| StreamType |
integer |
否 |
音视频标志:0-视频,1-音频。 |
0 |
| StreamMonitorTimeout |
integer |
否 |
监测时长,单位秒,最长支持 60s,不传默认 60。 |
30 |
| StreamAddressType |
integer |
否 |
资源地址类型:
|
0 |
| PlayerType |
integer |
否 |
播放器,不传默认 12。
|
12 |
| CustomHeaderContent |
object |
否 |
自定义 header,JSON Map 格式。 |
|
|
string |
否 |
自定义 header,JSON Map 格式。 |
{ "key1": "value1", "key2": "value2" } |
|
| WhiteList |
string |
否 |
DNS 劫持白名单。匹配规则支持 IP、IP 通配符、子网掩码和 CNAME,可以填写多个匹配规则,多个匹配规则以竖线(|)隔开。例如:www.aliyun.com:203.0.3.55|203.3.44.67,表示 www.aliyun.com 域名下除 203.0.3.55 和 203.3.44.67 之外的其他 IP 都是被劫持的。 |
www.aliyun.com:203.0.3.55|203.3.44.67 |
| MonitorCategory |
integer |
是 |
监测点类型:
|
1 |
| Monitors |
array<object> |
是 |
监测点列表。 |
|
|
object |
是 |
监测点列表。 |
||
| CityCode |
string |
是 |
城市编码。 |
100023 |
| OperatorCode |
string |
是 |
运营商编码。 |
1 |
| ClientType |
integer |
是 |
拨测点客户端类型:
|
1 |
| Frequency |
string |
是 |
拨测频率:1m、5m、10m、15m、20m、30m、1h、2h、3h、4h、6h、8h、12h、24h。 |
5m |
| CustomPeriod |
object |
否 |
自定义周期 |
|
| EndHour |
integer |
是 |
结束小时,0-24。 |
22 |
| StartHour |
integer |
是 |
开始小时,0-24。 |
8 |
| CommonSetting |
object |
否 |
通用设置。 |
|
| CustomHost |
object |
否 |
自定义 host |
|
| Hosts |
array<object> |
是 |
host 列表。 |
|
|
object |
是 |
自定义 host |
||
| Domain |
string |
是 |
域名 |
www.aliyun.com |
| IpType |
integer |
是 |
IP 类型:
|
0 |
| Ips |
array |
是 |
IP 列表。 |
|
|
string |
是 |
IP。 |
10.176.141.63 |
|
| SelectType |
integer |
是 |
选择方式:
|
0 |
| IpType |
integer |
否 |
IP 类型:
|
0 |
| MonitorSamples |
integer |
否 |
是否均匀分配监测样本 :
|
0 |
| IsOpenTrace |
boolean |
否 |
是否开启链路追踪。 |
true |
| TraceClientType |
integer |
否 |
链路追踪客户端类型:
|
1 |
| XtraceRegion |
string |
否 |
链路数据上报 region。 |
cn-hangzhou |
| CustomVPCSetting |
object |
否 |
用户 VPC 信息,如果拨测的是阿里云内网地址,需要配置 VPC 信息。 |
|
| RegionId |
string |
否 |
地域。 |
cn-hangzhou |
| VpcId |
string |
否 |
VPC ID. |
vpc-bp1muectbr8f90vjxxxxx |
| VSwitchId |
string |
否 |
交换机 ID。 |
vsw-bp14crq29vpycxp8xxxxx |
| SecureGroupId |
string |
否 |
安全组 ID,此安全组是拨测客户端所在的安全组,安全组限定了拨测客户端在 VPC 中的出入站规则。需要设置您的 VPC 所在安全组的入站规则为允许拨测客户端所在的安全组访问。否则,拨测客户端无法顺畅地访问您的 VPC 内资源。 |
sg-bp13wzf9vuwegmpxxxxx |
| CustomPrometheusSetting |
object |
否 |
保留字段。 |
|
| PrometheusLabels |
object |
否 |
保留字段。 |
|
|
string |
否 |
保留字段。 |
保留字段。 |
|
| PrometheusClusterId |
string |
否 |
保留字段。 |
保留字段。 |
| PrometheusClusterRegion |
string |
否 |
保留字段。 |
保留字段。 |
| AvailableAssertions |
array<object> |
否 |
断言列表 |
|
|
object |
是 |
断言 |
||
| Type |
string |
是 |
断言类型,包括:HttpResCode、HttpResHead、HttpResBody、HttpResBodyJson、HttpResponseTime、IcmpPackLoss(丢包率)、IcmpPackMaxLatency(最大包延时 ms)、IcmpPackAvgLatency(平均延时)、TraceRouteHops(跃点数目)、DnsARecord(A 记录)、DnsCName(Cname)、websiteTTFB(首包时间)、websiteTTLB(尾包时间)、websiteFST(首屏时间)、websiteFFST(首屏完全渲染时间)、websiteOnload(完全加载时间),具体使用见下文补充说明。 |
DnsARecord |
| Target |
string |
否 |
检查目标,当为 HttpResCode 与 HttpResBody、HttpResponseTime 时,target 不需要填,当为 HttpResHead 时,需指定 header 中的 key,当为 HttpResBodyJson 时,使用 jsonPath。 |
key |
| Operator |
string |
是 |
条件:gt:大于;gte:大于等于;lt:小于;te:小于或等于;eq:等于;neq:不等于;ctn:包含;nctn:不包含;exist:存在;n_exist:不存在;belong:属于;n_belong:不属于;reg_match:正则匹配。 |
eq |
| Expect |
string |
是 |
期望值 |
200 |
| ResourceGroupId |
string |
否 |
可不传 |
xxxx |
| Tags |
array<object> |
否 |
标签列表。 |
|
|
object |
否 |
标签。 |
||
| Key |
string |
否 |
标签键。 |
Key |
| Value |
string |
否 |
标签值。 |
500 |
断言配置说明如下:
HTTP 类型任务
-
type 为 HttpResCode 时,operator 支持 eq、neq、gt、gte、lt、lte、belong、n_belong
-
type 为 HttpResHead 时,operator 支持所有
-
type 为 HttpResBody,operator 支持所有
-
type 为 HttpResBodyJson,operator 支持所有
-
type 为 HttpResponseTime,支持 gt、gte、lt、lte、eq、belong
ICMP 类型任务
-
type 为 IcmpPackLoss 时,名称为丢包率%,支持 gt、gte、lt、lte、eq、belong
-
type 为 IcmpPackMaxLatency 时,名称为最大包延时 ms,支持 gt、gte、lt、lte、eq、belong
-
type 为 IcmpPackAvgLatency 时,名称为平均延时 ms,支持 gt、gte、lt、lte、eq、belong
-
TraceRouteHops 时,名称为跃点数目,支持 gt、gte、lt、lte、eq、belong
DNS 类型任务
-
type 为 DnsARecord 时,名称为 A 记录,target 有两个选择 every(展示-每条记录)和 any(展示-存在记录),支持 eq、ctn、nctn、reg_match、not_reg_match
-
type 为 DnsCName 时,名称为 Cname,target 有两个选择 every(展示-每条记录)和 any(展示-存在记录),支持 eq、ctn、nctn、reg_match、not_reg_match
WEBSITE 类型任务
-
type 为 websiteTTFB 时,名称为首包时间,支持 gt、gte、lt、lte、eq、belong
-
type 为 websiteTTLB 时,名称为尾包时间,支持 gt、gte、lt、lte、eq、belong
-
type 为 websiteFST 时,名称为首屏时间,支持 gt、gte、lt、lte、eq、belong
-
type 为 websiteFFST 时,名称为首屏完全渲染时间,支持 gt、gte、lt、lte、eq、belong
-
type 为 websiteOnload 时,名称为完全加载时间,支持 gt、gte、lt、lte、eq、belong
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| RequestId |
string |
请求 ID。 |
53B5874D-EBC1-5567-B787-E4B7267F5CEB |
| Success |
boolean |
操作是否成功:true:操作成功 false:操作失败 |
true |
| Code |
integer |
状态码。200 表示成功。 |
200 |
| Message |
string |
返回信息。 |
success |
| Data |
object |
返回结果。 |
|
| TaskId |
string |
云拨测任务 ID。 |
5308a2691f59422c8c3b7aeccec9cd3b |
| Status |
string |
任务状态。取值:
|
RUNNING |
示例
正常返回示例
JSON格式
{
"RequestId": "53B5874D-EBC1-5567-B787-E4B7267F5CEB",
"Success": true,
"Code": 200,
"Message": "success",
"Data": {
"TaskId": "5308a2691f59422c8c3b7aeccec9cd3b",
"Status": "RUNNING"
}
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | ParameterMissing | %s | |
| 400 | ParameterIllegal | %s | |
| 400 | TaskQuotaLimit | %s | |
| 400 | ParameterRegionIllegal | %s | |
| 400 | DuplicateTagKey | Param tagKey is duplicate. | |
| 400 | TagNumOUT | the number of tag is out . | |
| 400 | NoPermissionUSER | user no permission | |
| 403 | RAMNotAuthorize | %s | |
| 403 | STSNotAuthorize | %s | |
| 403 | IllegalUserAccess | %s | |
| 403 | CommercialStatusException | %s | |
| 403 | SyntheticTrailExpired | %s | |
| 403 | SyntheticInDebt | %s | |
| 403 | SyntheticDailyTimesExhausted | %s | |
| 403 | SyntheticDailyLimit | %s | |
| 403 | APINotAuthorize | The current user is not authorized to access the interface. | 当前用户无权限访问该接口 |
| 403 | INNER_PROHIBIT | 内部用户禁用云拨测服务, 如需使用, 请加钉钉群31359689联系白玙 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。