調用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個字符,不能以 |
Tag.N.Value | String | 否 | v1 | 標簽值。 最多支持128個字符,不能以 |
返回數據
名稱 |
類型 |
示例值 |
描述 |
RequestId | String | 04F0F334-1335-436C-A1D7-6C044FE73368 | 請求ID。 |
ResourceGroup | Object | 資源組信息。 |
|
DisplayName | String | my-project | 資源組顯示名稱。 |
Status | String | Creating | 資源組狀態。
|
RegionStatuses | Array of RegionStatus | 各個地域的資源組狀態。 |
|
RegionStatus | |||
Status | String | Creating | 資源組狀態。
|
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. | 資源組數量超出限制。 |
訪問錯誤中心查看更多錯誤碼。
文檔內容是否對您有幫助?