curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/autoscale-groups/{group_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/notebooks/autoscale-groups/{group_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/notebooks/autoscale-groups/{group_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 an Auto Scaling Group, which applies them to every VM in it, including VMs added later. The Security Groups must be in the same project and region as the group. A group that is already attached is skipped. If one cannot be attached, the call fails with “Security group addition failed”. Groups that attached successfully stay attached. Needs the permission to update.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Auto Scaling Group 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. At least one, at most 5, no repeats.
Example
[ 45, 46]Responses
Section titled “Responses”Security Groups attached
object
object
Example
{ "code": 200, "message": "Success", "data": "Security group addition successful", "errors": {}}The list is missing, not a list, empty, has a repeat or is too long; or a Security Group could not be attached. errors is “Project ID is missing or invalid” when project_id is missing or not a number.
object
object
One of: “security_groups_ids must be a list.”, “No security group provided in the request.”, “Duplicate security groups found in the request.”, “Security group addition failed”, or a refusal when the request holds more than five groups.
Example
{ "code": 400, "message": "Bad Request", "data": {}, "errors": "Duplicate security groups found in the request."}No Auto Scaling Group with that ID in the project and region.
object
object
Example
{ "code": 404, "message": "Bad Request", "data": {}, "errors": "Autoscale Group not found"}