Active product layer nanoservices (nservices)

Overview

Executes requests to product layer nanoservices. Nanoservices are part of product layer microservices added to the mservices collection and have unique names.

5 seconds are allotted for request processing unless the target nanoservice increases the wait interval. The 'platform.WatchdogService' nanoservice controls request lifetime.

5 seconds are allotted for request processing unless the target nanoservice increases the wait interval. The 'platform.WatchdogService' nanoservice controls request lifetime.

When executing a request, specifying the nanoservice name (from the active list) in the URL is mandatory, as well as passing the 'method' parameter in the request body, and optionally 'request' to pass parameters in an arbitrary format: string, number, object, array, etc.
The response returns an object with fields:
'result' :: "ok" | "error"
'code' :: "success" | "error" | "timeout" | "failed" | "notfound"
'response' :: arbitrary format

Requests

HTTP verb Endpoint Description

GET

/rest/v1/domain/nservices

Getting the list of active nanoservice names

POST

/rest/v1/domain/nservices/<name>

Executing a request to a nanoservice


Getting the list of active nanoservice names

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: name.

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

Response

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

[
  {"name":"builder.DataService"},
  {"name":"builder.GeneratorService"}
]

Executing a request to a nanoservice

Request

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

{
  "method": "test",
  "request": {"a":10,"b":[{"c":"20","d":"30"}]}
}

Response

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

{
  "result": "ok",
  "code": "success",
  "response": {"a":1,"b":2,"ccc":3}
}