Skip to content

Instantly share code, notes, and snippets.

@lutter
Last active Dec 21, 2015
Embed
What would you like to do?
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