User story #21247
closedAdd an API endpoint to export rules, directives, techniques, groups and their dependencies in an archive
Description
Add an API endpoint that would export rules and their dependencies: directives, techniques (with resources), groups.
Add the corresponding endpoint to import the same things (or a sub-set of that).
Part of the user story is to define the serialization format.
We want to use an archive, likely zip because of its wide availability, of files organized in directory by type that mimic content of /var/rudder/config-repo
We want to use a similar format too.
There is a question around revision since it does not have meaning out of the context of a Rudder, but may be important for understand things afterward. A middle ground could be to export it in archive, but ignore it in import (since we can't import things at a given revision, just on a branch).
Serialisation should be easely human updatable, even with long text. Yaml is a good candidate. A first version can use another format, as long as the feature is put behind a feature flag that needs to be enabled so that people are informed that the format is not definitive.
EDIT: this first user story will only be for exporting archive of items with (optionaly) their dependencies.
We use json for now, but would like to be able to change the format latter on, so we will put the feature behind a feature switch.
A second user story for the opposite action (import zip archive with json serialized objects) will be added as a subtask.