Modifies the name or description of a security group.
Debugging
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 region ID of the security group. 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 new 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 This parameter is empty by default. |
Description | String | No | TestDescription |
The new description of the security group. The description must be 2 to 256 characters
in length and cannot start with 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
HttpCode | Error code | Error message | Description |
---|---|---|---|
404 | InvalidSecurityGroupId.NotFound | The specified SecurityGroupId does not exist. | The error message returned because the specified security group does not exist within 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. By default, the SecurityGroupName parameter is empty. If this parameter is specified, the specified name is displayed on the console. 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. |
403 | InvalidOperation.ResourceManagedByCloudProduct | %s | The error message returned because the security groups managed by cloud services cannot be modified. |
For a list of error codes, visit the API Error Center.