...
POST http://IP address:port/prefix/grpc
Request body:
Code Block |
---|
{ "method":"axxonsoft.bl.logic.LogicService.ListMacros", "data": { "view": "VIEW_MODE_FULL" } } |
...
Info | ||
---|---|---|
| ||
VIEW_MODE_FULL—complete information; VIEW_MODE_STRIPPED—only basic information about macros without the launch and operation conditions. |
...
Code Block |
---|
{ "method": "axxonsoft.bl.logic.LogicService.ChangeMacros", "data": { "modified_macros": { "guid": "3303abb2-181e-4183-8987-8a06c309a741", "mode": { "common": {} }, "conditions": { "0": {} }, "rules": { "1": {} } } } } |
Adding a prevention when you replicate video fragments:
Code Block | ||
---|---|---|
| ||
{
"method": "axxonsoft.bl.logic.LogicService.ChangeMacros",
"data": {
"added_macros": {
"guid": "818444df-57c0-41cd-96c0-3b2b8adc7fbb",
"name": "Macro1",
"mode": {
"enabled": true,
"user_role": "",
"is_add_to_menu": false,
"common": {}
},
"conditions": {
"0": {
"path": "",
"device": {
"device": "hosts/SERVER1/DeviceIpint.1/SourceEndpoint.video:0:0",
"state": "IPDS_SIGNAL_RESTORED",
"threshold": 0
}
}
},
"rules": {
"0": {
"path": "",
"action": {
"timeout_ms": 0,
"cancel_conditions": {},
"action": {
"replication": {
"mode": "RM_OFFLINE_FRAGMENT",
"timezone_id": "00000000-0000-0000-0000-000000000000",
"span_ms": 0,
"offset_ms": 0,
"camera": "hosts/SERVER1/DeviceIpint.1/SourceEndpoint.video:0:0",
"archive": "hosts/SERVER1/MultimediaStorage.AliceBlue/MultimediaStorage",
"prevention_ms": 20000
}
}
}
}
}
}
}
} |
where prevention_ms is the time interval in milliseconds by which the beginning of the replicated fragment is shifted backward relative to the moment of event detection (for example, camera signal recovery). The default value is 20000 milliseconds, or 20 seconds.
Removing:
Code Block |
---|
{ "method":"axxonsoft.bl.logic.LogicService.ChangeMacros", "data":{ "removed_macros" : ["3303abb2-181e-4183-8987-8a06c309a741"] } } |
...
Get information on automatic rule
Response:Expand Code Block { "items": [ { "guid": "4932bbc7-c702-4a18-b050-2898b1b61738", "name": "534k_1.Camera. Motion detection", "mode": { "enabled": true, "user_role": "", "is_add_to_menu": false, "autorule": { "zone_ap": "hosts/Server1/DeviceIpint.6/SourceEndpoint.video:0:0", "only_if_armed": false, "timezone_id": "00000000-0000-0000-0000-000000000000" } }, "conditions": { "0": { "path": "/C:0", "detector": { "event_type": "MotionDetected", "source_ap": "hosts/Server1/AVDetector.4/EventSupplier", "state": "BEGAN", "details": [] } } }, "rules": { "1": { "path": "/E:1", "action": { "timeout_ms": 0, "cancel_conditions": { "0": { "path": "/E:1/C:0", "detector": { "event_type": "MotionDetected", "source_ap": "hosts/Server1/AVDetector.4/EventSupplier", "state": "ENDED", "details": [] } } }, "action": { "raise_alert": { "zone": "hosts/Server1/DeviceIpint.1/SourceEndpoint.video:0:0", "archive": "hosts/Server1/MultimediaStorage.AliceBlue/MultimediaStorage", "offset_ms": 0, "mode": "RAM_AlwaysIfNoActiveAlert" } } } }, "0": { "path": "/E:0", "action": { "timeout_ms": 0, "cancel_conditions": { "0": { "path": "/E:0/C:0", "detector": { "event_type": "MotionDetected", "source_ap": "hosts/Server1/AVDetector.6/EventSupplier", "state": "BEGAN", "details": [] } } }, "action": { "write_archive": { "camera": "hosts/Server1/DeviceIpint.1/SourceEndpoint.video:0:0", "archive": "hosts/Server1/MultimediaStorage.AliceBlue/MultimediaStorage", "min_prerecord_ms": 0, "post_event_timeout_ms": 0 } } } } } } ] }
Create a macro.
Expand Code Block { "method":"axxonsoft.bl.logic.LogicService.ChangeMacros", "data":{ "added_macros" : { "guid": "b55c118a-f902-43ec-b55a-67ee062640b2", "name": "MacroEmail", "mode": { "enabled": true, "user_role": "", "is_add_to_menu": false, "continuous": { "server": "Server1", "timezone_id": "00000000-0000-0000-0000-000000000000", "heartbeat_ms": 0, "random": true } }, "conditions": {}, "rules": { "0": { "path": "/E:0", "check": { "check": { "camera": "99f72952-d8b8-4590-90e8-7e0e78bcd719", "archive": "", "depth_ms": 5400000, "type": "CT_CHECK_RECORD" }, "success_rules": {}, "failure_rules": { "0": { "path": "/E:0/T:0", "action": { "timeout_ms": 0, "cancel_conditions": {}, "action": { "email_notification": { "notifier": "hosts/Server1/EMailModule.1", "recipients": [ "mail@server.com" ], "subject": "Notification: Attention, automatic rule is triggered.", "msg_text": "On server: {cameraNode} by camera {cameraName} problems with archiving.\nDate: {dateTime}", "atach_video": false, "export_agent": "", "span_ms": 0, "camera": "", "archive": "" } } } } } } } } } } }
Info title Note "camera": "99f72952-d8b8-4590-90e8-7e0e78bcd719" is the camera group id.