========= Snapshots ========= .. toctree:: :hidden: :glob: Snapshots are useful feature of EOS to store a state of variable instance values in database for future analysis. With snapshots you can store, for example, some EOS forecast and compare it later with real measurements for validation purposes. 1. Create Snapshot ================== To create snapshot of some selected variable instances you need to use following POST request: .. code:: console variable/instance/snapshot_group/create and pass JSON Object: .. code:: typescript { "view_type": "GlobalView", // Raw Values View Type "view_index": 0, // Index of Raw values View. Ignored vor GlobalView and RealtimeView "raster": "Minute_15", // Raster to store data "name": "{\"de_DE\":\"New Snapshot 1\"}", // optional name of snapshot "from": "2021-10-25T22:00:00Z", // Begin of snapshot data "to": "2021-11-14T16:15:00Z", // Begin of snapshot data "forecast": false, // Store only future time period and ignore historical values "is_public": true, // Flag to make snaphot visible for other EOS users "instances": // list of variable instance ids to create a snpashot for [ 173, 53, 54, 55, 174 ] } 2. List Snapshots ================= To list available snapshots use POST request: .. code:: console // without using transaction variable/instance/snapshot_group/get // within transaction variable/instance/snapshot_group/get/trx=[TRX_ID] and pass JSON Object: .. code:: typescript { "from": "2021-10-25T22:00:00Z", // filter time from "to": "2021-11-14T16:30:00Z", // filter time to "instances": null // filter by list of instances. If nothing specified then do not use instance filter } Example output: .. code:: typescript [ { "id": 250, "owner": { "id": 100 }, "name": "{\"de_DE\":\"New Snapshot 1\"}", "timestamp": "2021-11-12T16:09:00.311296Z", "base_raster": "Minute_15", "values_data_from": "2021-10-25T22:00:00Z", "values_data_to": "2021-11-14T16:15:00Z", "snapshot_data_size": 210, "is_public": false, "snapshots": [ 251, 252, 253, 250, 254 ] } ] 3. Get Snapshot values ====================== To get snapshot values of on variable instance use one of following requests: .. code:: console // to get compressed var values byte stream variable/instance/snapshot_group/get/var_values/trx=[TRX_ID]&group_id=[SNAPSHOT_GROUP_ID]&instance_id=[VARIABLE_INSTANCE_ID] // to get double values byte stream variable/instance/snapshot_group/get/dvals/trx=[TRX_ID]&group_id=[SNAPSHOT_GROUP_ID]&instance_id=[VARIABLE_INSTANCE_ID] 4. Delete Snapshots =================== To delete snapshots use one of following POST requests: .. code:: console // delete list of snapshots without creating new transaction variable/instance/snapshot_group/delete // delete list of snapshots within transaction variable/instance/snapshot_group/delete/trx=[TRX_ID] and pass list of snapshots IDs as JSON Object: .. code:: typescript [ 200, 201, 202 ]