To move an instance out of a security group
Describe
Moves the instance out of the specified security group.
You can perform this operation only if the instance state is Stopped or Running state.
Each instance belongs to at least one security group, and if the instance belongs to only one security group, the request fails when you try to move out.
Request parameters
name |
type |
whether you must |
Description |
Action |
String |
Is |
System specified parameters, values: Leavesecuritygroup |
Instanceid |
String |
Is |
The specified instance ID |
Securitygroupid |
String |
Is |
Security Group Code |
return parameters
All public return parameters, as detailed in the public return parameters
Error code
Error code |
Description |
Http Status Code |
Semantics |
Invalidinstanceid.notfound |
The Instanceid provided does not exist at our records. |
60v |
The specified Instanceid does not exist |
Missingparameter |
The input parameter "Instanceid" is mandatory to processing this request isn't supplied. |
400 |
Missing Instanceid value |
Invalidsecuritygroupid.notfound |
The securitygroupid provided does not exist at our records. |
60v |
The specified securitygroupid does not exist |
Missingparameter |
The input parameter "Securitygroupid" is mandatory to processing this request isn't supplied. |
400 |
Missing securitygroupid value |
Instancelastsecuritygroup |
The Securitygroup is the ' only one ' for the Instance. |
403 |
The security group is the only security group for this instance |
Incorrectinstancestatus |
The current status of the resource does is not support this operation. |
403 |
The current state of the resource does not support this operation |
Instancelockedforsecurity |
The specified operation is denied as your instance are locked for security reasons. |
403 |
The resource is currently denied operation by security lockdown |
Example
Request sample
Https://ecs.aliyuncs.com/?Action=LeaveSecurityGroup
&instanceid=i-instance1
&securitygroupid=f876ff7ba984
&< Public Request Parameters >
Return sample
XML format
473469c7-aa6f-4dc5-b3db-a3dc0de3c83e
JSON format
{
"RequestID": "473469c7-aa6f-4dc5-b3db-a3dc0de3c83e"
}