CreateResourceGroup

调用CreateResourceGroup创建资源组。

说明 一个阿里云账号下最多创建30个资源组。

调试

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

请求参数

名称

类型

是否必选

示例值

描述

Action String CreateResourceGroup

要执行的操作。取值:CreateResourceGroup。

Name String my-project

资源组唯一标识。

长度为3~50个字符,可包含英文字母、数字和短划线(-)。必须以英文字母开头。

DisplayName String my-project

资源组显示名称。

长度为1~50个字符或汉字。

Tag.N.Key String k1

标签键。

最多支持128个字符,不能以aliyunacs:开头,不能包含http://或者https://

Tag.N.Value String v1

标签值。

最多支持128个字符,不能以aliyunacs:开头,不能包含http://或者https://

返回数据

名称

类型

示例值

描述

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

请求ID。

ResourceGroup Object

资源组信息。

DisplayName String my-project

资源组显示名称。

Status String Creating

资源组状态。

  • Creating:创建中。
  • OK:创建成功。
RegionStatuses Array of RegionStatus

各个地域的资源组状态。

RegionStatus
Status String Creating

资源组状态。

  • Creating:创建中。
  • OK:创建成功。
RegionId String cn-qingdao

地域ID。

AccountId String 151266687691****

资源组所属的阿里云账号ID。

Name String my-project

资源组唯一标识。

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

资源组创建时间(UTC时间)。

Id String rg-9gLOoK****

资源组ID。

示例

请求示例

https://resourcemanager.aliyuncs.com/?Action=CreateResourceGroup
&Name=my-project
&DisplayName=my-project
&<公共请求参数>

正常返回示例

XML格式

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格式

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"
  }
}

错误码

HttpCode

错误码

错误信息

描述

400 InvalidParameter.Name.InvalidChars The Name is invalid. 参数Name无效。
400 InvalidParameter.Name.Length The maximum length of Name is exceeded. 参数Name长度超出范围。
400 InvalidParameter.DisplayName.Length The maximum length of DisplayName is exceeded. 参数DisplayName长度超出范围。
400 MissingParameter.DisplayName You must specify DisplayName. 参数DisplayName缺失。
400 InvalidParameter.DisplayName The DisplayName is invalid. 参数DisplayName无效。
409 LimitExceeded.ResourceGroup The count of resource groups beyond the current limits. 资源组数量超出限制。

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