Connections to data warehouses (storages)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/domain/storages

Creating a new connection to the storage

GET

/rest/v1/domain/storages

Getting the list of connections to storages

GET

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

Obtaining connection data to the storage

PATCH

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

Changing storage connection data

DELETE

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

Deleting a storage connection

LOOKUP

/rest/v1/domain/storages

Searching for storage connection ID


Creating a new connection to the storage

Request

Field Description: storage entity

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

storage entity

Response

Field Description: storage entity

Response example
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 connections to storages

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

Response

Field Description: storage entity

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

Obtaining connection data to the storage

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

Response

Field Description: storage entity

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

Changing storage connection data

Fields prohibited for modification: id

Request

Field Description: storage entity

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

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

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

Response

Response example
HTTP/1.1 204 No Content

Searching for storage connection ID

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

Key fields to search for: id, instance

Request

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

"a"

Response

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

[
  "2ee0c204-017b-bf38-52ac-7cd30a921f58"
]
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"
}