调用DescribeMonitorGroups接口查询应用分组列表。

本文将提供一个示例,查询当前账号的应用分组列表。返回结果显示当前账号存在两个应用分组testGroup124test123

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String DescribeMonitorGroups

要执行的操作,取值:DescribeMonitorGroups

SelectContactGroups Boolean true

返回结果中是否需要包含报警联系组。取值:

  • true:是。
  • false:否。
PageNumber Integer 1

页码。

起始值:1。默认值:1。

PageSize Integer 30

分页时每页显示的数据行数。

起始值:1。默认值:30。

Keyword String test

搜索关键字。

InstanceId String i-abcdefgh12****

资源实例ID。该参数用于查询指定实例所在的应用分组。

GroupName String testGroup124

应用分组名称。

IncludeTemplateHistory Boolean true

返回结果是否包含已应用到应用分组的报警模板历史。取值:

  • true:是。
  • false:否。
Type String custom

应用分组类型。取值:

  • custom:自建的应用分组。
  • ehpc_cluster:从EHPC集群同步的应用分组。
  • kubernetes:从容器服务Kubernetes版同步的应用分组。
DynamicTagRuleId String 6b882d9a-5117-42e2-9d0c-4749a0c6****

智能标签规则ID。

GroupFounderTagKey String GroupKey1

通过智能标签创建应用分组的标签键。

GroupFounderTagValue String GroupValue1

通过智能标签创建应用分组的标签值。

GroupId String 92****

应用分组ID。多个应用分组ID之间用半角逗号(,)分隔。

Tag.N.Key String tagKey1

应用分组的标签键。N的取值范围:1~5。

Tag.N.Value String tagValue1

应用分组的标签值。N的取值范围:1~5。

Types String custom

应用分组类型。取值:

  • custom:自建的应用分组。
  • ehpc_cluster:从EHPC集群同步的应用分组。
  • kubernetes:从容器服务Kubernetes版同步的应用分组。
  • tag:通过标签自动创建的应用分组。
  • resMgr:通过资源组创建的应用分组。
  • ess:从弹性伸缩ESS同步的应用分组。

关于公共请求参数的详情,请参见公共参数

返回数据

名称 类型 示例值 描述
RequestId String F02B299A-D374-4595-9F55-7534D604F132

请求ID。

Success Boolean true

操作是否成功。取值:

  • true:成功。
  • false:失败。
Code Integer 200

状态码。

说明 200表示成功。
Message String The specified resource is not found.

错误信息。

PageNumber Integer 1

页码。

PageSize Integer 30

分页时每页显示的数据行数。

Total Integer 10

总记录条数。

Resources Array of Resource

关联资源。

Resource
Type String custom

应用分组类型。取值:

  • custom:自建的应用分组。
  • ehpc_cluster:从EHPC集群同步的应用分组。
  • kubernetes:从容器服务Kubernetes版同步的应用分组。
GroupFounderTagValue String GroupValue1

通过智能标签创建应用分组的标签值。

BindUrl String https://aliyun.com

从容器服务Kubernetes版同步过来的URL地址。

GroupName String test123

应用分组名称。

GroupId Long 12345

应用分组ID。

ServiceId String 49****

阿里云服务ID。

DynamicTagRuleId String 6b882d9a-5117-42e2-9d0c-4749a0c6****

智能标签规则ID。

GmtCreate Long 1603181891000

创建应用分组的时间戳。单位:毫秒。

GroupFounderTagKey String GroupKey1

通过智能标签创建应用分组的标签键。

GmtModified Long 1603181891000

修改应用分组的时间戳。单位:毫秒。

ContactGroups Array of ContactGroup

报警联系组。

ContactGroup
Name String CloudMonitor

报警联系组名称。

Tags Array of Tag

应用分组绑定的标签列表。

Tag
Key String tagKey1

应用分组的标签键。

Value String tagValue1

应用分组的标签值。

TemplateIds Array of String 92****

应用分组应用过的报警模板。

ResourceGroupId String rg-aek2hopjh*******

资源ID。

示例

请求示例

http(s)://[Endpoint]/?Action=DescribeMonitorGroups
&<公共请求参数>

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/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>92****</GroupId>
        </Resource>
    </Resources>
    <Code>200</Code>
    <Success>true</Success>
</DescribeMonitorGroupsResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/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" : "92****"
    } ]
  },
  "Code" : 200,
  "Success" : true
}

错误码

HttpCode 错误码 错误信息 描述
404 ResourceNotFound The specified resource is not found. 未找到指定资源。

访问错误中心查看更多错误码。