Active nanoservices of the product layer (nservices)

Overview

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

5 seconds are allocated for processing the request, unless the target nanoservice extends the waiting interval. Request lifetime control is provided by the nanoservice 'platform.WatchdogService'.

5 seconds are allocated for processing the request, unless the target nanoservice extends the waiting interval. Request lifetime control is provided by the nanoservice 'platform.WatchdogService'.

When executing a request, it is mandatory to specify the name of the nanoservice (from the list of active ones) in the URL, as well as to pass the 'method' parameter in the body of the request, and optionally 'request' to pass parameters in any format: string, number, object, array, etc.
An object with the following fields is returned as a response:
'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 names of active nanoservices

POST

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

Executing a request to a nanoservice


Getting the list of names of active nanoservices

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

Response

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

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

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

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