logo

Admin

The admin command line tool allows you to manage resources in Hoop.

Login

shell
hoop login

Get Resources

To view the resources you can get, type hoop admin get --help.
shell
hoop admin get plugins
shell
NAME SOURCE PRIORITY CONNECTIONS CONFIG audit - 0 6 - dlp - 0 6 -
Some resources return a tabular view. If they aren't available, you can use the -o json option. For example:
shell
hoop admin get reviews -o json |jq .
The tabular view might include extra information, such as connections indicating which agent is linked or which plugin is associated with it.
shell
hoop admin get conn
conn is an alias to connection
plain text
NAME COMMAND TYPE AGENT STATUS SECRETS PLUGINS postgres-demo [ "psql" "-A" "-F" "\t" "-P" "pa... ] database demo-hoopdev-61242e2c online - (8) audit, dlp, editor, indexer, r... python-weasel-7602 [ "python3" ] application flyioagent online - (7) audit, dlp, editor, indexer, r... ruby-on-rails-leopon-4156 [ "rails" "runner" "-" ] application contoso-macos offline - (7) audit, dlp, editor, indexer, r... ruby-on-rails-rat-6429 [ "rails" "runner" "-" ] application contoso-macos offline - (7) audit, dlp, editor, indexer, r...
To retrieve a single resource
shell
hoop admin get plugins audit

Creating Resources

To view the resources you can create, type hoop admin create --help.

Agents

Create an authentication key and start an agent locally
shell
export HOOP_KEY=$(hoop admin create agent demo) hoop start agent
List it
shell
hoop admin get agents

Connections

The command below establishes a command-line connection with bash, which prints 'hello hoop' to the standard output.
The command below requires that you have at least one agent, named demo. To interact with it using hoop exec|connect, the agent must be deployed.
shell
# create it $ hoop admin create conn hello-hoop -a demo -- bash -c 'echo hello hoop' # interact it $ hoop exec hello-hoop hello hoop
To create a postgres connection
shell
hoop admin create conn pgdemo -a demo --type database/postgres \ -e HOST=demo-pg-db.ch707rnaizjg.us-east-1.rds.amazonaws.com \ -e PASS=dollar-manger-carouse-HEARTED \ -e USER=demoreadonly \ -e PORT=5432 # interact with it hoop connect pgdemo # in another terminal psql -h 0 --port 5433 dellstore -c 'select now()'

Environment Variables

You could map environment variables to a connection
shell
$ hoop admin create conn demo-bashenv -a demo -e ENVIRONMENT=prod -- \ bash -c 'echo environment is $ENVIRONMENT' # interact with it $ hoop exec demo-bashenv environment is prod
You could map an environment variables as a file in the filesystem
shell
$ hoop admin create conn demo-bashfs -a demo -e filesystem:SECRET_FILE=mybigsecret -- \ bash -c 'echo $SECRET_FILE; cat $SECRET_FILE' # interact with it $ hoop exec demo-bashfs /tmp/29837bea-6eb9-4f82-856a-a47a7c9c7654.envfs mybigsecret
Using a base64 value as input to environment variables
shell
$ hoop admin create conn demo-b64env -a demo -e b64-envvar:MYENV=$(echo val |base64) -- \ bash -c 'echo $MYENV' # interact with it $ hoop exec demo-b64env val

Deleting Resources

To see the available resources available to delete, type hoop admin delete --help
Delete an agent
shell
hoop admin delete agent demo

Server Info

To see the server information of the gateway
shell
hoop admin serverinfo
plain text
Tenant Type: multitenant Grpc URL: grpcs://use.hoop.dev:8443 Version: 1.21.27 Gateway Commit: e6a0677648b0dbe2a8831fcad4a4e2f0eb8f2d8b Webapp Commit: 99ce59dc328769c00029befb45503a6cdf96535c Configuration: Log Level: info Go Debug: http2debug=0 Admin Username: admin Redact Credentials: set Webhook App Credentials: set Ask AI Credentials: not set IDP Audience: set IDP Custom Scopes: not set Postgrest Role: set

Powered by Notaku