Skip to main content
POST
/
v1
/
regions
/
{region}
/
projects
/
{project}
/
compute
/
networks
Create provider network
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    cidr: '<string>',
    id: 'network-g7h8i9',
    displayName: '<string>',
    description: '<string>'
  })
};

fetch('https://api.k0rdent.ai/v1/regions/{region}/projects/{project}/compute/networks', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "selfLink": "/v1/regions/us-texas-1/projects/project-x9y8z7/compute/networks/network-g7h8i9",
  "uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "id": "network-g7h8i9",
  "displayName": "<string>",
  "description": "<string>",
  "cidr": "<string>",
  "subnets": [
    {
      "selfLink": "/v1/regions/us-texas-1/projects/project-x9y8z7/compute/subnets/subnet-a1b2c3",
      "uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "id": "subnet-a1b2c3",
      "displayName": "<string>",
      "description": "<string>",
      "network": "/v1/regions/us-texas-1/projects/project-x9y8z7/compute/networks/default",
      "ipv4Cidr": "10.0.1.0/24",
      "ipv6Cidr": "fd00:1::/64",
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z"
    }
  ],
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer token authentication using OAuth2/OIDC tokens

Path Parameters

region
string
required

Region identifier

project
string
required

Project identifier

Body

application/json

Request to create provider network.

cidr
string
required

CIDR block for the network.

id
string

Name of the resource. Must be 1-63 characters long and match the pattern a-z? — the first character must be a lowercase letter, and all following characters must be lowercase letters, digits, or hyphens, with the last character being a letter or digit. If not specified, the server will generate a name.

Required string length: 1 - 63
Pattern: ^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:

"network-g7h8i9"

displayName
string

Optional human-friendly display name for the network.

description
string

An optional description of this resource.

Response

Network created

Provider network resource.

Server-defined URL for this resource.

Example:

"/v1/regions/us-texas-1/projects/project-x9y8z7/compute/networks/network-g7h8i9"

uid
string<uuid>

Server-generated UUID.

id
string

Name of the resource. Provided by the client when the resource is created, or generated by the server if not specified. Must be 1-63 characters long and match the pattern a-z? — the first character must be a lowercase letter, and all following characters must be lowercase letters, digits, or hyphens, with the last character being a letter or digit. Cannot be changed after the resource is created.

Required string length: 1 - 63
Pattern: ^[a-z]([-a-z0-9]*[a-z0-9])?$
Example:

"network-g7h8i9"

displayName
string

Optional human-friendly display name for the network.

description
string

An optional description of this resource.

cidr
string

CIDR block. Immutable after creation.

subnets
object[]

Subnets belonging to this network. Read-only.

createdAt
string<date-time>
updatedAt
string<date-time>