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

TODO: Maybe rename "get set data envelope" to "get set envelope_container"?

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" and data is always replaced entirely for the selected snapshot.

# General idea

REST API is trivial, if it does not need to be convenient for CLI, but it does have to be convenient for CLI.

How the convenience requirement is resolved explained in the next sections.

# Internal metadata for CLI

All `data_envelope`-s can be scanned to create a `data_envelope`-s with metadata for get or set operations.

Metadata `data_envelope` will have to provide (describe) each `envelope_class` loaded so far:
*   `collection_name`
*   `envelope_class`
Its payload will have to be `index_props` of that `envelope_class`.

# 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
