Skip to content

Latest commit

 

History

History
137 lines (110 loc) · 3.85 KB

junocli.md

File metadata and controls

137 lines (110 loc) · 3.85 KB

License

JunoDB Command Line Interface

The JunoDB command line interface is used to query a JunoDB data storage service. It supports all JunoDB API operations that any JunoDB client library supports.

The command to run junocli is

./junocli [-version] [[options] <command> [<args>]]

Getting started with junocli

Docker Build

junocli command run from within docker client

docker exec -it junoclient bash -c '/opt/juno/<junocli command>'
#Sample junocli command and full explanation of junocli given below

Manual Build

junocli command can be found under $BUILDTOP/release-binary/code-build

#Create junocli directory
mkdir junocli_tests

#Copy the junocli script
cp release-binary/code-build/junocli junocli_tests/junocli

#Copy the secrets folder
cp -r script/deploy/junoserv/secrets junocli_tests/

cd junocli_tests

#Write the config file (Sample config file and explanation of config parameters given in the link below)
vi config.toml

<Run the junocli command>
#Sample junocli command and full explanation of junocli given below

Sample config file and explanation found here

Sample JunoCLI commands

proxy_ip is the ip of the machine on which the server proxy is running. Can be found using hostname -i command on the proxy machine.
proxy_port for manual build can be found under $BUILDTOP/package_config/package/junoserv/config/config.toml under listener ports (SSL Listener port if using SSL)
proxy_port for docker build can be found under $BUILDTOP/docker/manifest/config/proxy/config.toml under listener ports (SSL Listener port if using SSL)

  1. CREATE
./junocli create -s <proxy_ip>:<proxy_port> -c config.toml -ns test_ns test_key test_value
  1. GET
./junocli get -s <proxy_ip>:<proxy_port> -c config.toml -ns test_ns test_key
  1. UPDATE
./junocli update -s <proxy_ip>:<proxy_port> -c config.toml -ns test_ns test_key test_value_updated
#the value and version number will be updated. You can check this by using the GET command again.
  1. DESTROY
./junocli destroy -s <proxy_ip>:<proxy_port> -c config.toml -ns test_ns test_key 

JunoDB CLI

  • proxy commands
    • create
      create a record
    • get
      get the value of a given key
    • update
      update a record
    • set
      create or update a record if exists
    • destroy
      destroy a record
    • udfget
      udf get
    • udfset
      udf set
    • populate
      populate a set of records with set commands
  • storage commands
    • pcreate
      PrepareCreate to storage server
    • read
      Read to storage server
    • pupdate
      PrepareUpdate to storage server
    • pset
      PrepareSet to storage server
    • delete
      Delete to storage server
    • pdelete
      PrepareDelete to storage server
    • commit
      Commit the record having been prepared successfully
    • abort
      Abort the record having been prepared successfully
    • repair
      Repair record
    • mdelete
      mark a record as deleted
    • populatess
      populate storage with a set of repair commands
  • others
    • cfggen
      generate default configuration file
    • config
      unify the given toml configuration file(s)
    • inspect
      check juno binary message, ...
    • ridinsp
      check RequestID, ...
    • ssgrp
      print the Shard ID and the SS group of a given key

For each command, the user can specify arguments. An explanation for these arguments can be found using
./junocli <command> --help