Giter VIP home page Giter VIP logo

regatta-client's Introduction

Release Go version License: MIT Tantalor93 lint goreleaser-check codecov Go Report Card

regatta-client

CLI client for querying Regatta store

Installation

you can install regatta-client using Homebrew

brew tap tantalor93/regatta-client
brew install regatta-client

or using Go tooling

go install github.com/tantalor93/regatta-client@latest

or you can download the latest binary archive for your operating system and architecture here

Docker

you can also run regatta-client in a Docker container using provided image

docker run ghcr.io/tantalor93/regatta-client --version

Usage

Command-line tool wrapping API calls to Regatta (https://engineering.jamf.com/regatta/).
Simplifies querying for data in Regatta store and other operations.

Usage:
  regatta-client [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  delete      Delete data from Regatta store
  help        Help about any command
  man         Generates man pages
  put         Put data into Regatta store
  range       Retrieve data from Regatta store
  table       Print available tables
  version     Get current version of regatta-client and a Regatta server

Flags:
      --cert string             Regatta CA cert
      --dial-timeout duration   timeout for establishing the connection to the Regatta (default 2s)
      --endpoint string         Regatta API endpoint (default "localhost:8443")
  -h, --help                    help for regatta-client
      --insecure                allow insecure connection, controls whether certificates are validated
      --no-color                disable color output
      --timeout duration        timeout for the Regatta operation (default 10s)
  -v, --version                 version for regatta-client

Use "regatta-client [command] --help" for more information about a command.

Examples

Get all tables

this example retrieves all available tables in the Regatta store

regatta-client table

Get client and server version

this example prints client and Regatta server version

regatta-client version

Get all records in a table

this example retrieves all records in the example-table table

regatta-client range example-table

Get all records in a table without decoding keys/values to UTF-8 strings

this example retrieves all records in the example-table table without decoding binary data, this is achieved by using the --binary flag. Retrieved key-value pairs are shown as Base64 strings

regatta-client range example-table --binary 

Get a record by a key in a table

this example retrieves a record with the key example-key in the example-table table

regatta-client range example-table example-key

Get all records with the given prefix in a table

this example retrieves all records with keys prefixed with example in the example-table table. Note the asterisk, when doing a prefix search! Without the asterisk, it is not a prefix search

regatta-client range example-table 'example*'

Delete record by key in a table

this example deletes the record with the key example-key in the example-table table

regatta-client delete example-table example-key

Delete all records with the given prefix in a table

this example deletes all records with keys prefixed with example in the example-table table. Note the asterisk, when doing prefix delete! Without the asterisk, it is not a prefix delete

regatta-client delete example-table 'example*'

Delete all records in a table

this example deletes all records in the example-table table

regatta-client delete example-table '*'

Put data into a table

this example inserts (or updates existing record with the same key) into table example-table a record with key example-key and value example-value

regatta-client put example-table example-key example-value

Put binary data into a table

to put binary data into Regatta using this tool, you need to encode the value using Base64 and use the --binary flag, For example, this inserts into table example-table a record with key example-key and value example-value, where the value was provided encoded as Base64 string

regatta-client put example-table example-key ZXhhbXBsZS12YWx1ZQ== --binary

regatta-client's People

Contributors

coufalja avatar dependabot[bot] avatar tantalor93 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

coufalja

regatta-client's Issues

Table API

Describe the feature
add a command that allows me to print available tables in the Regatta

Why do you need this feature
so that a user can better interact with the Regatta store using this CLI without previous knowledge of available tables

Print number of deleted items

Describe the feature
delete command should print number of deleted items

Why do you need this feature
so the user can see whether data was deleted and how many key-value pairs were deleted

Option to print only values for range command

Describe the feature
add —values-only flag to range command to print only values.

This option should affect all output formats and all kinds of searches

Why do you need this feature
Sometimes users might be interested only to see values in database, not keys under which they are stored

Add support for insecure calls

Describe the feature
I want to call regatta API which uses self-signed TLS certificates without the need to import them first.

Why do you need this feature
To make ad-hoc calls easier.

Make range command output more human readable

Describe the feature
Change default output format of range command to plain text and make the output format configurable with a new flag —output <plain/json>

by default the plain output format is assumed and the range response will look like this:

<key1>: <value1>
<key2>: <value2>
…

no escaping should be done for either keys or values, the keys and values should be printed as UTF-8 strings (unless binary flag is specified in that case the keys and values are printed in base64)

Why do you need this feature
the current JSON format we use for printing responses is great for futher automatic processing, but at the cost of human readability of values consisting of JSON, because of the need to escape quote characters

Paging when doing prefix search does not work well

What happened
prefix searches over large dataset with same prefix do not work well with paging, not all items with prefix are returned

What you expected to happen
prefix search over large same prefix dataset returns all items with prefix

regatta-client command

regatta-client range table 'prefix*'

support JSONL (JSON Line) output format

Describe the feature
support jsonl format in range command --output flag

example when I use

regatta-client range example --output=jsonl

expected output would be something like

{"key": "example-key1", "value": "example-value1"}
{"key": "example-key2", "value": "example-value2"}

Why do you need this feature
This format is a better variant for the continual processing of range command output while having the output structured as JSON

Get all range requests doesn't support paging

What happened
Range request only responds with object that fits into 4MB network limitation for gRPC.

What you expected to happen
Paged results that will return all the objects in the regatta table.

regatta-client command

regatta-client --endpoint localhost:8443 --insecure range device-identity

Version API

Describe the feature
Add the version command, which will print client and server version

Why do you need this feature
I want a simple way to print client and server versions to improve the debugging of issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.