Subsidiary Domains (domains)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/domain/domains

Creating a new child domain

GET

/rest/v1/domain/domains

Getting the list of child domains

GET

/rest/v1/domain/domains/<id>

Retrieving child domain data

PATCH

/rest/v1/domain/domains/<id>

Changing the data of a child domain

DELETE

/rest/v1/domain/domains/<id>

Deleting a child domain

LOOKUP

/rest/v1/domain/domains

Searching for the child domain identifier


Creating a new child domain

Request

Field Description: domain entity

Request example
POST /rest/v1/domain/domains HTTP/1.1
Content-Type: application/json; charset=utf-8

domain entity

Response

Field Description: domain entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "521944bd-016c-b839-648f-50e54938780c",
  "name": "x.docs.rootdomain.ru",
  "solution": "era",
  "dbdefaultconn": 1,
  "dbhost": "",
  "dblogin": "",
  "dbport": 0,
  "dbpwd": "",
  "lic": {
    "domains": 100,
    "devices": 1000,
    "siptrunks": 5000
  },
  "opts": {
    "title": "",
    "comment": "",
    "isblocked": false,
    "dbuser": "none",
    "script_pause_between_components": 0,
    "script_limit_component_count": -1,
    "script_limit_site_count": -1,
    "script_duration_sec": -1,
    "script_allow_global_variables": true
  },
  "ext": {
    "ct": "2019-08-22T07:27:44.55Z",
    "lwt": "2019-08-22T07:27:44.55Z"
  }
}

Getting the list of child domains

Request

Table 1. Request parameters
Name Type Description

filter

object

Filter by field values.

mask

str

List of fields to output. Available fields for output: id, name, solution, lic, opts.title, opts.isblocked, opts.dbuser, opts.script_pause_between_components, opts.script_limit_component_count, opts.script_limit_site_count, opts.script_duration_sec, opts.script_allow_global_variables, ext.lwt, ext.ct.

offset

int

Offset in the list of resources to be issued.

limit

int

The maximum number of resources in the list.

order

array<object|str>

The sort order of the resources in the list.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/domain/domains?filter={"opts.isblocked":"false"}&offset=0&limit=2 HTTP/1.1

Response

Field Description: domain entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "id": "521944bd-016c-b839-648f-50e54938780c",
    "name": "x.docs.rootdomain.ru",
    "solution": "era",
    "lic": {
      "domains": 100,
      "devices": 1000,
      "siptrunks": 5000
    },
    "opts": {
      "title": "",
      "isblocked": false,
      "dbuser": "none",
      "script_pause_between_components": 0,
      "script_limit_component_count": -1,
      "script_limit_site_count": -1,
      "script_duration_sec": -1,
      "script_allow_global_variables": true
    },
    "ext": {
      "ct": "2019-08-22T07:27:44.55Z",
      "lwt": "2019-08-22T07:27:44.55Z"
    }
  },
  {
    "id": "2676d846-016c-b839-d915-50e54938780c",
    "name": "y.docs.rootdomain.ru",
    "solution": "era",
    "lic": {
      "domains": 2
    },
    "opts": {
      "title": "",
      "isblocked": false,
      "dbuser": "none",
      "script_pause_between_components": 0,
      "script_limit_component_count": -1,
      "script_limit_site_count": -1,
      "script_duration_sec": -1,
      "script_allow_global_variables": true
    },
    "ext": {
      "ct": "2019-08-22T07:28:14.61Z",
      "lwt": "2019-08-22T07:28:14.61Z"
    }
  }
]

Retrieving child domain data

Request

Table 2. Request parameters
Name Type Description

mask

str

A list of fields to output.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/domain/domains/521944bd-016c-b839-648f-50e54938780c HTTP/1.1

Response

Field Description: domain entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "521944bd-016c-b839-648f-50e54938780c",
  "name": "x.docs.rootdomain.ru",
  "solution": "era",
  "dbdefaultconn": 1,
  "dbhost": "",
  "dblogin": "",
  "dbport": 0,
  "dbpwd": "",
  "lic": {
    "domains": 100,
    "devices": 1000,
    "siptrunks": 5000
  },
  "opts": {
    "title": "",
    "comment": "",
    "isblocked": false,
    "dbuser": "none",
    "script_pause_between_components": 0,
    "script_limit_component_count": -1,
    "script_limit_site_count": -1,
    "script_duration_sec": -1,
    "script_allow_global_variables": true
  },
  "ext": {
    "ct": "2019-08-22T07:27:44.55Z",
    "lwt": "2019-08-22T07:27:44.55Z"
  }
}

Changing the data of a child domain

Fields prohibited for modification: id, name, solution

Request

Field Description: domain entity

Request example
PATCH /rest/v1/domain/domains/521944bd-016c-b839-648f-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8

domain entity

Response

Field Description: domain entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "521944bd-016c-b839-648f-50e54938780c",
  "name": "x.docs.rootdomain.ru",
  "solution": "era",
  "dbdefaultconn": 1,
  "dbhost": "",
  "dblogin": "",
  "dbport": 0,
  "dbpwd": "",
  "lic": {
    "domains": 120,
    "devices": 1200,
    "siptrunks": 5500
  },
  "opts": {
    "title": "",
    "comment": "",
    "isblocked": false,
    "dbuser": "read",
    "script_pause_between_components": 1,
    "script_limit_component_count": 100,
    "script_limit_site_count": 100,
    "script_duration_sec": 60,
    "script_allow_global_variables": false
  },
  "ext": {
    "ct": "2019-08-22T07:27:44.55Z",
    "lwt": "2019-09-10T21:35:27.41Z"
  }
}

Deleting a child domain

Request

Request example
DELETE /rest/v1/domain/domains/521944bd-016c-b839-648f-50e54938780c HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content

Searching for the child domain identifier

Searches the resource for the specified key, returns the identifier(s) to build the endpoint.

Key fields to search for: id, name

Request

Request example
LOOKUP /rest/v1/domain/domains HTTP/1.1
Content-Type: application/json; charset=utf-8

"x.docs.rootdomain.ru"

Response

Example of a successful response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8

[
  "521944bd-016c-b839-648f-50e54938780c"
]
Example of an unsuccessful response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error_code": 1404,
  "error_message": "Lookup failed"
}

Table of Contents (subsidiary resources)