PUT
/api/v1/scaler/scalegroups/{scaler_id}/vpc/action/
curl --request PUT \ --url 'https://api.e2enetworks.com/myaccount/api/v1/scaler/scalegroups/{scaler_id}/vpc/action/?project_id=<PROJECT_ID>&apikey=<API_KEY>&location=<LOCATION>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "vpc": [ { "name": "VPC-Example", "network_id": 12345, "ipv4_cidr": "10.8.46.0/23", "state": "", "subnets": [], "is_e2e_vpc": true } ]}'import requests
response = requests.put( "https://api.e2enetworks.com/myaccount/api/v1/scaler/scalegroups/{scaler_id}/vpc/action/", params={"project_id": "<PROJECT_ID>", "apikey": "<API_KEY>", "location": "<LOCATION>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "vpc": [ { "name": "VPC-Example", "network_id": 12345, "ipv4_cidr": "10.8.46.0/23", "state": "", "subnets": [], "is_e2e_vpc": True, }, ], },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/scaler/scalegroups/{scaler_id}/vpc/action/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", apikey: "<API_KEY>", location: "<LOCATION>" });
const response = await fetch(url, { method: "PUT", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "vpc": [ { "name": "VPC-Example", "network_id": 12345, "ipv4_cidr": "10.8.46.0/23", "state": "", "subnets": [], "is_e2e_vpc": true } ] }),});console.log(await response.json());Attaches one or more VPC networks to the group. New nodes launched after the change join the attached VPC(s). VPC operations are only allowed while the group is stopped - use Stop / Start first.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”scaler_id
required
integer
The id of the auto scaling group, as returned by List.
Example
12345Query Parameters
Section titled “Query Parameters”project_id
required
integer
Identifier of the project to scope the request to. Required integer project ID.
Example
<PROJECT_ID>apikey
required
string
API key used to authenticate the request.
Example
<API_KEY>location
required
string
Region of the group.
Example
<LOCATION>Request Body
Section titled “Request Body”Media typeapplication/json
VPC networks to attach to the group.
object
vpc
required
List of VPC networks to attach.
Array<object>
object
name
VPC name.
string
Example
VPC-Examplenetwork_id
VPC network ID.
integer
Example
12345ipv4_cidr
IPv4 CIDR block of the VPC.
string
Example
10.8.46.0/23state
VPC state.
string
Example
subnets
Subnets within the VPC.
Array
is_e2e_vpc
Whether this is an E2E-managed VPC.
boolean
Example
trueExample
{ "vpc": [ { "name": "VPC-Example", "network_id": 12345, "ipv4_cidr": "10.8.46.0/23", "state": "", "subnets": [], "is_e2e_vpc": true } ]}Responses
Section titled “Responses”Successful response
Media typeapplication/json
VPC attach confirmation.
object
code
integer
data
string
errors
object
message
string
Example
{ "code": 200, "data": "vpc has been attached successfully", "message": "Success"}