Deletes a resource group.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DeleteResourceGroup |
The operation that you want to perform. Set the value to DeleteResourceGroup. |
ResourceGroupId | String | Yes | rg-9gLOoK**** |
The ID of the resource group. You can call the ListResourceGroups operation to obtain the ID. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 1C488B66-B819-4D14-8711-C4EAAA13AC01 |
The ID of the request. |
ResourceGroup | Struct |
The information of the resource group. |
|
AccountId | String | 123456789**** |
The ID of the Alibaba Cloud account to which the resource group belongs. |
CreateDate | String | 2015-01-23T12:33:18Z |
The time when the resource group was created. |
DisplayName | String | my-project |
The display name of the resource group. |
Id | String | rg-9gLOoK**** |
The ID of the resource group. |
Name | String | my-project |
The unique identifier of the resource group. |
RegionStatuses | Array of RegionStatus |
The status of the resource group in all regions. |
|
RegionStatus | |||
RegionId | String | cn-qingdao |
The region ID. |
Status | String | PendingDelete |
The status of the resource group. Valid values:
|
Status | String | PendingDelete |
The status of the resource group. Valid values:
|
Examples
Sample requests
https://resourcemanager.aliyuncs.com/?Action=DeleteResourceGroup
&ResourceGroupId=rg-9gLOoKNF38
&<Common request parameters>
Sample success responses
XML
format
<DeleteResourceGroupResponse>
<RequestId>1C488B66-B819-4D14-8711-C4EAAA13AC01</RequestId>
<ResourceGroup>
<Id>rg-9gLOoK****</Id>
<AccountId>123456789****</AccountId>
<Name>my-project</Name>
<DisplayName>my-project</DisplayName>
<Status>PendingDelete</Status>
<RegionStatuses>
<RegionStatus>
<RegionId>cn-hangzhou</RegionId>
<Status>PendingDelete</Status>
</RegionStatus>
<RegionStatus>
<RegionId>cn-qingdao</RegionId>
<Status>PendingDelete</Status>
</RegionStatus>
</RegionStatuses>
<CreateDate>2015-01-23T12:33:18Z</CreateDate>
</ResourceGroup>
</DeleteResourceGroupResponse>
JSON
format
{
"RequestId": "1C488B66-B819-4D14-8711-C4EAAA13AC01",
"ResourceGroup": {
"Id": "rg-9gLOoK****",
"AccountId": "123456789****",
"Name": "my-project",
"DisplayName": "my-project",
"Status": "PendingDelete",
"RegionStatuses":{
"RegionStatus":[
{
"RegionId":"cn-hangzhou",
"Status":"PendingDelete"
},
{
"RegionId":"cn-qingdao",
"Status":"PendingDelete"
}
]
},
"CreateDate": "2015-01-23T12:33:18Z"
}
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
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 the resource group first. |
409 | DeleteConflict.ResourceGroup.Resource | Failed to delete the resource group because one or more cloud resources exist in the resource group. Try again later after you release the cloud resources. | The error message returned because the resource group contains cloud resources. Release the resources first. |
400 | InvalidParameter.ResourceGroupId | The ResourceGroupId is invalid. | The error message returned because the ID of the resource group is invalid. |
For a list of error codes, visit the API Error Center.