调用DescribeMonitorGroups接口查询应用分组列表。
本文将提供一个示例,查询当前账号的应用分组列表。返回结果显示当前账号存在两个应用分组testGroup124
和test123
。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeMonitorGroups |
要执行的操作,取值:DescribeMonitorGroups。 |
GroupName | String | 否 | testGroup124 |
应用分组名称。 |
Keyword | String | 否 | test |
搜索关键字。 |
PageSize | Integer | 否 | 30 |
分页时每页显示的数据行数。 起始值:1。默认值:30。 |
PageNumber | Integer | 否 | 1 |
页码。 起始值:1。默认值:1。 |
InstanceId | String | 否 | i-abcdefgh12**** |
资源实例ID。该参数用于查询指定实例所在的应用分组。 |
SelectContactGroups | Boolean | 否 | true |
返回结果中是否需要包含报警联系组。取值:
|
IncludeTemplateHistory | Boolean | 否 | true |
返回结果是否包含已应用到应用分组的报警模板历史。取值:
|
Tag.N.Key | String | 否 | tagKey1 |
应用分组的标签键。N的取值范围:1~5。 |
Tag.N.Value | String | 否 | tagValue1 |
应用分组的标签值。N的取值范围:1~5。 |
Type | String | 否 | custom |
应用分组类型。取值:
|
DynamicTagRuleId | String | 否 | 6b882d9a-5117-42e2-9d0c-4749a0c6**** |
智能标签规则ID。 |
GroupFounderTagKey | String | 否 | GroupKey1 |
通过智能标签创建应用分组的标签键。 |
GroupFounderTagValue | String | 否 | GroupValue1 |
通过智能标签创建应用分组的标签值。 |
GroupId | String | 否 | 92**** |
应用分组ID。多个应用分组ID之间用半角逗号(,)分隔。 |
关于公共请求参数的详情,请参见公共参数。
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | F02B299A-D374-4595-9F55-7534D604F132 |
请求ID。 |
Message | String | The specified resource is not found. |
错误信息。 |
PageNumber | Integer | 1 |
页码。 |
PageSize | Integer | 30 |
分页时每页显示的数据行数。 |
Code | Integer | 200 |
状态码。 说明 200表示成功。
|
Resources | Array of Resource |
关联资源。 |
|
Resource | |||
BindUrl | String | https://aliyun.com |
从容器服务Kubernetes版同步过来的URL地址。 |
ContactGroups | Array of ContactGroup |
报警联系组。 |
|
ContactGroup | |||
Name | String | CloudMonitor |
报警联系组名称。 |
DynamicTagRuleId | String | 6b882d9a-5117-42e2-9d0c-4749a0c6**** |
智能标签规则ID。 |
GmtCreate | Long | 1603181891000 |
创建应用分组的时间戳。 格式为Unix时间戳,即从1970年1月1日开始所经过的毫秒数。 |
GmtModified | Long | 1603181891000 |
修改应用分组的时间戳。 格式为Unix时间戳,即从1970年1月1日开始所经过的毫秒数。 |
GroupFounderTagKey | String | GroupKey1 |
通过智能标签创建应用分组的标签键。 |
GroupFounderTagValue | String | GroupValue1 |
通过智能标签创建应用分组的标签值。 |
GroupId | Long | 12345 |
应用分组ID。 |
GroupName | String | test123 |
应用分组名称。 |
ServiceId | String | 49**** |
阿里云服务ID。 |
Tags | Array of Tag |
应用分组绑定的标签列表。 |
|
Tag | |||
Key | String | tagKey1 |
应用分组的标签键。 |
Value | String | tagValue1 |
应用分组的标签值。 |
TemplateIds | List | 92**** |
应用分组应用过的报警模板。 |
Type | String | custom |
应用分组类型。取值:
|
Success | Boolean | true |
操作是否成功。取值:
|
Total | Integer | 10 |
总记录条数。 |
示例
请求示例
http(s)://[Endpoint]/?Action=DescribeMonitorGroups
&<公共请求参数>
正常返回示例
XML
格式
<DescribeMonitorGroupsResponse>
<RequestId>F02B299A-D374-4595-9F55-7534D604F132</RequestId>
<PageSize>30</PageSize>
<PageNumber>1</PageNumber>
<Total>2</Total>
<Resources>
<Resource>
<GroupName>testGroup124</GroupName>
<ContactGroups>
<ContactGroup>
<Name>CloudMonitor</Name>
</ContactGroup>
</ContactGroups>
<Type>custom</Type>
<GmtCreate>1603181891000</GmtCreate>
<GmtModified>1603181891000</GmtModified>
<GroupFounderTagKey>1204</GroupFounderTagKey>
<GroupFounderTagValue>001</GroupFounderTagValue>
<TemplateIds>
<TemplateId>92****</TemplateId>
</TemplateIds>
<Tags>
<Tag>
<Value>tagKey1</Value>
<Key>tagValue1</Key>
</Tag>
</Tags>
<GroupId>7301****</GroupId>
</Resource>
<Resource>
<GroupName>test123</GroupName>
<ContactGroups>
<ContactGroup>
<Name>CloudMonitor</Name>
</ContactGroup>
</ContactGroups>
<Type>tag</Type>
<GmtCreate>1603181891000</GmtCreate>
<DynamicTagRuleId>6b882d9a-5117-42e2-9d0c-4749a0c6****</DynamicTagRuleId>
<GmtModified>1603181891000</GmtModified>
<GroupFounderTagKey>GroupKey1</GroupFounderTagKey>
<GroupFounderTagValue>GroupValue1</GroupFounderTagValue>
<TemplateIds></TemplateIds>
<Tags></Tags>
<GroupId>12345</GroupId>
</Resource>
</Resources>
<Code>200</Code>
<Success>true</Success>
</DescribeMonitorGroupsResponse>
JSON
格式
{
"RequestId": "F02B299A-D374-4595-9F55-7534D604F132",
"PageSize": 30,
"PageNumber": 1,
"Total": 2,
"Resources": {
"Resource": [
{
"GroupName": "testGroup124",
"ContactGroups": {
"ContactGroup": [
{
"Name": "CloudMonitor"
}
]
},
"Type": "custom",
"GmtCreate": 1603181891000,
"GmtModified": 1603181891000,
"GroupFounderTagKey": "1204",
"GroupFounderTagValue": "001",
"TemplateIds": {
"TemplateId": [
"92****"
]
},
"Tags": {
"Tag": [
{
"Value": "tagKey1",
"Key": "tagValue1"
}
]
},
"GroupId": "7301****"
},
{
"GroupName": "test123",
"ContactGroups": {
"ContactGroup": [
{
"Name": "CloudMonitor"
}
]
},
"Type": "tag",
"GmtCreate": 1603181891000,
"DynamicTagRuleId": "6b882d9a-5117-42e2-9d0c-4749a0c6****",
"GmtModified": 1603181891000,
"GroupFounderTagKey": "GroupKey1",
"GroupFounderTagValue": "GroupValue1",
"TemplateIds": {
"TemplateId": []
},
"Tags": {
"Tag": []
},
"GroupId": 12345
}
]
},
"Code": 200,
"Success": true
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
404 | ResourceNotFound | The specified resource is not found. | 未找到指定资源。 |
访问错误中心查看更多错误码。