Updates the basic information of a resource group.

In this example, the display name of the resource group rg-9gLOoK**** is changed to project.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes UpdateResourceGroup

The operation that you want to perform. Set the value to UpdateResourceGroup.

ResourceGroupId String Yes rg-9gLOoK****

The ID of the resource group.

You can call the ListResourceGroups operation to obtain the ID.

NewDisplayName String Yes project

The display name of the resource group.

The name must be 1 to 50 characters in length.

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

Response parameters

Parameter Type Example Description
RequestId String 04F0F334-1335-436C-A1D7-6C044FE73368

The ID of the request.

ResourceGroup Object

The information of the resource group.

DisplayName String project

The display name of the resource group.

AccountId String 123456789****

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

Name String my-project

The unique identifier of the resource group.

CreateDate String 2015-01-23T12:33:18+08:00

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

Id String rg-9gLOoK****

The ID of the resource group.

Examples

Sample requests

https://resourcemanager.aliyuncs.com/?Action=UpdateResourceGroup
&NewDisplayName=project
&ResourceGroupId=rg-9gLOoK****
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<?xml version="1.0" encoding="UTF-8" ?>
<UpdateResourceGroupResponse>
	<RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
	<ResourceGroup>
		<Id>rg-9gLOoK****</Id>
		<AccountId>123456789****</AccountId>
		<Name>my-project</Name>
		<DisplayName>project</DisplayName>
		<CreateDate>2015-01-23T12:33:18+08:00</CreateDate>
	</ResourceGroup>
</UpdateResourceGroupResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "04F0F334-1335-436C-A1D7-6C044FE73368",
  "ResourceGroup" : {
    "Id" : "rg-9gLOoK****",
    "AccountId" : "123456789****",
    "Name" : "my-project",
    "DisplayName" : "project",
    "CreateDate" : "2015-01-23T12:33:18+08:00"
  }
}

Error codes

HTTP status code Error code Error message Description
400 InvalidParameter.ResourceGroupId The ResourceGroupId is invalid. The error message returned because the ID of the resource group is invalid.
400 InvalidParameter.DisplayName The DisplayName is invalid. The error message returned because the value of the DisplayName parameter is invalid.
400 MissingParameter.DisplayName You must specify DisplayName. The error message returned because the DisplayName parameter is not specified.
400 InvalidParameter.DisplayName.Length The maximum length of DisplayName is exceeded. The error message returned because the length of the value specified for the DisplayName parameter has exceeded the upper limit.
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.

For a list of error codes, visit the API Error Center.