Deletes a resource group.
Operation description
Before you delete a resource group, you must delete all the resources in it.
In this example, the resource group rg-9gLOoK**** is deleted.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ResourceGroupId |
string |
Yes |
The ID of the resource group. Call the ListResourceGroups operation to obtain the ID. |
rg-9gLOoK**** |
For common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The ID of the request. |
1C488B66-B819-4D14-8711-C4EAAA13AC01 |
| ResourceGroup |
object |
The resource group information. |
|
| AccountId |
string |
The Alibaba Cloud account ID that owns the resource group. |
123456789**** |
| CreateDate |
string |
The time when the resource group was created, in UTC. |
2015-01-23T12:33:18Z |
| DisplayName |
string |
The display name of the resource group. |
my-project |
| Id |
string |
The ID of the resource group. |
rg-9gLOoK**** |
| Name |
string |
The unique identifier of the resource group. |
my-project |
| RegionStatuses |
object |
||
| RegionStatus |
array<object> |
The status of the resource group in all regions. |
|
|
object |
|||
| RegionId |
string |
The region ID. |
cn-qingdao |
| Status |
string |
The status of the resource group. Valid values:
|
PendingDelete |
| Status |
string |
The status of the resource group. Valid values:
|
PendingDelete |
Examples
Success response
JSON format
{
"RequestId": "1C488B66-B819-4D14-8711-C4EAAA13AC01",
"ResourceGroup": {
"AccountId": "123456789****",
"CreateDate": "2015-01-23T12:33:18Z",
"DisplayName": "my-project",
"Id": "rg-9gLOoK****",
"Name": "my-project",
"RegionStatuses": {
"RegionStatus": [
{
"RegionId": "cn-qingdao",
"Status": "PendingDelete"
}
]
},
"Status": "PendingDelete"
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter.ResourceGroupId | The ResourceGroupId is invalid. | The resource group ID is invalid. |
| 404 | EntityNotExists.ResourceGroup | The specified resource group does not exist. You must first create a resource group. | The specified resource group does not exist. You must first create a resource group. |
| 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. | 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. |
| 409 | DeleteConflict.ResourceGroup.ResourceCenterResource | The resource group cannot be deleted while it contains cloud resources detected by the Resource Center. Please release these resources and try again. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.