Managing the execution of service scenarios (svcscript_runtimes)
Overview
Manages the active handlers of service scenarios.
A service script handler is an algorithm that interprets an instance of a service script.
Requests
HTTP verb | Endpoint | Description |
---|---|---|
|
|
|
|
|
|
|
|
Starting a new instance of the service scenario
Starts a new service script handler on one of the nodes with role svc, into which a service script with the specified code from the current domain is loaded.
A node on the same site where the API request is served is preferentially selected. Exception, if the current domain is not served on this site or there is no role.
Request
Field | Description |
---|---|
|
Scenario code |
|
Parameter 1, available in the script via the |
|
Parameter 2, available in the script through the expressions function |
|
Parameter 3, available in the script through the expressions function |
|
Parameter 4, available in the script through the expressions function |
|
Parameter 5, available in the script through the expressions function |
|
Parameter 6, available in the script through the expressions function |
|
Parameter 7, available in the script via the expression function |
|
Parameter 8, available in the script via the expression function |
|
Parameter 9, available in the script through the expressions function |
POST /rest/v1/service/svcscript_runtimes HTTP/1.1
Content-Type: application/json; charset=utf-8
{
"code": "123"
}
Response
Returns information about the running service script handler.
Field | Description |
---|---|
|
Scenario handler identifier |
|
The site on which the handler is running. |
|
Noda, within which the handler ran. |
|
Script Domain. |
|
Type of script running. |
|
The code of the running script. |
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "b7f4ad2f-0624-e7dd-42f5-d000000003e8",
"site": "SITE1",
"node": "site1_c@192.168.0.12",
"domain": "test.rootdomain.ru",
"type": "svc",
"code": "code"
}
Getting the list of running instances of service scripts
Returns a list of all service script handlers executed by the system in the current domain at all available sites where it is served.
Request
Name | Type | Description |
---|---|---|
|
|
Filter by field values. |
|
|
A list of fields to output. |
|
|
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/service/svcscript_runtimes HTTP/1.1
Response
Returns all detected active running service script handlers.
Field | Description |
---|---|
|
Scenario handler identifier |
|
The site where the handler is executed. |
|
Node within which the handler is executed. |
|
Script Domain. |
|
Scenario Type. |
|
The code of the running script. If the source script has transferred control to a nested script, the code of the nested script is returned. |
|
The name of the running scenario. If the source script has transferred control to a nested script, the name of the nested script is returned. |
|
Date and time of the handler start in RFC3339 format in UTC. |
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"id": "fbd617e7-0624-e648-92da-7800000003e8",
"site": "SITE1",
"node": "site1_c@192.168.0.12",
"domain": "test.rootdomain.ru",
"type": "svc",
"code": "test pause",
"name": "TEST PAUSE",
"starttime": "2019-11-05T08:40:41Z"
},
{
"id": "424123d3-0624-e647-e54b-7800000003e8",
"site": "SITE1",
"node": "site1_c@192.168.0.12",
"domain": "test.rootdomain.ru",
"type": "svc",
"code": "send_mail",
"name": "SEND MAIL",
"starttime": "2019-11-05T08:40:30Z"
}
]
Stopping an instance of the service scenario
Forcibly terminates the script handler.
If a post-processing branch corresponding to the External Stop' termination type is specified in the currently executing script, control is passed to it and the handler continues to execute.
In this case, another API request will be needed to stop the handler completely `DELETE
.
See also
-
Script type: service type
-
Entity service script
-
API entity management service scripts