-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Use Cases
Note: all use cases can performed using API or UI.
As a user, I want to backup the inventory.
As a user, I want to restore a specific snapshot of the inventory.
As a user, I can list, create and delete snapshots.
As a user, I want to demo using a (choice of) snapshots of the inventory.
Overview
A Hub snapshot contains the DB and bucket/file data. They can be used to prime an instance for demos, backup/restore and reverting to a snapshot in time.
- Created
- Listed
- Exported
- Imported
- Deployed
- Deleted
Snapshot Anatomy (tarball):
- /snapshot.yaml - manifest YAML file about the snapshot.
- name: The name of the snapshot.
- key: (optional) The encryption key (encrypted using a password).
- /hub.db - The sqlite3 DB file.
- /bucket - The bucket tree.
Snapshots stored on the /snapshot PV.
Workflows:
List
route: GET /snapshots
returns: A list of created or uploaded snapshots. (Listing of name: found in manifests).
Export
route: POST /snapshots/export
body: A password used to encrypt the encryption key.
returns: streamed snapshot (tarball).
Create
route: POST /snapshots/:name
actions:
- Create /snapshot/uuid/snapshot.yaml (with name).
- Create /snapshot/uuid/snapshot.tar.gz
Import
route: POST /snapshots/import/:name
body: multi-part file upload of a tarball and the password used to encrypt the encryption key.
action:
- Store the uploaded in snapshot (tarball) in /snapshot/uuid
- Extract /snapshot.yaml and decrypt the key using the password.
- Encrypt key in /snapshot.yaml using the (local) encryption key and update the extracted file.
Deploy
route: POST /snapshot/deploy/:name
action: Create a symlink /snapshot/deploy => the snapshot (directory) to be deployed.
Deploy Flow in Hub main.
- Detect /snapshot/deploy
- Extract the tarball
- Update Settings.Hub.DB.Path = /snapshot/deploy/hub.db.
- Update Settings.Hub.Bucket.Path = /snapshot/deploy/bucket
- Run migration
- Re-Encrypt identities using the key in /snapshot/deploy/snapshot.yaml and the (local) encryption key.
- Replace the Live hub.db and /bucket (tree) snapshot.
- Delete (unlink) /snapshot/deploy.
- Reload Settings.Hub.
- Start services.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status