Skip to content

Latest commit

 

History

History

tools

DEP tools and scripts

A set of example shell scripts and tools for working with the depserver proxy and configuration APIs. For more information how and why you might use these scripts please see the Operations Guide.

Requirements

These scripts require a couple tools to be in your shell path:

  • curl
  • jq
  • Bourne-ish shell interpreter.

Setup

For these scripts to work you have to have a few environment variables set first. You could embed these into their own file and use source to set them if you'd like to re-use them.

# the URL of the running depserver
export BASE_URL='http://[::1]:9001'
# should match the -api switch of the depserver
export APIKEY=supersecret
# the DEP name (instance) you want to use
export DEP_NAME=mdmserver1

Be cautious to unset these variables or exit the shell when you're done so as not to leave API keys hanging out in environment variables. Also beware the API key is provided to curl on the command line and will likely be visible in process lists.

Example

First setup the environment variables per above then the scripts can be executed:

# get a the account details
% ./dep-account-detail.sh 
{
  "server_name": "Example Server",
  ...
}