This API is used to associate multiple NIC ports to or disassociate them from a specified security group at a time.
Restrictions
POST /v2.0/{project_id}/security-groups/{security_group_id}/instance/action
Name |
Mandatory |
Type |
Description |
|---|---|---|---|
ports |
Yes |
Array of Port objects |
Specifies the port list. A maximum of 20 ports are supported. For details, see Table 3. |
action |
Yes |
String |
Specifies the operation. The value can be add (associate) or remove (disassociate). The values are case-insensitive. |
POST https://{Endpoint}/v1/{project_id}/security-groups/0c4a2336-b036-4fa2-bc3c-1a291ed4c431/instance/action
{
"ports": [
{
"id": "b9ac5247-c4ca-4c9b-b8fa-7d19132e560a"
},
{
"id": "aa2f8625-0042-4627-a05c-61500b604cc3"
}
],
"action": "add"
}
{
"fail": [
{
"id": "99d9d709-8478-4b46-9f3f-2206b1023fd3",
"error_code": "VPC.0608",
"error_msg": "{\"NeutronError\":{\"message\":\"Port 99d9d709-8478-4b46-9f3f-2206b1023fd3 could not be found.\",\"type\":\"PortNotFound\",\"detail\":\"\"}}"
},
{
"id": "aa2f8625-0042-4627-a05c-61500b604cc3",
"error_code": "VPC.0607",
"error_msg": "An instance must belong to at least one security group"
}
]
}
{
"code": "VPC.0606",
"message": "Request is invalid"
}
See Status Codes.
See Error Codes.