Queries the information of a resource group.

Usage notes

In this example, the information of the resource group whose ID is rg-9gLOoK**** is queried.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetResourceGroup

The operation that you want to perform. Set the value to GetResourceGroup.

ResourceGroupId String Yes rg-9gLOoK****

The ID of the resource group.

You can call the ListResourceGroups operation to obtain the ID of the resource group.

IncludeTags Boolean No true

Specifies whether to return the information of tags. Valid values:

  • false (default value)
  • true

For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Example Description
RequestId String 2D69A58F-345C-4FDE-88E4-BF5189484043

The ID of the request.

ResourceGroup Object

The information of the resource group.

DisplayName String my-project

The display name of the resource group.

Status String OK

The status of the resource group. Valid values:

  • Creating: The resource group is being created.
  • OK: The resource group is created.
  • PendingDelete: The resource group is waiting to be deleted.
RegionStatuses Array of RegionStatus

The status of the resource group in all regions.

RegionStatus
Status String OK

The status of the resource group. Valid values:

  • Creating: The resource group is being created.
  • OK: The resource group is created.
  • PendingDelete: The resource group is waiting to be deleted.
  • Deleting: The resource group is being deleted.
RegionId String cn-qingdao

The region ID.

AccountId String 123456789****

The ID of the Alibaba Cloud account to which the resource group belongs.

Name String my-project

The identifier of the resource group.

CreateDate String 2015-01-23T12:33:18Z

The time when the resource group was created. The time is displayed in UTC.

Id String rg-9gLOoK****

The ID of the resource group.

Tags Array of Tag

The tags that are added to the resource group.

Tag
TagKey String k1

The tag key.

TagValue String v1

The tag value.

Examples

Sample requests

https://resourcemanager.aliyuncs.com/?Action=GetResourceGroup
&ResourceGroupId=rg-9gLOoK****
&IncludeTags=true
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetResourceGroupResponse>
    <RequestId>2D69A58F-345C-4FDE-88E4-BF5189484043</RequestId>
    <ResourceGroup>
        <Id>rg-9gLOoK****</Id>
        <AccountId>123456789****</AccountId>
        <Name>my-project</Name>
        <DisplayName>my-project</DisplayName>
        <Status>OK</Status>
        <RegionStatuses>
            <RegionStatus>
                <RegionId>cn-hangzhou</RegionId>
                <Status>OK</Status>
            </RegionStatus>
            <RegionStatus>
                <RegionId>cn-qingdao</RegionId>
                <Status>OK</Status>
            </RegionStatus>
        </RegionStatuses>
        <CreateDate>2015-01-23T12:33:18Z</CreateDate>
        <Tags>
            <Tag>
                <TagKey>k1</TagKey>
                <TagValue>v1</TagValue>
            </Tag>
        </Tags>
    </ResourceGroup>
</GetResourceGroupResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "2D69A58F-345C-4FDE-88E4-BF5189484043",
  "ResourceGroup" : {
    "Id" : "rg-9gLOoK****",
    "AccountId" : "123456789****",
    "Name" : "my-project",
    "DisplayName" : "my-project",
    "Status" : "OK",
    "RegionStatuses" : {
      "RegionStatus" : [ {
        "RegionId" : "cn-hangzhou",
        "Status" : "OK"
      }, {
        "RegionId" : "cn-qingdao",
        "Status" : "OK"
      } ]
    },
    "CreateDate" : "2015-01-23T12:33:18Z",
    "Tags" : {
      "Tag" : [ {
        "TagKey" : "k1",
        "TagValue" : "v1"
      } ]
    }
  }
}

Error codes

HTTP status code Error code Error message Description
400 InvalidParameter.ResourceGroupId The ResourceGroupId is invalid. The error message returned because the ID of the resource group is invalid.
403 NoPermission You are not authorized to perform the operation. The error message returned because you are not authorized to perform the operation.
404 EntityNotExists.ResourceGroup The specified resource group does not exist. You must first create a resource group. The error message returned because the resource group does not exist. Create such a resource group first.

For a list of error codes, visit the API Error Center.