Skip to main content

SAFER-STORAGE System Backend REST API Server

This backend is implemented using FastAPI

Quick start

Install the module on your system sing PyPI:

pip install sysapi

Then start the service using default settings (test on localhost:8000), run the following command:

uvicorn sysapi.main:app --reload

File system organization

File system organization (download PDF)

REST Routes

GET routes

Version prefix

All routes start with a /{version}/ prefix, which is currently set to v1

Meta data

These routes are used to retrieve data about users and snapshots

  • /v1/users : list user accounts
  • /v1/user/{user} : get user's meta-data
  • /v1/snapshots : list of all available snapshots
  • /v1/snapshots?user={user} : list of available snapshots for user
  • /v1/snapshot/{@snapshot} : get @snapshot meta-data

NB:

  • users, snapshots, and root are reserved user names to avoid conflicts.
  • snapshots are always identified using an @-prefixed name, eg. @initial, which also solved ambiguity between snapshot and user routes.

Filesystem navigation in time and space

The general form is as follows:

  • /v1/{user}/{time-location}/{space-location}

With the following constructs:

  • {time-location} is one of:
    • at/{@sanpshot} : the state of the filesystem as captured in snapshot named {snapid}
    • before/{@snapshot} : the state of the filesystem as captured in snapshot(s) immediately preceding the snapshot named {@snapshot} (if any)
    • past/{@snapshot} : merged view of the filesystem composed of all snapshot(s) preceding, and including, the snapshot named {@snapshot}.
    • The special name @current is reserved and used to designate the current state of the filesystem. It is actually a real snapshot, that is created each time an API call requests this time-point.
  • {space-location} is of the form:
    • `` (empty): user's homedir content
    • {path}/ : content of the directory designated by the URL-encoded path starting from the user's homedir
    • {path}/file : file located in directory designated by path

NB: the root virtual user is only available to the admin user and his/her home directpry is at the root of the filesystem

Examples:

  • /v1/joe/at/@current/ : joe's current homedir
  • /v1/joe/at/@snap-2019-09-18-2230/Photos/Kickoff/people.jpg : joe's file named people.jpg in sub-directory Photos/Kickoff as it was captured by snapshot named @snap-2019-09-18-2230
  • /v1/root/before/@snap-2019-09-18-2230/users/joe/Photos/ : content of directory users/joe/Photos/ for admin user as it was captured by snapshot immediately preceding the snapshot named @snap-2019-09-18-2230

POST routes

  • /v1/users

    Creates a user with following elements:

    • login
    • password
    • email
  • /v1/copyto/{space-location}

    Copies the list of files designated in the body to the space-location designated by the URL: In the body, each file is designated by a triplet:

    • "path"="path/to/file"
    • "snapshot"="@snapshot" from which the file is copied
    • "destructive"=boolean Returns: The updated content of target directory (space-location)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sysapi-0.0.5.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sysapi-0.0.5-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file sysapi-0.0.5.tar.gz.

File metadata

  • Download URL: sysapi-0.0.5.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for sysapi-0.0.5.tar.gz
Algorithm Hash digest
SHA256 c319128e0336c6e915f4ba60e45544d5cfbc94234ff093e14354f5a928e12989
MD5 ce07edd13f57e0c18ac9678f476618c1
BLAKE2b-256 12ac90393dfb10312a5c12ab8d472ebd66f7a41028f9b81e3c0e8fefbce42982

See more details on using hashes here.

File details

Details for the file sysapi-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: sysapi-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for sysapi-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 465c998cac625cf7c34ba3d8b751599fbde740aea1a9958edd0f75869e0c9b22
MD5 8bcefc7f94d95c85ae18452e6d694364
BLAKE2b-256 d2ada38c40063b409647c3420305c974d5bbb23b7ff8212f278eab8bea02216c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page