vamp-cli-ee

Installation

Vamp CLI EE is a Node.js package. Install it globally and export the host address of your Vamp installation via VAMP_HOST.

npm install -g vamp-cli-ee
export VAMP_HOST=http://vamp-host
vamp --help

You will need to authenticate and provide the correct namespace to further use the CLI

Tokens and Namespaces

Before you can use the CLI, you need have an API token and set the correct namespace.

  • API token: can be set by export VAMP_TOKEN=<token uuid> or as an CLI argument --token <token uuid>

  • Namespace: can be set by export VAMP_NAMESPACE=<namespace uuid> or as an CLI argument --namespace <namespace uuid>

Logging in as a Non Admin User

If you do not have the access rights to create a token, your Vamp admin must provide you with one.

Also, you must be provided with the correct namespace UUID.

Logging in will prompt you to request an API token from your admin.

vamp login -u tim -p password
You do not have enough rights to create an API token, please request a token from your Vamp admin.
Then add the token to your request using the "--token [token]" syntax or export as VAMP_TOKEN

Once you have the token and namespace, you can proceed.

export VAMP_TOKEN=3366ca4397f87f5de6bc9b5863f37efb46f4bc6f4d9626e
export VAMP_NAMESPACE=6d1339c7c7a1ac54246a57320bb1dd15176ce29

Credentials can be passed in a number of ways and evaluated in the following order:

  1. Passed in as part of a command, for example --namespace

  2. Passed in via ENV vars, for example VAMP_NAMESPACE

  3. Passed in via ~/.vamp file

Logging in as an Admin User

Admins are a bit different from other users. They can generate their own API access tokens. They can also query the organisation namespace for users, roles, tokens, environments etc.

Login

Logging in when you are an admin sets the admin namespace as default.

vamp login -u admin -p password
Login successful

Admin credentials are written unencrypted to~/.vamp

List namespaces

You can now list the organisation's namespaces.

vamp list namespaces
NAME UUID
test 6d1339c7c7a1ac54246a57320bb1dd15176ce29
prod 51b1a5465f4ea62adf537b4f72bb23dc096ce6ca

List tokens

You can list the tokens for the organization.

vamp list tokens

List users

You can list all the users for the organization.

vamp list users
NAME ROLES
Bob qa
Admin admin
Tim developer
Jason developer

List roles

You can also list all the user roles for the organization.

vamp list tokens

Examples

Get the details of a gateway

vamp describe gateway myDeployment/myService/web

Set a condition on specific route in a gateway

vamp update-gateway myDeployment/myService/web \
--route myDeployment/myCluster/myService:1.1.0/web
--condition "User-Agent == Safari"
--strength 100%

Set the weight distribution on set of routes in a gateway

vamp update-gateway myDeployment/myService/web \
--weights myDeployment/myCluster/myService:1.0.0/web@50%,myDeployment/myCluster/myService:1.1.0/web@50%

Note for Windows users

On Windows, the ‘%’ sign is reserved. The Vamp CLI uses this character when updating the weight on gateways. You need to surround the --weights command argument with double quotes ".

vamp update-gateway myDeployment/myService/web \
--weights "route1@50%,route2@50%"

List metrics, filtered with tags and paginated

vamp list events --tags metrics --per-page 10 --page 1

Admin Only

Namespaces cannot be managed using the CLI

See details of an user

vamp describe user admin

Create a user

vamp create user -f createUser.json

Delete a user

vamp delete user agnes

See details of a token

vamp describe token mytoken

Create a token

vamp create token -f createToken.json

Delete a token

vamp delete token mytoken