Configurations (configurations)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/master/configurations

Creating a new configuration

GET

/rest/v1/master/configurations

Getting the list of configurations

GET

/rest/v1/master/configurations/<id>

Getting configuration data

PATCH

/rest/v1/master/configurations/<id>

Modifying configuration data

DELETE

/rest/v1/master/configurations/<id>

Deleting a configuration

LOOKUP

/rest/v1/master/configurations

Searching for a configuration identifier


Creating a new configuration

Request

Field description: configuration entity

Example request
POST /rest/v1/master/configurations HTTP/1.1
Content-Type: application/json; charset=utf-8

configuration entity

Response

Field description: configuration entity

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

{
  "id": "ebff89d8-016b-d6e3-c598-e0d55e0cd13e",
  "name": "my config",
  "state": "initial",
  "content": {
    "general": {},
    "aliases": {},
    "domains": [],
    "sites": [],
    "servers": [],
    "roles": [],
    "structure": []
  },
  "opts": {
    "comment": "",
    "title": ""
  },
  "ext": {
    "ct": "2019-07-23T10:09:57.73Z",
    "lwt": "2019-07-23T10:09:57.73Z"
  }
}

Getting the list of configurations

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, state, ext.lwt, ext.ct, ext.version.

offset

int

Offset in the list of resources to output.

limit

int

Maximum number of resources in the list.

order

array<object|str>

Sorting order of resources in the list.

flat

bool

Transformation of composite fields to flat form.

Example request
GET /rest/v1/master/configurations?filter={"state":"valid"}&offset=0&limit=2 HTTP/1.1

Response

Field description: configuration entity

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

[
  {
    "id": "24be56bc-016c-1e4f-1fec-e0d55e0cd13e",
    "name": "autogenerated",
    "state": "valid",
    "ext": {
      "ct": "2019-07-09T13:19:39.92Z",
      "ext.lwt": "2019-07-09T13:19:39.92Z"
    }
  },
  {
    "id": "ebff89d8-016b-d6e3-c598-e0d55e0cd13e",
    "name": "my config",
    "state": "valid",
    "ext": {
      "ct": "2019-07-23T10:09:57.73Z",
      "lwt": "2019-09-10T16:06:22.15Z"
    }
  }
]

Getting configuration data

Request

Table 2. Request parameters
Name Type Description

mask

str

List of fields to output.

flat

bool

Transformation of composite fields to flat form.

Example request
GET /rest/v1/master/configurations/ebff89d8-016b-d6e3-c598-e0d55e0cd13e HTTP/1.1

Response

Field description: configuration entity

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

{
  "id": "ebff89d8-016b-d6e3-c598-e0d55e0cd13e",
  "name": "my config",
  "state": "valid",
  "content": {
    "general": {},
    "aliases": {},
    "domains": [],
    "sites": [],
    "servers": [],
    "roles": [],
    "structure": []
  },
  "opts": {
    "comment": "",
    "title": ""
  },
  "ext": {
    "ct": "2019-07-23T10:09:57.73Z",
    "lwt": "2019-07-23T10:09:57.73Z",
    "version": "3.0",
    "warnings": "",
    "errormsg": ""
  }
}

Modifying configuration data

Fields prohibited for modification: id

Request

Field description: configuration entity

Example request
PATCH /rest/v1/master/configurations/ebff89d8-016b-d6e3-c598-e0d55e0cd13e HTTP/1.1
Content-Type: application/json; charset=utf-8

configuration entity

Response

Field description: configuration entity

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

{
  "id": "ebff89d8-016b-d6e3-c598-e0d55e0cd13e",
  "name": "my config",
  "state": "valid",
  "content": {
    "general": {},
    "aliases": {},
    "domains": [],
    "sites": [],
    "servers": [],
    "roles": [],
    "structure": []
  },
  "opts": {
    "comment": "",
    "title": ""
  },
  "ext": {
    "ct": "2019-07-23T10:09:57.73Z",
    "lwt": "2019-09-10T16:06:22.15Z",
    "version": "3.0",
    "warnings": "",
    "errormsg": ""
  }
}

Deleting a configuration

Request

Example request
DELETE /rest/v1/master/configurations/ebff89d8-016b-d6e3-c598-e0d55e0cd13e HTTP/1.1

Response

Example response
HTTP/1.1 204 No Content

Searching for a configuration identifier

Searches for a resource by the specified key and returns the identifier(s) for building the endpoint.

Key fields for search: id

Request

Example request
LOOKUP /rest/v1/master/configurations HTTP/1.1
Content-Type: application/json; charset=utf-8

"ebff89d8-016b-d6e3-c598-e0d55e0cd13e"

Response

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

[
  "ebff89d8-016b-d6e3-c598-e0d55e0cd13e"
]
Example failed response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

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