Data storage connections (storages)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/domain/storages

Creating a new storage connection

GET

/rest/v1/domain/storages

Getting the list of storage connections

GET

/rest/v1/domain/storages/<id>

Getting storage connection data

PATCH

/rest/v1/domain/storages/<id>

Modifying storage connection data

DELETE

/rest/v1/domain/storages/<id>

Deleting a storage connection

LOOKUP

/rest/v1/domain/storages

Searching for a storage connection identifier


Creating a new storage connection

Request

Field description: storage entity

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

storage entity

Response

Field description: storage entity

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

{
  "id": "77544c9c-0178-d0cf-2659-7cd30a921f58",
  "instance": "a",
  "type": "postgresql",
  "params": {
    "host": "192.168.0.123",
    "port": 5432,
    "login": "user01",
    "pwd": "PwdOfUser01",
    "database": "postgres"
  },
  "opts": {
    "comment": "",
    "title": ""
  },
  "ext": {
    "ct": "2021-04-14T14:35:39.99Z",
    "lwt": "2021-04-14T14:35:39.99Z"
  }
}

Getting the list of storage connections

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, type, instance, params, opts.title, opts.comment, ext.lwt, ext.ct.

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/domain/storages?offset=0&limit=10 HTTP/1.1

Response

Field description: storage entity

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

[
  {
    "id": "77544c9c-0178-d0cf-2659-7cd30a921f58",
    "instance": "a",
    "type": "postgresql",
    "params": {
      "host": "192.168.0.123",
      "port": 5432,
      "login": "user01",
      "pwd": "PwdOfUser01",
      "database": "postgres"
    },
    "opts": {
      "comment": "",
      "title": ""
    },
    "ext": {
      "ct": "2021-04-14T14:35:39.99Z",
      "lwt": "2021-04-14T14:35:39.99Z"
    }
  },
  {
    "id": "2ee0c204-017b-bf38-52ac-7cd30a921f58",
    "instance": "a",
    "type": "postgresql",
    "params": {
      "host": "192.168.0.124",
      "port": 5432,
      "login": "user01",
      "pwd": "PwdOfUser01",
      "database": "postgres"
    },
    "opts": {
      "comment": "",
      "title": ""
    },
    "ext": {
      "ct": "2021-04-14T14:36:15.91Z",
      "lwt": "2021-04-14T14:36:15.91Z"
    }
  },
  {
    "id": "6dfb0635-0178-ee77-e9e2-7cd30a921f58",
    "instance": "b",
    "type": "clickhouse",
    "params": {
      "cluster": "cluster",
      "host": "192.168.0.122",
      "port": 8123,
      "login": "default",
      "password": ""
    },
    "opts": {
      "comment": "",
      "title": ""
    },
    "ext": {
      "ct": "2021-04-20T08:48:59.36Z",
      "lwt": "2021-04-22T07:43:21.51Z"
    }
  },
  {
    "id": "b26cd0e6-0178-d0f9-5747-7cd30a921f58",
    "instance": "b",
    "type": "kafka",
    "params": {
      "endpoints": [
        {
          "host": "192.168.0.121",
          "port": 9092
        },
        {
          "host": "192.168.0.122",
          "port": 9092
        },
        {
          "host": "192.168.0.123",
          "port": 9092
        },
        {
          "host": "192.168.0.124",
          "port": 9092
        }
      ]
    },
    "opts": {
      "comment": "",
      "title": ""
    },
    "ext": {
      "ct": "2021-04-14T15:21:45.31Z",
      "lwt": "2021-04-19T09:04:13.66Z"
    }
  },
  {
    "id": "4d0fb97c-0178-ee78-009b-7cd30a921f58",
    "instance": "b",
    "type": "clickhouse",
    "params": {
      "cluster": "cluster",
      "host": "192.168.0.121",
      "port": 8123,
      "login": "default",
      "password": ""
    },
    "ext": {
      "ct": "2021-04-20T08:49:05.17Z",
      "lwt": "2021-04-22T07:42:48.77Z"
    },
    "opts": {
      "comment": "",
      "title": ""
    }
  },
  {
    "id": "23afc5c0-0178-dba2-e6dd-7cd30a921f58",
    "instance": "c",
    "type": "kafka",
    "params": {
      "endpoints": [
        {
          "host": "192.168.0.121",
          "port": 9092
        },
        {
          "host": "192.168.0.121",
          "port": 9093
        },
        {
          "host": "192.168.0.122",
          "port": 9092
        }
      ]
    },
    "ext": {
      "ct": "2021-04-16T17:03:09.53Z",
      "lwt": "2021-04-16T17:03:09.53Z"
    },
    "opts": {
      "comment": "",
      "title": ""
    }
  },
  {
    "id": "1a2325b6-017b-abab-bba4-7cd30a921f58",
    "instance": "fstest",
    "type": "fs",
    "params": {
      "prefix": "fstest_attaches"
    },
    "opts": {
      "comment": "",
      "title": ""
    },
    "ext": {
      "ct": "2021-09-03T12:39:23.81Z",
      "lwt": "2021-09-03T12:43:01.44Z"
    }
  },
  {
    "id": "9495206e-017b-bf36-e4e3-7cd30a921f58",
    "instance": "s3test",
    "type": "s3",
    "params": {
      "bucket": "my_bucket",
      "keyId": "Abc-QwERtYUi-ASDfGh",
      "secretKey": "S5FCFt1BDPqPJu5etEECSa8FXP8y4cwG1R5btFjb"
    },
    "opts": {
      "comment": "",
      "title": ""
    },
    "ext": {
      "ct": "2021-09-05T12:48:51.57Z",
      "lwt": "2021-09-05T12:48:51.57Z"
    }
  }
]

Getting storage connection 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/domain/storages/77544c9c-0178-d0cf-2659-7cd30a921f58 HTTP/1.1

Response

Field description: storage entity

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

{
  "id": "77544c9c-0178-d0cf-2659-7cd30a921f58",
  "instance": "a",
  "type": "postgresql",
  "params": {
    "host": "192.168.0.123",
    "port": 5432,
    "login": "user01",
    "pwd": "PwdOfUser01",
    "database": "postgres"
  },
  "opts": {
    "comment": "",
    "title": ""
  },
  "ext": {
    "ct": "2021-04-14T14:35:39.99Z",
    "lwt": "2021-04-14T14:35:39.99Z"
  }
}

Modifying storage connection data

Fields prohibited for modification: id

Request

Field description: storage entity

Example request
PATCH /rest/v1/domain/storages/77544c9c-0178-d0cf-2659-7cd30a921f58 HTTP/1.1
Content-Type: application/json; charset=utf-8

storage entity

Response

Field description: storage entity

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

{
  "id": "77544c9c-0178-d0cf-2659-7cd30a921f58",
  "instance": "a",
  "type": "postgresql",
  "params": {
    "host": "192.168.0.123",
    "port": 5432,
    "login": "user01",
    "pwd": "PwdOfUser01",
    "database": "postgres"
  },
  "opts": {
    "comment": "",
    "title": ""
  },
  "ext": {
    "ct": "2021-04-14T15:22:49.35Z",
    "lwt": "2021-04-14T15:22:49.35Z"
  }
}

Deleting a storage connection

Request

Example request
DELETE /rest/v1/domain/storages/77544c9c-0178-d0cf-2659-7cd30a921f58 HTTP/1.1

Response

Example response
HTTP/1.1 204 No Content

Searching for a storage connection identifier

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

Key fields for search: id, instance

Request

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

"a"

Response

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

[
  "2ee0c204-017b-bf38-52ac-7cd30a921f58"
]
Example failed response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

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