The StackPath Developer Portal

Integrate our platform directly into your products and dynamically protect your edge.

Get Started    API Reference

Virtual Private Clouds

Overview

You can use this guide to better understand how to create and manage a VPC via the StackPath API.

This guide complements the corresponding API reference for Virtual Private Clouds.

StackPath offers the following API calls:

  • Get all VPCs
  • Create a VPC
  • Get a VPC
  • Delete a VPC (patch)
  • Delete a VPC (delete)
  • Create a network route
  • Get all network routes
  • Update a network route
  • Get a network route
  • Delete a network route
  • Get all subnets
  • Get a subnet
  • Delete a subnet
  • Create a subnet
  • Update a subnet

📘

Note

The above API calls are currently in beta.

To learn more about beta at StackPath, see Beta at StackPath.

Understand input parameters

Review the following table to understand how to make each API call.

API call

Description

Input parameters

(GET) Get all VPCs

This call returns all VPCs for a specific stack.

You can use this call to obtain the network_id for a specific VPC, which you will need for other VPC-related API calls.

To use this call, you must enter a stack_id.

To obtain a stack_id, run the Get all stacks call.

(POST) Create a VPC

This call creates a new VPC.

To use this call, you must enter a stack_id.

To obtain a stack_id, run the Get all stacks call.

(GET) Get a VPC

This call returns a specific VPC.

To use this call, you enter a:

  • stack_id
  • network_id

To obtain a stack_id, run the (GET) Get all stacks call.

To obtain a network_id, run the (GET) Get all VPC networks call.

(PATCH) Delete a VPC

This call updates the name of a specific VPC.

To use this call, you must enter a:

  • stack_id
  • network_id

To obtain a stack_id, run the (GET) Get all stacks call.

To obtain a network_id, run the (GET) Get all VPC networks call.

(DELETE) Delete a VPC

This call deletes a specific VPC.

You cannot delete a VPC that is assigned to a workload; you must first delete the workload, and then you can delete the VPC.

To use this call, you must enter a:

  • stack_id
  • network_id

To obtain a stack_id, run the (GET) Get all stacks call.

To obtain a network_id, run the (GET) Get all VPC networks call.

(POST) Create a network route

This call creates a route between an existing source workload and an existing target workload.

To use this call, you must have at least 2 existing workloads.

To use this call, you must enter a:

  • stack_id
  • network_id

To obtain a stack_id, run the (GET) Get all stacks call.

To obtain a network_id, run the (GET) Get all VPC networks call.

(GET) Get all network routes

This call returns all routes associated with a specific VPC.

To use this call, you must enter a:

  • stack_id
  • network_id

To obtain a stack_id, run the (GET) Get all stacks call.

To obtain a network_id, run the (GET) Get all VPC networks call.

(PUT) Update a network route

This call updates a specific component of a specific route.

To use this call, you must enter a:

  • stack_id
  • network_id
  • route_id

To obtain a stack_id, run the (GET) Get all stacks call.

To obtain a network_id, run the (GET) Get all VPC networks call.

To obtain a route_id, run the (GET) Get all network routes call. n

(GET) Get a network route

This call returns a specific route.

To use this call, you must enter a:

  • stack_id
  • network_id
  • route_id

To obtain a stack_id, run the (GET) Get all stacks call.

To obtain a network_id, run the (GET) Get all VPC networks call.

To obtain a route_id, run the (GET) Get all network routes call.

(DELETE) Delete a network route

This call deletes a specific route.

To use this call, you must enter a:

  • stack_id
  • network_id
  • route_id

To obtain a stack_id, run the (GET) Get all stacks call.

To obtain a network_id, run the (GET) Get all VPC networks call.

To obtain a route_id, run the (GET) Get all network routes call.

(GET) Get all subnets

This call retrieves all subnets for a specified network.

To use this call, you must enter a:

  • stack_id
  • network_id

To obtain a stack_id, run the (GET) Get all stacks call.

To obtain a network_id, run the (GET) Get all VPC networks call.

(GET) Get a subnet

This call retrieves a specified subnet.

To use this call, you must enter a:

  • stack_id
  • network_id
  • subnet_id

To obtain a stack_id, run the (GET) Get all stacks call.

To obtain a network_id, run the (GET) Get all VPC networks call.

To obtain a subnet_id, run the (GET) Get all subnets in a network call.

(DELETE) Delete a subnet

This call deletes a specified subnet.

To use this call, you must enter a:

  • stack_id
  • network_id
  • subnet_id

To obtain a stack_id, run the (GET) Get all stacks call.

To obtain a network_id, run the (GET) Get all VPC networks call.

To obtain a subnet_id, run the (GET) Get all subnets in a network call.

(POST) Create a subnet

This call creates a subnet for a specific VPC.

To use this call, you must enter a:

  • stack_id
  • network_id

To obtain a stack_id, run the (GET) Get all stacks call.

To obtain a network_id, run the (GET) Get all VPC networks call.

(PUT) Update a subnet

This call updates an existing subnet.

To use this call, you must enter a:

  • stack_id
  • network_id
  • subnet_id

To obtain a stack_id, run the (GET) Get all stacks call.

To obtain a network_id, run the (GET) Get all VPC networks call.

To obtain a subnet_id, run the (GET) Get all subnets in a network call.

Understand return values

Review the following table to understand specific data in the return.

API call

Description

(GET) Get all VPC networks

The return will display the network_id and slug_id for all VPC networks, which you will need for other VPC network-related API calls.

(POST) Create a VPC network

The return will display the network_id and slug_id for the newly created VPC network, which you will need for other VPC network-related API calls.

(GET) Get all subnets

The return will display the id for a specific subnet, which you will need for other subnet-related API calls.

Related documentation

To view API calls for VPC in the StackPath Developer Portal, see Virtual Private Cloud.

To view documentation regarding VPC in the StackPath Control Portal, see Create and Manage VPCs.

Updated 3 months ago

Virtual Private Clouds


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.