Микросервисы (mservices)
Запросы
HTTP verb | Endpoint | Описание |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Создание нового микросервиса
Запрос
Описание полей: mservice entity
POST /rest/v1/domain/mservices HTTP/1.1
Content-Type: application/json; charset=utf-8
mservice entity
Ответ
Описание полей: mservice entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "b12bd5ef-0179-9df2-701b-7cd30a921f58",
"name": "callcenter",
"cmdline": "node index.js callcenter",
"cmdparam": "'{\"domain\":\"%DOMAIN%\",\"http_servers\":%WEBSERVERS%,\"token\":\"b12b22f40b1c71da84320a95ccb3b2b8\",\"logpath\":\"%LOGPATH%\",\"servername\":\"%SERVERNAME%\"}'",
"enabled": true,
"archive": {
"_links": {
"self": {
"href": "/rest/v1/domain/mservices/b12bd5ef-0179-9df2-701b-7cd30a921f58/attachment"
}
}
},
"opts": {
"title": "",
"comment": "",
"mode": "active-passive",
"heartbeat_interval": 5000,
"site_mode": "all",
"selected_sites": [],
"restart_mode": "permanent",
"attachment_info": {
"hasha": "md5;9A29CC52D6BC1EE0D4417AB3C604F3E6",
"mtime": "2021-06-24T09:41:23Z",
"size": 378
}
},
"ext": {
"ct": "2021-05-24T10:36:21.91Z",
"lwt": "2021-06-24T09:41:27.78Z"
}
}
Получение списка микросервисов
Запрос
Имя | Тип | Описание |
---|---|---|
|
|
Фильтр по значениям полей. |
|
|
Список полей для вывода. Доступные поля для выдачи: id, name, cmdline, cmdparam, enabled, opts.title, ext.lwt, ext.ct. |
|
|
Смещение в списке ресурсов, подлежащих выдаче. |
|
|
Максимальное количество ресурсов в списке. |
|
|
Порядок сортировки ресурсов в списке. |
|
|
Преобразование в плоский вид составных полей. |
GET /rest/v1/domain/mservices?offset=0&limit=2 HTTP/1.1
Ответ
Описание полей: mservice entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"id": "b12bd5ef-0179-9df2-701b-7cd30a921f58",
"name": "callcenter",
"cmdline": "node index.js callcenter",
"cmdparam": "'{\"domain\":\"%DOMAIN%\",\"http_servers\":%WEBSERVERS%,\"token\":\"b12b22f40b1c71da84320a95ccb3b2b8\",\"logpath\":\"%LOGPATH%\",\"servername\":\"%SERVERNAME%\"}'",
"enabled": true,
"archive": {
"_links": {
"self": {
"href": "/rest/v1/domain/mservices/b12bd5ef-0179-9df2-701b-7cd30a921f58/attachment"
}
}
},
"opts": {
"title": "",
"comment": "",
"mode": "active-passive",
"heartbeat_interval": 5000,
"site_mode": "all",
"selected_sites": [],
"restart_mode": "permanent",
"attachment_info": {
"hasha": "md5;9A29CC52D6BC1EE0D4417AB3C604F3E6",
"mtime": "2021-06-24T09:41:23Z",
"size": 378
}
},
"ext": {
"ct": "2021-05-24T10:36:21.91Z",
"lwt": "2021-06-24T09:41:27.78Z"
}
},
{
"id": "d670bca8-8f07-4e98-adc3-eba1d1933cd1",
"name": "era_tester",
"cmdline": "node index.js tester",
"cmdparam": "'{\"domain\":\"%DOMAIN%\",\"http_servers\":%WEBSERVERS%,\"token\":\"b12b22f40b1c71da84320a95ccb3b2b8\",\"logpath\":\"%LOGPATH%\",\"servername\":\"%SERVERNAME%\"}'",
"enabled": true,
"archive": {
"_links": {
"self": {
"href": "/rest/v1/domain/mservices/d670bca8-8f07-4e98-adc3-eba1d1933cd1/attachment"
}
}
},
"opts": {
"attachment_info": {
"hasha": "md5;8096AD694C44EE1F205DE865C6D62A5C",
"mtime": "2021-07-08T21:34:50Z",
"size": 2186028
},
"comment": "",
"heartbeat_interval": 5000,
"mode": "active-passive",
"restart_mode": "permanent",
"selected_sites": [],
"site_mode": "all",
"title": ""
},
"ext": {
"ct": "2021-07-08T21:34:36.68Z",
"lwt": "2021-07-08T21:36:20.99Z"
}
}
]
Получение данных микросервиса
Запрос
Имя | Тип | Описание |
---|---|---|
|
|
Список полей для вывода. |
|
|
Преобразование в плоский вид составных полей. |
GET /rest/v1/domain/projects/b12bd5ef-0179-9df2-701b-7cd30a921f58 HTTP/1.1
Ответ
Описание полей: mservice entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "b12bd5ef-0179-9df2-701b-7cd30a921f58",
"name": "callcenter",
"cmdline": "node index.js callcenter",
"cmdparam": "'{\"domain\":\"%DOMAIN%\",\"http_servers\":%WEBSERVERS%,\"token\":\"b12b22f40b1c71da84320a95ccb3b2b8\",\"logpath\":\"%LOGPATH%\",\"servername\":\"%SERVERNAME%\"}'",
"enabled": true,
"archive": {
"_links": {
"self": {
"href": "/rest/v1/domain/mservices/b12bd5ef-0179-9df2-701b-7cd30a921f58/attachment"
}
}
},
"opts": {
"title": "",
"comment": "",
"mode": "active-passive",
"heartbeat_interval": 5000,
"site_mode": "all",
"selected_sites": [],
"restart_mode": "permanent",
"attachment_info": {
"hasha": "md5;9A29CC52D6BC1EE0D4417AB3C604F3E6",
"mtime": "2021-06-24T09:41:23Z",
"size": 378
}
},
"ext": {
"ct": "2021-05-24T10:36:21.91Z",
"lwt": "2021-06-24T09:41:27.78Z"
}
}
Изменение данных микросервиса
Поля запрещенные для изменения: id
Запрос
Описание полей: mservice entity
PATCH /rest/v1/domain/projects/b12bd5ef-0179-9df2-701b-7cd30a921f58 HTTP/1.1
Content-Type: application/json; charset=utf-8
mservice entity
Ответ
Описание полей: mservice entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "b12bd5ef-0179-9df2-701b-7cd30a921f58",
"name": "callcenter",
"cmdline": "node index.js callcenter",
"cmdparam": "'{\"domain\":\"%DOMAIN%\",\"http_servers\":%WEBSERVERS%,\"token\":\"b12b22f40b1c71da84320a95ccb3b2b8\",\"logpath\":\"%LOGPATH%\",\"servername\":\"%SERVERNAME%\"}'",
"enabled": true,
"archive": {
"_links": {
"self": {
"href": "/rest/v1/domain/mservices/b12bd5ef-0179-9df2-701b-7cd30a921f58/attachment"
}
}
},
"opts": {
"title": "",
"comment": "New comment",
"mode": "active-active",
"heartbeat_interval": 5000,
"site_mode": "all",
"selected_sites": [],
"restart_mode": "transient",
"attachment_info": {
"hasha": "md5;9A29CC52D6BC1EE0D4417AB3C604F3E6",
"mtime": "2021-06-24T09:41:23Z",
"size": 378
}
},
"ext": {
"ct": "2021-05-24T10:36:21.91Z",
"lwt": "2021-06-24T09:41:27.78Z"
}
}