Service scripts (svcscripts)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/service/svcscripts

Creating a new service script

GET

/rest/v1/service/svcscripts

Getting the list of service scripts

GET

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

Getting service script data

PATCH

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

Modifying service script data

DELETE

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

Deleting a service script

LOOKUP

/rest/v1/service/svcscripts

Searching for a service script identifier


Creating a new service script

Request

Field description: svcscript entity

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

svcscript entity

Response

Field description: svcscript entity

Example response
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 scripts

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

Response

Field description: svcscript entity

Example response
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"
    }
  }
]

Getting service script data

Request

Table 2. Request parameters
Name Type Description

mask

str

List of fields to output.

flat

bool

Transformation of composite fields to flat form.

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

Response

Field description: svcscript entity

Example response
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"
  }
}

Modifying service script data

Fields prohibited for modification: id

Request

Field description: svcscript entity

Example request
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

Example response
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

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

Response

Example response
HTTP/1.1 204 No Content

Searching for a service script identifier

Searches for a resource by the specified key and returns the identifier(s) for building the endpoint.

Key fields for search: id, code

Request

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

"test_s3"

Response

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

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

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