Служебные сценарии (svcscripts)
Запросы
HTTP verb | Endpoint | Описание |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Создание нового служебного сценария
Запрос
Описание полей: svcscript entity
POST /rest/v1/service/svcscripts HTTP/1.1
Content-Type: application/json; charset=utf-8
svcscript entity
Ответ
Описание полей: 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": "Старт",
"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": "Доступ к сервису S3",
"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": "Уведомление",
"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": "Стоп",
"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"
}
}
Получение списка служебных сценариев
Запрос
Имя | Тип | Описание |
---|---|---|
|
|
Фильтр по значениям полей. |
|
|
Список полей для вывода. Доступные поля для выдачи: id, code, name, projectid, ext.lwt, ext.ct. |
|
|
Смещение в списке ресурсов, подлежащих выдаче. |
|
|
Максимальное количество ресурсов в списке. |
|
|
Порядок сортировки ресурсов в списке. |
|
|
Преобразование в плоский вид составных полей. |
GET /rest/v1/service/svcscripts?offset=0&limit=2 HTTP/1.1
Ответ
Описание полей: 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"
}
}
]
Получение данных служебного сценария
Запрос
Имя | Тип | Описание |
---|---|---|
|
|
Список полей для вывода. |
|
|
Преобразование в плоский вид составных полей. |
GET /rest/v1/service/svcscripts/7af4d427-016c-b8b9-529a-50e54938780c HTTP/1.1
Ответ
Описание полей: 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": "Старт",
"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": "Доступ к сервису S3",
"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": "Уведомление",
"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": "Стоп",
"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"
}
}
Изменение данных служебного сценария
Поля запрещенные для изменения: id
Запрос
Описание полей: svcscript entity
PATCH /rest/v1/service/svcscripts/7af4d427-016c-b8b9-529a-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8
svcscript entity
Ответ
Описание полей: 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": "Старт",
"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": "Доступ к сервису S3",
"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": "Уведомление",
"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": "Стоп",
"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"
}
}