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 ]}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/gpu/gateway/{gateway_id}/security-groups/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "security_groups_ids": [ 45, 46, ], },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/gateway/{gateway_id}/security-groups/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "security_groups_ids": [ 45, 46 ] }),});console.log(await response.json());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.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Load Balancer ID
Query Parameters
Section titled “Query Parameters”Project ID
Active IAM ID (To access contact person account) Find your Active IAM ID here
Location
Request Bodyrequired
Section titled “Request Bodyrequired”object
IDs of the security groups to attach: one to five, no repeats.
Example
[ 45, 46]Responses
Section titled “Responses”The security group or groups were attached
object
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.
object
object
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.
object
object
Example
{ "code": 404, "message": "Bad Request", "data": {}, "errors": "Gateway not found"}