Skip to main content
POST
/
v1
/
regions
/
{region}
/
projects
/
{project}
/
compute
/
addresses
Allocate IP address/pool
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    id: 'address-j1k2l3',
    ipAddress: '<string>',
    ipVersion: 'IPV4',
    addressType: 'EXTERNAL',
    network: '<string>',
    subnetwork: '<string>'
  })
};

fetch('https://api.k0rdent.ai/v1/regions/{region}/projects/{project}/compute/addresses', 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/addresses/address-j1k2l3",
  "uid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "id": "address-j1k2l3",
  "displayName": "<string>",
  "description": "<string>",
  "ipAddress": "<string>",
  "ipVersion": "IPV4",
  "addressType": "EXTERNAL",
  "network": "<string>",
  "subnetwork": "<string>",
  "status": "<string>",
  "createdAt": "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 allocate IP address.

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:

"address-j1k2l3"

ipAddress
string

Requested IP address. Can only be specified if addressType is INTERNAL.

ipVersion
enum<string>

The IP version to be used for this address.

Available options:
IPV4,
IPV6
addressType
enum<string>

IP address type. If not specified, defaults to EXTERNAL. If set to INTERNAL, either network or subnetwork must be specified.

Available options:
EXTERNAL,
INTERNAL
network
string<uri>

URL of the network to allocate address from. Can only be specified if addressType is INTERNAL. If IP is specified, it must be within the subnetwork range. If subnetwork is also specified, subnetwork must belong to this network.

subnetwork
string<uri>

URL of the subnetwork to allocate address from. Can only be specified if addressType is INTERNAL. If IP is specified, it must be within the subnetwork range. If network is also specified, subnetwork must belong to that network.

Response

IP address allocated

IP address allocation.

Server-defined URL for this resource.

Example:

"/v1/regions/us-texas-1/projects/project-x9y8z7/compute/addresses/address-j1k2l3"

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:

"address-j1k2l3"

displayName
string

Optional human-friendly display name for the address.

description
string

An optional description of this resource.

ipAddress
string

Allocated IP address

ipVersion
enum<string>

The IP version to be used for this address.

Available options:
IPV4,
IPV6
addressType
enum<string>

IP address type. If not specified, defaults to EXTERNAL.

Available options:
EXTERNAL,
INTERNAL
network
string<uri>

URL of the network to allocate address from. Can only be specified if addressType is INTERNAL.

subnetwork
string<uri>

URL of the subnetwork to allocate address from. Can only be specified if addressType is INTERNAL. If IP is specified, it must be within the subnetwork range.

status
string

Allocation status

createdAt
string<date-time>