cloudmesh-inventory.cloudmesh.inventory.command.inventory

Module Contents

Classes

InventoryCommand

class cloudmesh-inventory.cloudmesh.inventory.command.inventory.InventoryCommand

Bases: cloudmesh.shell.command.PluginCommand

do_inventory(self, args, arguments)
Usage:
inventory add NAMES [–label=LABEL]

[–services=SERVICES] [–project=PROJECT] [–owners=OWNERS] [–comment=COMMENT] [–inventory=INVENTORY] [–cluster=CLUSTER] [–ip=IP] [–service=SERVICE] [–tag=TAG] [–keyfile=KEYFILE]

inventory create TAG [–hostnames=NAMES]

[–ip=IP] [–inventory=INVENTORY] [–keyfile=KEYFILE]

inventory set NAMES ATTRIBUTE to VALUES [–inventory=INVENTORY] [–listvalue] inventory delete NAMES [–inventory=INVENTORY] inventory clone NAMES from SOURCE [–inventory=INVENTORY] inventory list [NAMES] [–format=FORMAT] [–columns=COLUMNS] [–inventory=INVENTORY] inventory info [–inventory=INVENTORY] inventory remove –inventory=INVENTORY

Arguments:

NAMES Name of the resources (example i[10-20]) FORMAT The format of the output is either txt,

yaml, dict, table [default: table].

OWNERS a comma separated list of owners for this resource LABEL a unique label for this resource SERVICE a string that identifies the service PROJECT a string that identifies the project SOURCE a single host name to clone from COMMENT a comment

Options:
-v

verbose mode

--keyfile=KEYFILE

Keyfile to assign [default: ~/.ssh/id_rsa.pub]

Description:

add – adds a resource to the resource inventory list – lists the resources in the given format delete – deletes objects from the table clone – copies the content of an existing object

and creates new once with it

set – sets for the specified objects the attribute

to the given value or values. If multiple values are used the values are assigned to the and objects in order. See examples

map – allows to set attributes on a set of objects

with a set of values

Examples:

cms inventory add x[0-3] –service=openstack

adds hosts x0, x1, x2, x3 and puts the string openstack into the service column

cms inventory list

lists the repository

cms inventory set x[3-4] temperature to 32

sets for the resources x3, x4 the value of the temperature to 32

cms inventory set x[7-8] ip to 128.0.0.[0-1]

sets the value of x7 to 128.0.0.0 sets the value of x8 to 128.0.0.1

cms inventory set x1 services to bridge,kubernetes –listvalue

sets the value of x1 to [bridge, kubernetes] The –listvalue option indicates the value set is a list

cms inventory clone x[5-6] from x3

clones the values for x5, x6 from x3