---
feature_story: FS_74_69_61_79
feature_title: get set data envelope
feature_status: PARTIAL
---

TODO: Maybe rename "get set data envelope" to "get set envelope_container"?
      Actually, it is all about selecting a snapshot of `data_envelope`-s - maybe "get set snapshot"?
TODO: Maybe split "get" and "set" part? The channels and implementation are quite different.

# Intro

Currently, the data is populated by plugins running inside the server process during start-up.

There should be a way to update data out of the server process, to get/set envelope:
*   CLI command
*   REST API call

# Addressing approach

The data should be manipulated via `envelope_container`-s which specifies search criteria to
get or set all `data_envelope`-s matching the criteria - this is the only way to avoid exposing internal ids.

The search criteria acts as "snapshot address".
All `data_envelope`-s in the selected snapshot are always replaced entirely.

# Index model

See FS_45_08_22_15 index model.

# CLI `search_control`

To avoid the need to specify FS_31_70_49_15 `search_control` for CLI,
it has to be static = be able to search any `data_envelope` by their `index_prop`-s.

Some of the `search_control` fields:
*   `collection_name` to select MongoDB collection
*   `envelope_class` from `ReservedPropName` to select set of `index_prop`-s
*   N x `index_prop` with some deterministic order

# Payload with `data_envelope`-s

The payload for each operation (get or set) is a list of `data_envelope`-s.

For CLI, the payload maybe split per line with individual `data_envelope` JSON.

# See also

Original issue: https://github.com/argrelay/argrelay/issues/20

Extended ops:
*   TODO: TODO_65_62_32_33: extend data manipulation API by `del` and `invalidate`
