Adds a cluster to a specified security group.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | AddSecurityGroup |
The operation that you want to perform. Set the value to AddSecurityGroup. |
ClusterId | String | Yes | ehpc-hz-FYUr32**** |
The ID of the cluster. |
SecurityGroupId | String | Yes | sg-bp13n61xsydodfyg**** |
The ID of the security group. |
ClientToken | String | No | 123e4567-e89b-12d3-a456-426655440000 |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 04F0F334-1335-436C-A1D7-6C044FE73368 |
The ID of the request. |
Examples
Sample requests
https://ehpc.cn-hangzhou.aliyuncs.com/?Action=AddSecurityGroup
&ClusterId=ehpc-hz-FYUr32****
&SecurityGroupId=sg-bp13n61xsydodfyg****
&<Common request parameters>
Sample success responses
XML
format
<AddSecurityGroupResponse>
<RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
</AddSecurityGroupResponse>
JSON
format
{
"RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368"
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | InvalidSecurityGroup | The security group ID is invalid. | The error message returned because the security group is invalid. |
404 | SecurityGroupNotSupported | The security group is not supported. | The error message returned because the security group is not supported. |
404 | SecurityGroupAlreadyExists | The security group already exists. | The error message returned because the security group already exists. |
400 | InvalidParams | The specified parameter %s is invalid. | The error message returned because the specified parameter %s is invalid. |
404 | ClusterNotFound | The specified cluster does not exist. | The error message returned because the specified cluster does not exist. |
407 | NotAuthorized | You are not authorized by RAM for this request. | The error message returned because this request is not authorized by RAM. |
406 | EcsError | ECS api request error | The error message returned because the operation failed to call the ECS service. |
406 | DbError | A database service error occurred. | The error message returned because the database request failed. |
406 | AliyunError | Aliyun api service error | The error message returned because the operation failed to call other services. |
500 | UnknownError | An unknown error occurred. | The error message returned because an unknown error has occurred. |
503 | ServiceUnavailable | The request has failed due to a temporary failure of the server | The error message returned because the request has failed. The server is temporarily unavailable. |
For a list of error codes, visit the API Error Center.