调用DescribeSiteMonitorAttribute接口查询站点监控任务的详细信息。
本文将提供一个示例,查询站点监控任务cc641dff-c19d-45f3-ad0a-818a0c4f****
的详细信息,返回结果显示,站点监控任务的名称为test123
、探测地址为https://aliyun.com
、运营商为阿里巴巴
等信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeSiteMonitorAttribute |
要执行的操作,取值:DescribeSiteMonitorAttribute。 |
TaskId | String | 是 | cc641dff-c19d-45f3-ad0a-818a0c4f**** |
监控任务ID。 |
IncludeAlert | Boolean | 否 | false |
返回的任务详情是否包含报警规则。
|
关于公共请求参数的详情,请参见公共参数。
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | D17DF650-7EBD-54D0-903A-1D4E624D7402 |
请求ID。 |
Code | String | 200 |
状态码。 说明 200表示成功。
|
Success | Boolean | true |
操作是否成功。取值:
|
SiteMonitors | Struct |
监控任务详情。 |
|
Address | String | https://aliyun.com |
监控任务的探测地址。 |
Interval | String | 1 |
监控任务的周期。单位:分钟。取值:1、 5、15、30和60。 |
IspCities | Array of IspCity |
探测点的运营商和城市。 |
|
IspCity | |||
City | String | 738 |
城市ID。 |
CityName | String | 北京市 |
城市名称。 |
Isp | String | 465 |
运营商ID。 |
IspName | String | 阿里巴巴 |
运营商名称。 |
OptionJson | Struct |
扩展选项。每一种探测类型有不同的扩展类型,详情请参见CreateSiteMonitor。 |
|
attempts | Long | 3 |
DNS失败后重试次数。 |
authentication | Integer | 1 |
是否开启安全验证。取值:
|
cookie | String | lang=en |
发送HTTP请求的Cookie。 |
dns_match_rule | String | IN_DNS |
DNS的匹配规则。取值:
|
dns_server | String | 192.168.XX.XX |
DNS服务器的IP地址。 说明 仅适用于DNS探测类型。
|
dns_type | String | A |
DNS解析类型。仅适用于DNS探测类型。取值:
|
expect_value | String | dns_server |
待解析的别名或地址。 说明 该参数仅适用于DNS探测类型。
|
failure_rate | Float | 0.4 |
丢包率。 说明 该参数仅适用于PING探测类型。
|
header | String | testKey:testValue |
HTTP请求头。 |
http_method | String | get |
HTTP请求方法。取值:
|
isBase64Encode | String | true |
是否对参数
|
match_rule | Integer | 1 |
是否包含报警规则。取值:
|
password | String | 123**** |
SMTP、POP3或FTP探测类型的密码。 |
ping_num | Integer | 29 |
PING探测类型的心跳。 |
port | Integer | 110 |
TCP、UDP、SMTP、POP3探测类型的端口。 |
protocol | String | TCP |
探测协议。 |
request_content | String | aa=bb |
HTTP探测类型的请求内容。 |
request_format | String | txt |
HTTP请求内容格式。取值:
|
response_content | String | txt |
匹配响应内容。 |
response_format | String | txt |
HTTP响应内容格式。取值:
|
time_out | Long | 3 |
超时时间。单位:毫秒。 |
username | String | testUser |
FTP、SMTP或POP3的用户名。 |
TaskId | String | cc641dff-c19d-45f3-ad0a-818a0c4f**** |
监控任务ID。 |
TaskName | String | test123 |
监控任务名称。 |
TaskState | String | 1 |
监控任务的状态。取值:
|
TaskType | String | HTTP |
监控任务类型。目前站点监控任务的类型包括:HTTP(S)、PING、TCP、UDP、DNS、SMTP、POP3、FTP。 |
MetricRules | Array of MetricRule |
监控任务的报警规则。 |
|
MetricRule | |||
ActionEnable | String | true |
报警规则的状态。取值:
|
AlarmActions | String | CloudMonitor |
报警规则通知的报警联系组。 |
ComparisonOperator | String | GreaterThanYesterday |
报警规则的阈值比较符。取值:
|
Dimensions | String | [{"taskId": "cc641dff-c19d-45f3-ad0a-818a0c4f****" }] |
报警规则对应的维度。 |
EvaluationCount | String | 3 |
报警重试次数。 |
Expression | String | $Availability=30 |
报警规则的表达式。 |
Level | String | 2 |
报警规则的级别。取值:
|
MetricName | String | Availability |
监控项名称。 |
Namespace | String | acs_networkmonitor |
云产品的数据命名空间。 |
OkActions | String | [ "CloudMonitor"] |
收到报警的联系人组。 |
Period | String | 15s |
时间间隔。通常是监控项的上报周期,单位:秒。 说明 如果您设置了统计周期,则会按照此周期查询对应的统计数据 。
|
RuleId | String | bf071ae_7b7aec3817b0fdf**** |
报警规则ID。 |
RuleName | String | rule1 |
报警规则名称。 |
StateValue | String | OK |
报警的状态。取值:
|
Statistics | String | Availability |
报警的统计方法。取值:
|
Threshold | String | 30 |
报警阈值。 |
Message | String | successful |
返回信息。 |
示例
请求示例
http(s)://[Endpoint]/?Action=DescribeSiteMonitorAttribute
&TaskId=cc641dff-c19d-45f3-ad0a-818a0c4f****
&<公共请求参数>
正常返回示例
XML
格式
<DescribeSiteMonitorAttributeResponse>
<MetricRules>
<MetricRule>
<ComparisonOperator>GreaterThanYesterday</ComparisonOperator>
<RuleId>bf071ae_7b7aec3817b0fdf****</RuleId>
<Period>15s</Period>
<EvaluationCount>3</EvaluationCount>
<Dimensions>
<taskId>cc641dff-c19d-45f3-ad0a-818a0c4f****</taskId>
</Dimensions>
<Statistics>Availability</Statistics>
<Namespace>acs_networkmonitor</Namespace>
<AlarmActions>CloudMonitor</AlarmActions>
<MetricName>Availability</MetricName>
<OkActions>CloudMonitor</OkActions>
<Expression>$Availability=30</Expression>
<ActionEnable>true</ActionEnable>
<StateValue>OK</StateValue>
<Level>2</Level>
<RuleName>rule1</RuleName>
<Threshold>30</Threshold>
</MetricRule>
</MetricRules>
<Message>successful</Message>
<RequestId>D17DF650-7EBD-54D0-903A-1D4E624D7402</RequestId>
<Code>200</Code>
<Success>true</Success>
<SiteMonitors>
<OptionJson>
<time_out>30000</time_out>
<http_method>get</http_method>
</OptionJson>
<TaskId>cc641dff-c19d-45f3-ad0a-818a0c4f****</TaskId>
<Address>https://aliyun.com</Address>
<TaskName>test123</TaskName>
<TaskType>HTTP</TaskType>
<IspCities>
<IspCity>
<IspName>阿里巴巴</IspName>
<Isp>465</Isp>
<CityName>北京市</CityName>
<City>738</City>
</IspCity>
</IspCities>
<TaskState>1</TaskState>
<Interval>1</Interval>
</SiteMonitors>
</DescribeSiteMonitorAttributeResponse>
JSON
格式
{
"MetricRules": {
"MetricRule": [
{
"ComparisonOperator": "GreaterThanYesterday",
"RuleId": "bf071ae_7b7aec3817b0fdf****",
"Period": "15s",
"EvaluationCount": 3,
"Dimensions": [
{
"taskId": "cc641dff-c19d-45f3-ad0a-818a0c4f****"
}
],
"Statistics": "Availability",
"Namespace": "acs_networkmonitor",
"AlarmActions": [
"CloudMonitor"
],
"MetricName": "Availability",
"OkActions": [
"CloudMonitor"
],
"Expression": "$Availability=30",
"ActionEnable": true,
"StateValue": "OK",
"Level": 2,
"RuleName": "rule1",
"Threshold": "30"
}
]
},
"Message": "successful",
"RequestId": "D17DF650-7EBD-54D0-903A-1D4E624D7402",
"Code": "200",
"Success": true,
"SiteMonitors": {
"OptionJson": {
"time_out": 30000,
"http_method": "get"
},
"TaskId": "cc641dff-c19d-45f3-ad0a-818a0c4f****",
"Address": "https://aliyun.com",
"TaskName": "test123",
"TaskType": "HTTP",
"IspCities": {
"IspCity": [
{
"IspName": "阿里巴巴",
"Isp": "465",
"CityName": "北京市",
"City": "738"
}
]
},
"TaskState": 1,
"Interval": 1
}
}
错误码
访问错误中心查看更多错误码。