Service scenarios (svcscripts)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/service/svcscripts

Creating a new service scenario

GET

/rest/v1/service/svcscripts

Getting the list of service scenarios

GET

/rest/v1/service/svcscripts/<id>

Receiving service scenario data

PATCH

/rest/v1/service/svcscripts/<id>

Changing service scenario data

DELETE

/rest/v1/service/svcscripts/<id>

Deleting a service script

LOOKUP

/rest/v1/service/svcscripts

Searching for the service scenario identifier


Creating a new service scenario

Request

Field Description: svcscript entity

Request example
POST /rest/v1/service/svcscripts HTTP/1.1
Content-Type: application/json; charset=utf-8

svcscript entity

Response

Field Description: svcscript entity

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

Table 1. Request parameters
Name Type Description

filter

object

Filter by field values.

mask

str

List of fields to output. Available fields for output: id, code, name, projectid, ext.lwt, ext.ct.

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

Response

Field Description: svcscript entity

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

Table 2. Request parameters
Name Type Description

mask

str

A list of fields to output.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/service/svcscripts/7af4d427-016c-b8b9-529a-50e54938780c HTTP/1.1

Response

Field Description: svcscript entity

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

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

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

Request

Request example
DELETE /rest/v1/service/svcscripts/7af4d427-016c-b8b9-529a-50e54938780c HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content

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

Request example
LOOKUP /rest/v1/service/svcscripts HTTP/1.1
Content-Type: application/json; charset=utf-8

"test_s3"

Response

Example of a successful response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8

[
  "7af4d427-016c-b8b9-529a-50e54938780c"
]
Example of an unsuccessful response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error_code": 1404,
  "error_message": "Lookup failed"
}