Logo
OpenScaler
API Documentation/Virtual Private Cloud (VPC)

Create a New VPC

Create a new VPC with given parameters.

POST
/v1/vpcs

Authorization

AuthorizationRequiredBearer <token>

OAuth Authentication

OpenScaler API uses OAuth, a standard for secure authorization. To access the API, obtain a token via the OpenScaler Platform.

Use the access_token in the Authorization header for requests:

Authorization: Bearer <token>

Always keep your token secure and do not share it with anyone.

In: header

Request Body

application/jsonOptional
nameRequiredstring

The name of the VPC.

descriptionstring

The description of the VPC.

user_idRequiredstring

A globally unique identifier for a user (owner or resource).

project_idRequiredstring

A globally unique identifier for a project (where resource is placed). Projects are used to group resources together, each users must have at least one "default" project.

regionRequiredstring

Region where this resource will be created. One of the available regions, see Regions section for more information.

is_defaultboolean

Whether this is the default VPC for this account in given project and region.

Default: false
vpc_classstring

Subnet class of the VPC to be created.

Default: "A"Value in: "A" | "B" | "C"
vpc_maskinteger

Subnet netmask of the VPC to be created.

Default: 24Minimum: 16Maximum: 28
curl -X POST "https://api.alpha.openscaler.net/v1/vpcs" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-vpc",
    "description": "My website VPC",
    "user_id": "7247ba6a-b17d-4c72-94f1-a36108aee56d",
    "project_id": "my-project-default",
    "region": "alg1",
    "is_default": false,
    "vpc_class": "A",
    "vpc_mask": 24
  }'

VPC created successfully

{
  "name": "my-vpc",
  "description": "My website VPC",
  "subnet": "10.1.0.0/24",
  "vpc_id": 156,
  "is_default": false,
  "region": "alg1",
  "user_id": "7247ba6a-b17d-4c72-94f1-a36108aee56d",
  "project_id": "my-project-default"
}