Skip to content

Attach Security Groups to Load Balancer

POST
/gateway/{gateway_id}/security-groups/
curl --request POST \
--url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/gateway/{gateway_id}/security-groups/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \
--header 'Authorization: Bearer <API_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"security_groups_ids": [
45,
46
]
}'

Attaches up to five security groups to the Load Balancer in one request, so their rules start to apply to its traffic. The list must not be empty or repeat a group. A group that is already attached, or is not an active group of this project and region, is not attached; the other groups in the request still are, and the call answers 400 “Security group addition failed”. Needs the Update permission for Load Balancers.

gateway_id
required
integer

Load Balancer ID

project_id
required
integer

Project ID

active_iam
integer

Active IAM ID (To access contact person account) Find your Active IAM ID here

location
required
string
Allowed values: Delhi Chennai

Location

Media typeapplication/json
object
security_groups_ids
required

IDs of the security groups to attach: one to five, no repeats.

Array<integer>

Example

[
45,
46
]

The security group or groups were attached

Media typeapplication/json
object
code
integer
message
string
data
string
errors
object

Example

{
"code": 200,
"message": "Success",
"data": "Security group addition successful",
"errors": {}
}

security_groups_ids is not a list (“security_groups_ids must be a list.”), is empty (“No security group provided in the request.”), repeats a group (“Duplicate security groups found in the request.”), holds more than five IDs, or one or more groups could not be attached (“Security group addition failed”). The same 400 is returned, with the project’s own text, when project_id is missing or not a number.

Media typeapplication/json
object
code
integer
message
string
data
object
errors
string

Example

{
"code": 400,
"message": "Bad Request",
"data": {},
"errors": "No security group provided in the request."
}

No Load Balancer with that ID in the project and region.

Media typeapplication/json
object
code
integer
message
string
data
object
errors
string

Example

{
"code": 404,
"message": "Bad Request",
"data": {},
"errors": "Gateway not found"
}