POST
/notebooks/{Instance_id}/security-groups/
curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/{Instance_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": [ 0, 0 ]}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/{Instance_id}/security-groups/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "security_groups_ids": [ 0, 0, ], },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/{Instance_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": [ 0, 0 ] }),});console.log(await response.json());Attaches one or more Security Groups to the Instance or Virtual Machine, up to five in one request. The list must not repeat a group (“Duplicate security groups found in the request.”) or be empty (“No security group provided in the request.”). A request for more than five is refused.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Instance_id
required
integer
Instance ID
Query Parameters
Section titled “Query Parameters”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
Location
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
security_groups_ids
Array<integer>
Example
[ 0, 0]Responses
Section titled “Responses”Security group added successfully
Media typeapplication/json
object
code
integer
data
string
errors
object
message
string
Example
{ "code": 200, "data": "Security group addition successful", "errors": {}, "message": "Success"}