Create a new VPC
curl --request POST \
--url https://api.cloud.onidel.com/network/vpcs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"location": "sydney",
"name": "Production VPC",
"description": "VPC for production environment",
"v4_subnet": "10.0.0.0",
"v4_subnet_mask": "24",
"team_id": "c1d45377-b2a9-4407-ab8d-6909c34dfaac"
}
'import requests
url = "https://api.cloud.onidel.com/network/vpcs"
payload = {
"location": "sydney",
"name": "Production VPC",
"description": "VPC for production environment",
"v4_subnet": "10.0.0.0",
"v4_subnet_mask": "24",
"team_id": "c1d45377-b2a9-4407-ab8d-6909c34dfaac"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
location: 'sydney',
name: 'Production VPC',
description: 'VPC for production environment',
v4_subnet: '10.0.0.0',
v4_subnet_mask: '24',
team_id: 'c1d45377-b2a9-4407-ab8d-6909c34dfaac'
})
};
fetch('https://api.cloud.onidel.com/network/vpcs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cloud.onidel.com/network/vpcs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'location' => 'sydney',
'name' => 'Production VPC',
'description' => 'VPC for production environment',
'v4_subnet' => '10.0.0.0',
'v4_subnet_mask' => '24',
'team_id' => 'c1d45377-b2a9-4407-ab8d-6909c34dfaac'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cloud.onidel.com/network/vpcs"
payload := strings.NewReader("{\n \"location\": \"sydney\",\n \"name\": \"Production VPC\",\n \"description\": \"VPC for production environment\",\n \"v4_subnet\": \"10.0.0.0\",\n \"v4_subnet_mask\": \"24\",\n \"team_id\": \"c1d45377-b2a9-4407-ab8d-6909c34dfaac\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cloud.onidel.com/network/vpcs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"location\": \"sydney\",\n \"name\": \"Production VPC\",\n \"description\": \"VPC for production environment\",\n \"v4_subnet\": \"10.0.0.0\",\n \"v4_subnet_mask\": \"24\",\n \"team_id\": \"c1d45377-b2a9-4407-ab8d-6909c34dfaac\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloud.onidel.com/network/vpcs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"location\": \"sydney\",\n \"name\": \"Production VPC\",\n \"description\": \"VPC for production environment\",\n \"v4_subnet\": \"10.0.0.0\",\n \"v4_subnet_mask\": \"24\",\n \"team_id\": \"c1d45377-b2a9-4407-ab8d-6909c34dfaac\"\n}"
response = http.request(request)
puts response.read_bodyVPC
Create a new VPC
Create a new Virtual Private Cloud network
POST
/
network
/
vpcs
Create a new VPC
curl --request POST \
--url https://api.cloud.onidel.com/network/vpcs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"location": "sydney",
"name": "Production VPC",
"description": "VPC for production environment",
"v4_subnet": "10.0.0.0",
"v4_subnet_mask": "24",
"team_id": "c1d45377-b2a9-4407-ab8d-6909c34dfaac"
}
'import requests
url = "https://api.cloud.onidel.com/network/vpcs"
payload = {
"location": "sydney",
"name": "Production VPC",
"description": "VPC for production environment",
"v4_subnet": "10.0.0.0",
"v4_subnet_mask": "24",
"team_id": "c1d45377-b2a9-4407-ab8d-6909c34dfaac"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
location: 'sydney',
name: 'Production VPC',
description: 'VPC for production environment',
v4_subnet: '10.0.0.0',
v4_subnet_mask: '24',
team_id: 'c1d45377-b2a9-4407-ab8d-6909c34dfaac'
})
};
fetch('https://api.cloud.onidel.com/network/vpcs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cloud.onidel.com/network/vpcs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'location' => 'sydney',
'name' => 'Production VPC',
'description' => 'VPC for production environment',
'v4_subnet' => '10.0.0.0',
'v4_subnet_mask' => '24',
'team_id' => 'c1d45377-b2a9-4407-ab8d-6909c34dfaac'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cloud.onidel.com/network/vpcs"
payload := strings.NewReader("{\n \"location\": \"sydney\",\n \"name\": \"Production VPC\",\n \"description\": \"VPC for production environment\",\n \"v4_subnet\": \"10.0.0.0\",\n \"v4_subnet_mask\": \"24\",\n \"team_id\": \"c1d45377-b2a9-4407-ab8d-6909c34dfaac\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cloud.onidel.com/network/vpcs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"location\": \"sydney\",\n \"name\": \"Production VPC\",\n \"description\": \"VPC for production environment\",\n \"v4_subnet\": \"10.0.0.0\",\n \"v4_subnet_mask\": \"24\",\n \"team_id\": \"c1d45377-b2a9-4407-ab8d-6909c34dfaac\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloud.onidel.com/network/vpcs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"location\": \"sydney\",\n \"name\": \"Production VPC\",\n \"description\": \"VPC for production environment\",\n \"v4_subnet\": \"10.0.0.0\",\n \"v4_subnet_mask\": \"24\",\n \"team_id\": \"c1d45377-b2a9-4407-ab8d-6909c34dfaac\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Example:
"sydney"
Maximum string length:
200Example:
"Production VPC"
Maximum string length:
200Example:
"VPC for production environment"
IPv4 subnet prefix
Example:
"10.0.0.0"
IPv4 subnet mask
Example:
"24"
Team ID. Default team will be used if not provided.
Example:
"c1d45377-b2a9-4407-ab8d-6909c34dfaac"
Response
VPC created successfully
⌘I