Microservices (mservices)
Requests
HTTP verb | Endpoint | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creating a new microservice
Request
Field Description: mservice entity
POST /rest/v1/domain/mservices HTTP/1.1
Content-Type: application/json; charset=utf-8
mservice entity
Response
Field Description: 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"
}
}
Getting the list of microservices
Request
Name | Type | Description |
---|---|---|
|
|
Filter by field values. |
|
|
List of fields to output. Available fields for output: id, name, cmdline, cmdparam, enabled, opts.title, ext.lwt, ext.ct. |
|
|
Offset in the list of resources to be issued. |
|
|
The maximum number of resources in the list. |
|
|
The sort order of the resources in the list. |
|
|
Conversion to flat form of composite fields. |
GET /rest/v1/domain/mservices?offset=0&limit=2 HTTP/1.1
Response
Field Description: 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"
}
}
]
Retrieving microservice data
Request
Name | Type | Description |
---|---|---|
|
|
A list of fields to output. |
|
|
Conversion to flat form of composite fields. |
GET /rest/v1/domain/projects/b12bd5ef-0179-9df2-701b-7cd30a921f58 HTTP/1.1
Response
Field Description: 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"
}
}
Changing microservice data
Fields prohibited for modification: id
Request
Field Description: mservice entity
PATCH /rest/v1/domain/projects/b12bd5ef-0179-9df2-701b-7cd30a921f58 HTTP/1.1
Content-Type: application/json; charset=utf-8
mservice entity
Response
Field Description: 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"
}
}
Removing a microservice
Searching for microservice identifier
Searches the resource for the specified key, returns the identifier(s) to build the endpoint.
Key fields to search for: id, code
Request
LOOKUP /rest/v1/domain/mservices HTTP/1.1
Content-Type: application/json; charset=utf-8
"callcenter"
Response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
[
"b12bd5ef-0179-9df2-701b-7cd30a921f58"
]
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
{
"error_code": 1404,
"error_message": "Lookup failed"
}