Skip to content

Instantly share code, notes, and snippets.

@lutter
Last active December 21, 2015 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lutter/6234226 to your computer and use it in GitHub Desktop.
Save lutter/6234226 to your computer and use it in GitHub Desktop.
Sketch of Razor CLI

CLI Overview

Commands

Any command can be run with the generic command syntax

razor command :name :body

For example,

razor command create-installer /tmp/installer.json

For some commands, there are conveniences to provide all parameters from the command line. Generally, this is only useful for fairly simple commands:

razor create-image redhat --url http://somewhere.example.org/redhat.iso

razor create-tag small --rule '["=", ["fact", "processorcount"], "4"]'

razor create-policy mypolicy --image redhat --installer redhat6 \
  --hostname 'host${id}.example.com' --root-password secret \
  --line-number 100 --max-count 20 \
  --tags large,green,top-of-the-rack

Queries

For all the collections, you can run

razor :collection

to get a list of all items in the collection and

razor :collection --name :name

to get details about the item with that name in the collection. For example,

# List all nodes
razor nodes

# List a specific tag
razor tags --name top-of-the-rack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment