racksdb CLI manpage

This section explains all racksdb command options available, with many examples and descriptions of its behaviours. The content of the page this also available in racksdb(1) manpage after installation.

Synopsis

racksdb [GENERAL OPTIONS] COMMAND [COMMAND OPTIONS]

General Options

-h, --help

Show this help message and exit.

-v, --version

Show RacksDB version number and exit.

--debug

Enable debug mode with more messages in output.

-b, --db=DB

Path to database. Both files and directories paths are accepted. If the path is a directory, all YAML files in this directory are loaded, recursively. If the path does not exist, an error is reported. Default value is /var/lib/racksdb/ directory.

-s, --schema=SCHEMA

Path to RacksDB schema YAML file. If the file does not exist, an error is reported. Default value is /usr/share/racksdb/schemas/racksdb.yml.

-e, --ext=EXT

Path to optional RacksDB schema extensions. If the file does not exist, it is silently ignored by RacksDB. Default value is /etc/racksdb/extensions.yml.

Commands

All commands accept -h, --help option to get details about available option for this particular command (ex: racksdb nodes --help). Commands are grouped by functional purpose, and listed in lexicographical order inside each group.

Analysis commands

dump

Dump raw data loaded from database on standard output. The generated output can be reloaded by RackDB.

schema

Dump schema, including optional extensions, on standard output.

Search commands

These commands are named after the entities to search in the database.

All search commands accepts the following options:

--fold

Fold ranges of objects and names. By default, ranges objects and names are expanded. This option produces more concise results.

--format=FORMAT

Select alternative format for command output. Possible values are yaml and json. The default value is yaml except when -l, --list option is enabled (see below).

-l, --list

List names of selected entities, without detailed information. When this option is enabled, the default output format is the raw list of names with one name per line. Alternative format can be selected with --format option (see above). The list can also be folded with --fold option (see above).

--with-objects-types

Add object types names in detailed dumps. This option has no effect with -l, --list.

The search commands available are the following:

datacenters

Dump information about datacenters.

This command accepts the following options:

--name=NAME

Name of the datacenter to search.

--tags=TAG [TAG]

Select the datacenters labelled with these tags.

infrastructures

Dump information about infrastructures.

This command accepts the following options:

--name=NAME

Name of the infrastructure to search.

--tags=TAG [TAG]

Select the infrastructures labelled with these tags.

nodes

Dump information about nodes.

This command accepts the following options:

--infrastructure=INFRASTRUCTURE

Select the nodes in this infrastructure.

--name=NAME

Name of the node to search.

--tags=TAG [TAG]

Select the nodes labelled with these tags.

racks

Dump information about racks.

This command accepts the following options:

--name=NAME

Name of the rack to search.

Examples
$ racksdb datacenters

Dump information about all the datacenters with their rooms and racks in YAML format.

$ racksdb datacenters --tags tier2 --format json

Dump information about all the datacenters that have the tier2 tag in JSON format.

$ racksdb infrastructures

Dump information about all the infrastructures with their parts and equipments.

$ racksdb infrastructures --tags hpc cluster

Dump information about all the infrastructures that have both the hpc and cluster tags.

$ racksdb infrastructures --list

List names of all infrastructures in database.

$ racksdb nodes --name cn001

Dump information node named cn001.

$ racksdb nodes --tags compute

Dump information of all nodes that have the compute tag.

$ racksdb nodes --tags compute --list --fold

Folded names of all nodes that have the compute tag.

$ racksdb nodes --infrastructure tiger --tags server --list --format json

List of names of all nodes in tiger infrastructure that also have the server tag in JSON format.

$ racksdb racks

Dump information about all racks with their equipments.

$ racksdb racks --name R7-06 --fold

Dump information about rack R7-A06 with folded node range.

Draw commands

The draw command is used to generate image file with graphical representations of database entities. This command is used in combination with a sub-command to indicate the type of database entity.

This command accepts the following options:

--name=NAME

Name of the entity to represent. This option is required.

--format=FORMAT

File format of the generated image file. Possible values are png, svg and pdf. Default value is png.

--parameters=PARAMETERS

Path to YAML drawing parameters file. With special value -, drawings parameters are read on standard input.

--drawings-schema=DRAWINGS_SCHEMA

Path to drawing parameters schema YAML file. Default value is /usr/share/racksdb/drawings.yml.

The following sub-commands are available:

infrastructure

Draw racks of an infrastructure, grouped by rows. The front side of the racks are represented with the equipments of the infrastructure.

room

Draw datacenter room map with its racks. The room is represented from the top view with rows and racks at their position in this room.

Examples
$ racksdb draw room --name=atlas

Generate the map of datacenter room atlas with all its racks in PNG image file atlas.png.

$ racksdb draw infrastructure --name=tiger --format=svg

Generate SVG image file tiger.svg with racks and equipments used in tiger infrastructure.

$ racksdb draw infrastructure --name=tiger --format=pdf --parameters=custom.yaml

Generate PDF image file tiger.pdf with racks and equipments used in tiger infrastructure with custom drawing parameters defined in custom.yaml.

$ racksdb draw room --name=noisy --parameters=- < custom.yaml

Generate the map of datacenter room noisy with custom drawing parameters read on standard input fed with content of custom.yaml.

Exit status

0

racksdb has processed command with success.

1

racksdb encountered an error.