Home >Operation and Maintenance >Linux Operation and Maintenance >How to add an instance to a specified security group
This article introduces how to add an instance to a specified security group, and focuses on the specific steps. The content of this article is compact, and I hope you can gain something from it.
JoinSecurityGroup
Join an instance to the specified security group.
Description
When calling this interface, you need to pay attention to:
Before joining the security group, the instance must be stopped (Stopped) or running (Running) status.
An instance can join up to 5 security groups.
Each security group can manage up to 1,000 instances.
Your security group and instance must belong to the same Alibaba Cloud region.
The network type of your security group and instance must be the same. If the network type is VPC, the security group and instance must belong to the same VPC.
Request parameters
##Return parameters
are all public return parameters. See Public Parameters.Example
Request example
https://ecs.aliyuncs.com/?Action=JoinSecurityGroup &InstanceId= i-instance1 &SecurityGroupId=F876FF7BA984 &<公共请求参数>
Return example
XML format
<JoinSecurityGroupResponse> <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId> </JoinSecurityGroupResponse>
JSON format
{ "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E" }
Error code
The following are error codes unique to this interface. For more error codes, please visit the API Error Center.The above is the detailed content of How to add an instance to a specified security group. For more information, please follow other related articles on the PHP Chinese website!