damas-core API

Command Line Interface

Download and install the damas Bash command on your system:
sudo cp damas.sh /usr/bin/damas
Make it executable:
sudo chmod +x /usr/bin/damas
Read the manual page:
  damas - a command line interface to access a remote damas-core storage

  damas [OPTION...] <COMMAND> [<ARGS>]
  damas [--help] [-q|--quiet] [-v|--verbose] [-l|--lines] <COMMAND> [<ARGS>]

  Curl-based command to expose the operations of a damas-core service.

  When ARGS is -, read standard input.

  Authentication commands:
     signin       <username> <pass> or without arguments for interactive sign in
     signout      Remove authorization token

  CRUDS commands (send JSON to the server, see examples below):
     create       <json>  insert object(s)
     read         <json>  retrieve object(s) keys
     update       <json>  modify object(s) keys
     upsert       <json>  insert and modify object(s)
     delete       <json>  remove object(s)

MORE commands
     graph        <json>  retrieve related nodes and edges"
     search       <query> search
     search_mongo <query> <sort> <limit> <skip> MongoDB search

    URL of the server hosting damas-core. It can specify `https://` or `http://` protocols.
    Token used for authentication.

  create an arbitrary object giving a JSON
      damas -s yourserver create '{\"#parent\":\"value\",\"comment\":\"created with cli\"}'
  list every objects
      damas -s yourserver search *
  retrieve an object
      damas -s yourserver read '"object_id"'
  retrieve multiple objects
      damas -s yourserver read '["object_id1","object_id2"]'
  search keys matching a regular expression
      damas -s yourserver search _id:/.*mov/
  read objects from a search result using a pipe
      damas -s yourserver search * | damas read -
  search deleted:true key, sort by _id key, show result as lines of ids
      damas -s yourserver -l search_mongo '{"deleted":true}' '{"_id":1}' 0 0

  0  Success
  1  Syntax or usage error
  2  Not a damas repository (or any parent)
  3  Server is unreachable
  7  (Server 207) Multi-Status (some nodes do not exist)
  40 (Server 400) Bad request (not formatted correctly)
  41 (Server 401) Unauthorized
  43 (Server 403) Forbidden (the user does not have the right permission)
  44 (Server 404) Not found (all the nodes do not exist)
  49 (Server 409) Conflict (all nodes already exist with these identifiers)
  50 (Server 500) Internal server error
  60 (Server xxx) Unknown server error

  /tmp/damas-<username>-<signature> token issued at signin

    damas.sh part of damas-core and is distributed under the GNU General Public License.
    See the file LICENSE for details.

    damas.sh was originally written by Thibault Allard and is maintained by Remy Lalanne.