NAME

collection_mgr - Collection Manager, used to manipulate collections in the database and their contents.


MODULE

base


SYNOPSIS

collection_mgr [--help] [--man] [--db connectstring] [--new <names...> [--collection <name>]] [--copy <from> <to> [--collection <name>]] [[--get] [--flat] <names...>] [--set <node> <names...>] [--clear <names...>] [(--add|--subtract) "<name1> <name2>..."]... [--destroy <names...> [--cleanup]] [--find] [--diff <name1> <name2>]


DESCRIPTION

This tool is used to manage collections in the CIToolkit configuration database. It can be used to create new collections or remove existing ones, as well as add to, remove from, or show the contents of collections. Finally, it can be used to list all collections that exist in the database.


OPTIONS

--new <names>... Create a new Collection and add it to the database. May be used with --set, --add and --collection.

--copy <from> <to> Create a new Collection object with the same contents as an existing one. May be used with --collection.

--collection <name> When createing a new Alias with either --new or --copy, also add the new alias to the specified existing collection.

--get <names...> Display the contents of the specified existing collection or collections. This is the default action.

--recurse XXX NOT YET IMPLEMENTED XXX Used with --get, if a collection is found in a collection, recurse into that collection and display it also. Objects are prefixed by the name of the collections recursed to reach them, delimited by ":". Subcollections are not themselves listed, but are aparent by the prefixes.

--set <object> <names...> Set the contents of the collection or collections listed on the commandline to the specified object, removing all existing contents. <name> may be a quoted, space delimited list, or --set can be repeated to add multiple items.

--clear <names...> Remove all members from the specified collection or collections leaving the Collection object in the database.

--add <name>, -a <name> Add one or more items (Devices, Aliases, Collections, etc.) to the collection or collections listed on the commandline, preserving the existig contents. <name> may be a quoted, space delimited list, or --add can be repeated to add multiple items.

--subtract <name>, --sub <name> Remove one or more items (Devices, Aliases, Collections, etc.) from the collection or collections listed on the commandline. <name> may be a quoted, space delimited list, or --subtract can be repeated to remove multiple items. --subtract may not be used with --set.

--destroy <names>... Remove the existing collection or collections from the database. If it was part of any other collections, or referenced by any Aliases, then a warning of dangling references will be reported. Objects in removed collections will not themselves be removed, though they may no longer be part of any collection.

--cleanup Used with --destroy, remove all references (Aliases or Collection membership) to the removed Collection, instead of warning about dangling references.

--find Display a list of all collections in the database. Might be slow for very large databases as every object must be fetched and checked to see if it is a collection. (may not be combined with other options)

--diff <name1> <name2> Display the differences between two Collection objects. (may not be combined with other options)

--db <connectstring> Database type and connection information. For GDBM, "GDBM:" followed by the filename of the cluster database to use. For LDAP, the syntax is "LDAP:host:port:dbname"

--help Print extended usage information

--man Print this manpage.


NOTES

Unless noted above, multiple actions can be taken with one command. For example, the following command will create a new collection, add a couple devices to it, and show the contents of the new collection:

  # collection_mgr --new blah --set E<quot>node4 ts0E<quot> --add node7 --get

Regardless of the order of commands on the command line, actions are always taken in the following order:

  find, diff, copy, new, destroy, clear, set, subtract, add, get

If only --find, --diff, or --get is used, then the database will be opened read-only. Otherwise, it will be locked for read-write access.


FILES

The default paths for location of the cluster configuration database, cloned directories, supporting libraries, and other settings are recorded in the CConf.pm config file. Set the environment variable CLUSTER_CONFIG to the location of CConf.pm, or use the default of /cluster/config


SEE ALSO

device_mgr, alias_mgr, db_mgr, lookup