Service scenarios (svcscripts)
Requests
HTTP verb | Endpoint | Description |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creating a new service scenario
Request
Field Description: svcscript entity
POST /rest/v1/service/svcscripts HTTP/1.1
Content-Type: application/json; charset=utf-8
svcscript entity
Response
Field Description: svcscript entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "7af4d427-016c-b8b9-529a-50e54938780c",
"code": "test_s3",
"name": "CheckStorageX",
"scriptdata": {
"objects": [
{
"oId": 1,
"oLeft": 32,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2017-01-30 10:22:51",
"oLayer": 0,
"oType": 101,
"type": 0,
"defineVars": 1,
"implementedTime": 60000,
"transfer": 2,
"name": "Start",
"info": ""
},
{
"oId": 2,
"oLeft": 139,
"oTop": 18,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-22 12:47:55",
"oLayer": 0,
"oType": 116,
"command": 3,
"type": 1,
"transfer": 3,
"name": "Access to S3 service",
"info": ""
},
{
"oId": 3,
"oLeft": 258,
"oTop": 17,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-22 12:48:11",
"oLayer": 0,
"oType": 111,
"mode": 2,
"text": {
"argType": 1,
"varType": 2,
"value": "S3 Access"
},
"type": 0,
"notifyType": 0,
"writeLog": 0,
"transfer": 4,
"sipMsg": 0,
"sipReport": 0,
"sipTimeoutSec": 37,
"name": "Notification",
"info": ""
},
{
"oId": 4,
"oLeft": 368,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-22 13:48:20",
"oLayer": 0,
"oType": 102,
"callStack": 0,
"name": "Stop",
"info": ""
}
],
"variables": [
{
"id": "6745e9fc-cd6c-40ab-92f2-bcf78a220b0c",
"name": "var1",
"type": 1,
"location": 0
}
],
"scriptVersion": 170105
},
"projectid": "00000000-0000-0000-0000-000000000000",
"lwt": "2019-08-22T10:50:21Z",
"opts": {
"comment": "",
"loglevel": 0,
"title": "",
"variables": {
"var1": 0
}
},
"ext": {
"ct": "2019-08-22T10:50:21.98Z",
"lwt": "2019-08-22T10:50:21.98Z"
}
}
Getting the list of service scenarios
Request
Name | Type | Description |
---|---|---|
|
|
Filter by field values. |
|
|
List of fields to output. Available fields for output: id, code, name, projectid, 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/service/svcscripts?offset=0&limit=2 HTTP/1.1
Response
Field Description: svcscript entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"id": "7af4d427-016c-b8b9-529a-50e54938780c",
"code": "test_s3",
"name": "CheckStorageX",
"projectid": "00000000-0000-0000-0000-000000000000",
"ext": {
"ct": "2019-08-22T10:50:21.98Z",
"lwt": "2019-08-22T10:50:21.98Z"
}
},
{
"id": "05f8c137-016c-b8f1-e0d7-50e54938780c",
"code": "cleanup",
"name": "Cleanup",
"projectid": "00000000-0000-0000-0000-000000000000",
"ext": {
"ct": "2019-08-15T02:55:26.08Z",
"lwt": "2019-08-15T02:55:26.08Z"
}
}
]
Receiving service scenario data
Request
Name | Type | Description |
---|---|---|
|
|
A list of fields to output. |
|
|
Conversion to flat form of composite fields. |
GET /rest/v1/service/svcscripts/7af4d427-016c-b8b9-529a-50e54938780c HTTP/1.1
Response
Field Description: svcscript entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "7af4d427-016c-b8b9-529a-50e54938780c",
"code": "test_s3",
"name": "CheckStorageX",
"scriptdata": {
"objects": [
{
"oId": 1,
"oLeft": 32,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2017-01-30 10:22:51",
"oLayer": 0,
"oType": 101,
"type": 0,
"defineVars": 1,
"implementedTime": 60000,
"transfer": 2,
"name": "Start",
"info": ""
},
{
"oId": 2,
"oLeft": 139,
"oTop": 18,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-22 12:47:55",
"oLayer": 0,
"oType": 116,
"command": 3,
"type": 1,
"transfer": 3,
"name": "Access to S3 service",
"info": ""
},
{
"oId": 3,
"oLeft": 258,
"oTop": 17,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-22 12:48:11",
"oLayer": 0,
"oType": 111,
"mode": 2,
"text": {
"argType": 1,
"varType": 2,
"value": "S3 Access"
},
"type": 0,
"notifyType": 0,
"writeLog": 0,
"transfer": 4,
"sipMsg": 0,
"sipReport": 0,
"sipTimeoutSec": 37,
"name": "Notification",
"info": ""
},
{
"oId": 4,
"oLeft": 368,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-22 13:48:20",
"oLayer": 0,
"oType": 102,
"callStack": 0,
"name": "Stop",
"info": ""
}
],
"variables": [
{
"id": "6745e9fc-cd6c-40ab-92f2-bcf78a220b0c",
"name": "var1",
"type": 1,
"location": 0
}
],
"scriptVersion": 170105
},
"projectid": "00000000-0000-0000-0000-000000000000",
"lwt": "2019-08-22T10:50:21Z",
"opts": {
"comment": "",
"loglevel": 0,
"title": "",
"variables": {
"var1": 0
}
},
"ext": {
"ct": "2019-08-22T10:50:21.98Z",
"lwt": "2019-08-22T10:50:21.98Z"
}
}
Changing service scenario data
Fields prohibited for modification: id
Request
Field Description: svcscript entity
PATCH /rest/v1/service/svcscripts/7af4d427-016c-b8b9-529a-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8
svcscript entity
Response
Field Description: svcscript entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"id": "7af4d427-016c-b8b9-529a-50e54938780c",
"code": "test_s3",
"name": "CheckStorageX",
"scriptdata": {
"objects": [
{
"oId": 1,
"oLeft": 32,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2017-01-30 10:22:51",
"oLayer": 0,
"oType": 101,
"type": 0,
"defineVars": 1,
"implementedTime": 60000,
"transfer": 2,
"name": "Start",
"info": ""
},
{
"oId": 2,
"oLeft": 139,
"oTop": 18,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-22 12:47:55",
"oLayer": 0,
"oType": 116,
"command": 3,
"type": 1,
"transfer": 3,
"name": "Access to S3 service",
"info": ""
},
{
"oId": 3,
"oLeft": 258,
"oTop": 17,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-22 12:48:11",
"oLayer": 0,
"oType": 111,
"mode": 2,
"text": {
"argType": 1,
"varType": 2,
"value": "S3 Access"
},
"type": 0,
"notifyType": 0,
"writeLog": 0,
"transfer": 4,
"sipMsg": 0,
"sipReport": 0,
"sipTimeoutSec": 37,
"name": "Notification",
"info": ""
},
{
"oId": 4,
"oLeft": 368,
"oTop": 16,
"oWidth": 32,
"oHeight": 32,
"oCreationDate": "2019-08-22 13:48:20",
"oLayer": 0,
"oType": 102,
"callStack": 0,
"name": "Stop",
"info": ""
}
],
"variables": [
{
"id": "6745e9fc-cd6c-40ab-92f2-bcf78a220b0c",
"name": "var1",
"type": 1,
"location": 0
},
{
"id": "8c35152b-62b4-4986-b139-f76f0f0de878",
"name": "asdf",
"type": 2,
"location": 0
},
{
"id": "478731bc-7de1-435b-a51b-2dc2dc050697",
"name": "path",
"type": 2,
"location": 0
},
{
"id": "ce834e56-be72-4069-9eec-fc7df61c4a75",
"name": "result",
"type": 2,
"location": 0
}
],
"scriptVersion": 170105
},
"projectid": "00000000-0000-0000-0000-000000000000",
"lwt": "2019-09-09T13:17:24Z",
"opts": {
"comment": "",
"loglevel": 0,
"title": "",
"variables": {
"var1": 123,
"asdf": "Default value from opts"
}
},
"ext": {
"ct": "2019-08-22T10:50:21.98Z",
"lwt": "2019-09-09T13:17:24.36Z"
}
}
Deleting a service script
Searching for the service scenario 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/service/svcscripts HTTP/1.1
Content-Type: application/json; charset=utf-8
"test_s3"
Response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
[
"7af4d427-016c-b8b9-529a-50e54938780c"
]
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
{
"error_code": 1404,
"error_message": "Lookup failed"
}