All Products
Search
Document Center

Resource Management:DeleteResourceGroup

Last Updated:Feb 13, 2025

Deletes a resource group.

Operation description

Note Before you delete a resource group, you must delete all the resources in it.

In this example, the resource group whose ID is rg-9gLOoK**** is deleted.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ResourceGroupIdstringYes

The ID of the resource group.

You can call the ListResourceGroups operation to obtain the ID.

rg-9gLOoK****

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

1C488B66-B819-4D14-8711-C4EAAA13AC01
ResourceGroupobject

The information of the resource group.

DisplayNamestring

The display name of the resource group.

my-project
Statusstring

The status of the resource group. Valid values:

  • Creating: The resource group is being created.
  • OK: The resource group is created.
  • PendingDelete: The resource group is waiting to be deleted.
PendingDelete
RegionStatusesarray<object>

The status of the resource group in all regions.

RegionStatusobject
Statusstring

The status of the resource group. Valid values:

  • Creating: The resource group is being created.
  • OK: The resource group is created.
  • PendingDelete: The resource group is waiting to be deleted.
  • Deleting: The resource group is being deleted.
PendingDelete
RegionIdstring

The region ID.

cn-qingdao
AccountIdstring

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

123456789****
Namestring

The unique identifier of the resource group.

my-project
CreateDatestring

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

2015-01-23T12:33:18Z
Idstring

The ID of the resource group.

rg-9gLOoK****

Examples

Sample success responses

JSONformat

{
  "RequestId": "1C488B66-B819-4D14-8711-C4EAAA13AC01",
  "ResourceGroup": {
    "DisplayName": "my-project",
    "Status": "PendingDelete",
    "RegionStatuses": {
      "RegionStatus": [
        {
          "Status": "PendingDelete",
          "RegionId": "cn-qingdao"
        }
      ]
    },
    "AccountId": "123456789****",
    "Name": "my-project",
    "CreateDate": "2015-01-23T12:33:18Z",
    "Id": "rg-9gLOoK****"
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameter.ResourceGroupIdThe ResourceGroupId is invalid.The resource group ID is invalid.
404EntityNotExists.ResourceGroupThe 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.
409DeleteConflict.ResourceGroup.ResourceFailed 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.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history