All Products
Search
Document Center

:CreateResourceGroup

Last Updated:Dec 22, 2023

Creates a resource group.

Note A maximum of 30 resource groups can be created within an Alibaba Cloud account.

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 CreateResourceGroup

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

Name String Yes my-project

The unique identifier of the resource group.

The identifier must be 3 to 50 characters in length and can contain letters, digits, and hyphens (-). The identifier must start with a letter.

DisplayName String Yes my-project

The display name of the resource group.

The name must be 1 to 50 characters in length.

Tag.N.Key String No k1

The key of tag N.

The tag key can be up to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun.

Tag.N.Value String No v1

The value of tag N.

The tag value can be up to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun.

Response parameters

Parameter

Type

Example

Description

RequestId String 04F0F334-1335-436C-A1D7-6C044FE73368

The request ID.

ResourceGroup Object

The information about the resource group.

DisplayName String my-project

The display name of the resource group.

Status String Creating

The status of the resource group. Valid values:

  • Creating: The resource group is being created.
  • OK: The resource group is created.
RegionStatuses Array of RegionStatus

The status of the resource group in all regions.

RegionStatus
Status String Creating

The status of the resource group. Valid values:

  • Creating: The resource group is being created.
  • OK: The resource group is created.
RegionId String cn-qingdao

The region ID.

AccountId String 151266687691****

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

Name String my-project

The unique identifier of the resource group.

CreateDate String 2021-06-05T14:39:13+08:00

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

Id String rg-9gLOoK****

The ID of the resource group.

Examples

Sample requests

https://resourcemanager.aliyuncs.com/?Action=CreateResourceGroup
&Name=my-project
&DisplayName=my-project
&<Common request parameters>

Sample success responses

XML format

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

<?xml version="1.0" encoding="UTF-8" ?>
<CreateResourceGroupResponse>
	<RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
	<ResourceGroup>
		<Status>Creating</Status>
		<RegionStatuses>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>ap-northeast-1</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>ap-south-1</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>ap-southeast-1</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>ap-southeast-2</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>ap-southeast-3</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>ap-southeast-5</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-beijing</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-chengdu</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-guangzhou</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-hangzhou</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-hangzhou-cloudstone</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-hangzhou-test-306</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-heyuan</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-hongkong</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-huhehaote</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-north-2-gov-1</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-qingdao</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-shanghai</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-shanghai-finance-1</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-shenzhen</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-shenzhen-finance-1</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-wulanchabu</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>cn-zhangjiakou</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>eu-central-1</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>eu-west-1</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>me-east-1</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>rus-west-1</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>us-east-1</RegionId>
			</RegionStatus>
			<RegionStatus>
				<Status>Creating</Status>
				<RegionId>us-west-1</RegionId>
			</RegionStatus>
		</RegionStatuses>
		<AccountId>151266687691****</AccountId>
		<DisplayName>my-project</DisplayName>
		<Id>rg-9gLOoK****</Id>
		<CreateDate>2021-06-05T14:39:13+08:00</CreateDate>
		<Name>my-project</Name>
	</ResourceGroup>
</CreateResourceGroupResponse>

JSON format

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

{
  "RequestId" : "04F0F334-1335-436C-A1D7-6C044FE73368",
  "ResourceGroup" : {
    "Status" : "Creating",
    "RegionStatuses" : {
      "RegionStatus" : [ {
        "Status" : "Creating",
        "RegionId" : "ap-northeast-1"
      }, {
        "Status" : "Creating",
        "RegionId" : "ap-south-1"
      }, {
        "Status" : "Creating",
        "RegionId" : "ap-southeast-1"
      }, {
        "Status" : "Creating",
        "RegionId" : "ap-southeast-2"
      }, {
        "Status" : "Creating",
        "RegionId" : "ap-southeast-3"
      }, {
        "Status" : "Creating",
        "RegionId" : "ap-southeast-5"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-beijing"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-chengdu"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-guangzhou"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-hangzhou"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-hangzhou-cloudstone"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-hangzhou-test-306"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-heyuan"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-hongkong"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-huhehaote"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-north-2-gov-1"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-qingdao"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-shanghai"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-shanghai-finance-1"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-shenzhen"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-shenzhen-finance-1"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-wulanchabu"
      }, {
        "Status" : "Creating",
        "RegionId" : "cn-zhangjiakou"
      }, {
        "Status" : "Creating",
        "RegionId" : "eu-central-1"
      }, {
        "Status" : "Creating",
        "RegionId" : "eu-west-1"
      }, {
        "Status" : "Creating",
        "RegionId" : "me-east-1"
      }, {
        "Status" : "Creating",
        "RegionId" : "rus-west-1"
      }, {
        "Status" : "Creating",
        "RegionId" : "us-east-1"
      }, {
        "Status" : "Creating",
        "RegionId" : "us-west-1"
      } ]
    },
    "AccountId" : "151266687691****",
    "DisplayName" : "my-project",
    "Id" : "rg-9gLOoK****",
    "CreateDate" : "2021-06-05T14:39:13+08:00",
    "Name" : "my-project"
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter.Name.InvalidChars The Name is invalid. The value of the Name parameter is invalid.
400 InvalidParameter.Name.Length The maximum length of Name is exceeded. The length of the value for the Name parameter exceeds the upper limit.
400 InvalidParameter.DisplayName.Length The maximum length of DisplayName is exceeded. The length of the value for the DisplayName parameter exceeds the upper limit.
400 MissingParameter.DisplayName You must specify DisplayName. The DisplayName parameter is not configured.
400 InvalidParameter.DisplayName The DisplayName is invalid. The value of the DisplayName parameter is invalid.
409 LimitExceeded.ResourceGroup The count of resource groups beyond the current limits. The number of resource groups exceeds the upper limit.

For a list of error codes, see Service error codes.