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>

Retrieving configuration data

PATCH

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

Changing configuration data

DELETE

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

Deleting a configuration

LOOKUP

/rest/v1/master/configurations

Searching for a configuration ID


Creating a new configuration

Request

Field Description: configuration entity

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

configuration entity

Response

Field Description: configuration entity

Response example
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 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/master/configurations?filter={"state":"valid"}&offset=0&limit=2 HTTP/1.1

Response

Field Description: configuration entity

Response example
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"
    }
  }
]

Retrieving configuration 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/master/configurations/ebff89d8-016b-d6e3-c598-e0d55e0cd13e HTTP/1.1

Response

Field Description: configuration entity

Response example
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": ""
  }
}

Changing configuration data

Fields prohibited for modification: id

Request

Field Description: configuration entity

Request example
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

Response example
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

Request example
DELETE /rest/v1/master/configurations/ebff89d8-016b-d6e3-c598-e0d55e0cd13e HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content

Searching for a configuration ID

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

Key fields to search for: id

Request

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

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

Response

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

[
  "ebff89d8-016b-d6e3-c598-e0d55e0cd13e"
]
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"
}