IP address policies

On this page:

THE IP ADDRESS POLICY OBJECT

A detailed description of the JSON object

GET[base]/addresses

Get a list of IP address policies

GET[base]/addresses/{addressId}

Get IP address policy details

POST[base]/addresses

Add a new IP address policy

PUT[base]/addresses/{addressId}

Update an IP address policy

DELETE[base]/addresses/{addressId}

Delete an IP address policy


The IP address policy object

This object provides the following data about an IP address policy:

addressId string

The IP address policy identifier.

ipAddress string

The IP address.

policy string

The policy. Possible values:

  • allow

  • deny

ttl integer

The time-to-live value, in seconds.

expireTime string

The policy expiration time, in seconds.

createTime string

The date and time when the object has been created.

updateTime string

The date and time when the object has been last updated.

THE IP ADDRESS POLICY OBJECT
{
  "addressId": "6006dda272f002519c3eb505",
  "ipAddress": "185.155.96.184",
  "policy": "allow",
  "ttl": 1,
  "createTime": "2021-01-01T00:00:00+00:00",
  "expireTime": "2021-01-01T00:00:00+00:00",
  "updateTime": "2021-01-01T00:00:00+00:00"
}

Get a list of IP address policies

Use this method to obtain a list of IP address policies.

To obtain detailed information about a specified IP address policy, use a separate method to get IP address policy details.

Request

Header parameters:

  • Authorization: Bearer <token>

Query parameters:

This method supports pagination, sorting, and filtering. For details on applying the parameters, refer to the Query parameters section. Possible parameters for filtering and sorting are listed below. For values description, refer to the IP address policy object.

Possible values for the filter parameter:

  • ip

  • createTime

  • expireTime

  • policy

  • ttl

  • updateTime

Possible values for the sort_by parameter:

  • ip

  • createTime (default)

  • expireTime

  • policy

  • ttl

  • updateTime

GET[base]/addresses

curl --location -g --request GET 'https://your.base-url.here/addresses?limit=10&offset=0&sort_by=createTime&sort_order=desc&filter[createTime]=2021-01-01&filter[expireTime]=2021-01-01&filter[ip]=185.155.96.184&filter[policy]=allow&filter[ttl]=1&filter[updateTime]=2021-01-01' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, the response body contains an array of IP address policy objects providing information about all IP address policies that correspond to the query parameters specified in the request.


Get IP address policy details

Use this method to obtain detailed information about a specified IP address policy.

To obtain a list of IP address policies, use a separate method to get a list of IP address policies.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

addressId required

The identifier of an IP address policy.

GET[base]/addresses/{addressId}

curl --location --request GET 'https://your.base-url.here/addresses/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, the response body contains an IP address policy object providing information about the specified IP address policy.


Add a new IP address policy

Use this method to add a new IP address policy.

Request

Header parameters:

  • Authorization: Bearer <token>

  • Content-Type: application/json

Body:

ipAddress string

The IP address.

policy string

The policy. Possible values:

  • allow

  • deny

ttl integer

The time-to-live value, in seconds.

POST[base]/addresses

curl --location --request POST 'https://your.base-url.here/addresses' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "ipAddress": "185.155.96.184",
  "policy": "allow",
  "ttl": 1
}'

Response

Body:

In case of success, the response body contains an IP address policy object providing information about the newly created IP address policy.


Update an IP address policy

Use this method to update a specified IP address policy.

Note

Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.

Request

Header parameters:

  • Authorization: Bearer <token>

  • Content-Type: application/json

Path parameters:

addressId required

The IP address policy identifier.

Body:

Values of the following fields can be updated:

ipAddress string

The IP address.

policy string

The policy. Possible values:

  • allow

  • deny

ttl integer

The time-to-live value, in seconds.

PUT[base]/addresses/{addressId}

curl --location --request PUT 'https://your.base-url.here/addresses/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "ipAddress": "185.155.96.184",
  "policy": "allow",
  "ttl": 1
}'

Response

Body:

In case of success, the response body contains an IP address policy object providing information about the updated IP address policy.


Delete an IP address policy

Use this method to delete a specified IP address policy.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

addressId required

The IP address policy identifier.

DELETE[base]/addresses/{addressId}

curl --location --request DELETE 'https://your.base-url.here/addresses/60ba407d15951453e60e49f8' \
--header 'Authorization: Bearer <token>'

Response

Body:

In case of success, no response body is returned.