Here are some examples of how to generate VIRGO status message replies for various use cases.
Assuming that the objective is to unconditionally replace all feeds currently managed by VIRGO:
Feeds known to VIRGO before the update:
"camera_1"
"camera_2"
"camera_foo"
"camera_bar"
Update:
{
"mod-date": 767868,
"feeds": {
"camera_1": { ... },
"camera_2": { ... },
"camera_3": { ... }
}
}
Feeds known to VIRGO after the update:
"camera_1"
"camera_2"
"camera_3"
->
"camera_foo" and "camera_bar" have been deleted
"camera_3" has been added
"camera_1" and "camera_2" states have been updated to the new state
Note: Replacing all feeds is an exceedingly disruptive operation and you should only execute this operation if the goal is truly to replace all existing feeds. If the goal is to add, remove, or update individual feeds then you should use one of the techniques outlined below.
Assuming that the objective is to add a new feed without changing any other feeds:
Feeds known before the update:
"camera_1"
"camera_2"
Update:
{
"mod-date": 767898,
"apply-as": "delta",
"feed.additions": {
"camera_3": { ... }
}
}
Feeds known after the update:
"camera_1"
"camera_2"
"camera_3"
Assuming that the objective is to remove an existing feed without changing any other feeds:
Feeds known before the update:
"camera_1"
"camera_2"
"camera_3"
Update:
{
"mod-date": 7867867,
"apply-as": "delta",
"feed.removals": [ "camera_1" ]
}
Feeds known after the update:
"camera_2"
"camera_3"
Assuming that the objective is to update the state of an existing feed without changing any other feeds:
Feeds known before the update:
"camera_1"
"camera_2"
Update:
{
"mod-date": 7867867,
"apply-as": "delta",
"feed.updates": {
"camera_2": { ... }
}
}
Assuming that the objective is to update VIRGO to the new version 2.0.3 without changing any of the other states:
{
"mod-date": 7867887,
"apply-as": "delta",
"update": {
"version": "2.0.3",
"download-url": "https://virga.int2.real.com/virgo-updates/2.0.3.tar.gz",
"progress-url": "https://virga.int2.real.com/virgo-updates/progress/2.0.3",
"progress-interval": 500
}
}
Assuming that the objective is to do a full reset of VIRGO back to the factory settings without applying any new state at the same time:
{
"relative-to": "initial"
}
Note that it is not necessary to send a mod-date in this case because the reply contains no new state and VIRGO will reset back to modification date 0 and the factory settings.
Assuming that the goal is to completely replace the existing (and unknown) configuration of a VIRGO instance:
Before:
Some unknown configuration.
Update:
{
"relative-to": "initial",
"mod-date": 65768678,
"feeds": {
"camera_1": { ... },
"camera_2": { ... }
}
}
After:
- "camera_1 and "camera_2" feeds. All other feeds have been removed because of the reset.
Assuming that the goal is to turn image capture on for a feed without changing any of the other feed state:
Before:
Image capture is turned off for the feed "camera_1".
Update:
{
"mod-date": 76789,
"apply-as": "delta",
"feed.updates": {
"camera_1": {
"capture.lease-date": 6587687,
"capture.maximum-frames": 1,
"capture.deposite-base-url": "https://virga.int2.real.com/virgo-captures/",
}
}
}
After:
VIRGO delivers 1 image to this URL:
https://virga.int2.real.com/virgo-captures/camera_1_2017-10-17_266.jpg
Note that image capture will automatically turn off after the image has been delivered because "capture.max-frames" is 1.
Assuming that the goal is to disable image capture for a feed for which it is currently turned on:
Before:
Image capture is turned on for the feed "camera_1".
Update:
{
"mod-date": 76978789,
"apply-as": "delta",
"feed.updates": {
"camera_1": {
"capture.lease-date": 687678,
"capture.maximum-frames": 0
}
}
}
After:
VIRGO no longer captures images for "camera_1".
Assuming the goal is to renew the lease of an existing capture stream:
Before:
Image capture for the feed "camera_1" is turned on and active but about to hit its current maximum-frames limit.
Update:
{
"mod-date":7697678,
"apply-as": "delta",
"feed.updates": {
"camera_1": {
"capture.lease-date": 78678,
"capture.maximum-frames": 60
}
}
}
After:
VIRGO has renewed the capture lease and another 60 frames will be captured and delivered.