Adding a listen IP address

Request method and URL

POST <API URL>/config/vips

A request body can contain settings listed in the table below.

Request body parameters

Parameter

Type (format)

Required

Default value

Description

address

String (ipv4)

Yes

Listen IP address for client requests

routes: destination

String

Yes, if you need to specify a traffic route that includes the listen IP address

IPv4 address and destination network in CIDR notation

routes: gateway

String (ipv4)

Yes, if you need to specify a traffic route that includes the listen IP address

IPv4 address of a gateway used for traffic routing

Response to a request

If an IP address is successfully added, the service will return a response with code 201 and list all the IP address settings.

A response body contains the parameters listed in the table below.

Response body parameters

Parameter

Type (format)

Description

id

String (uuid)

Identifier of a listen IP address

address

String (ipv4)

Listen IP address for client requests

last_modified

Double

Last time the listen IP address was modified in PT AF

routes

Array

List of routes

routes: gateway

String (ipv4)

IPv4 address of a gateway used for traffic routing

routes: destination

String

IPv4 address and destination network in the CIDR notation. You can also use default for default routes

If the system failed to add an IP address, the service will return an error message.

Error messages

Error code

Value

Example

401

Invalid token

{

  "error": "InvalidToken"

}

403

Access denied

{

  "error": "Forbidden"

}

422

A listen IP address setting is incorrect, or a required parameter in the request body is missing

{

  "errors": {

    "routes": {

      "0": {

        "gateway": ["not_valid_ipv4_address"]

      }

    }

  }

}

Example

Request:

JSON structure of a request body to add a listen IP address:

{
  "routes": [
    {
      "gateway": "10.120.9.1",
      "destination": "0.0.0.0/0"
    }
  ],
  "address": "10.120.9.133"
}

Response:

{
  "id": "edf66a2a-b193-4150-8c0a-5284e715dfbc",
  "last_modified": 1612349982,
  "address": "10.120.9.133",
  "routes": [
    {
      "gateway": "10.120.9.1",
      "destination": "0.0.0.0/0"
    }
  ]
}

The website uses cookies according to the cookie policy.