You can call this operation to modify the name or description of a security group.

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 ModifySecurityGroupAttribute

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

RegionId String Yes cn-hangzhou

The ID of the region. You can call the DescribeRegions operation to query the most recent region list.

SecurityGroupId String Yes sg-bp67acfmxazb4p****

The ID of the security group.

SecurityGroupName String No SecurityGroupTestName

The name of the security group. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

This parameter is empty by default.

Description String No TestDescription

The description of the security group. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

This parameter is empty by default.

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=ModifySecurityGroupAttribute
&SecurityGroupId=sg-bp67acfmxazb4p****
&RegionId=cn-hangzhou
&SecurityGroupName=SecurityGroupTestName
&<Common request parameters>

Sample success responses

XML format

<ModifySecurityGroupAttributeResponse>
       <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
</ModifySecurityGroupAttributeResponse>

JSON format

{
    "RequestId":"CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}

Error codes

HTTP status code Error code Error message Description
404 InvalidSecurityGroupId.NotFound The specified SecurityGroupId does not exist. The error message returned because the specified SecurityGroupId parameter does not exist under this account. Check whether the security group ID is correct.
400 InvalidSecurityGroupName.Malformed Specified security group name is not valid. The error message returned because the specified SecurityGroupName parameter is invalid. The name is displayed in the console. By default, no name is specified for a security group. The name must be 2 to 128 characters in length. It must start with a letter and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It cannot start with http:// or https://.
400 InvalidSecurityGroupDiscription.Malformed Specified security group description is not valid. The error message returned because the specified Description parameter is invalid.

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