Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Configuration management with MongoDB is handled by the configdb class.   In general, we add additional documents to the database, but do not change existing ones, so we can keep a complete history of configuration changes.  The basic organization is:

  • Each type of device has a collection that includes possible configurations for instances of this device.  The configurations are stored as typed JSON objects.
  • The configuration database includes a set of hutches, one collection per hutch.
  • Each hutch has a set of aliases, which describe a specific running condition (for example: "BEAM" or "NO_BEAM").
  • The hutch collection has a set of documents which include an alias, a version number, and a list of dictionaries (one per device).  These dictionaries include the name of the instance of the device, the device type, and an ID which identifies the particular configuration document in the device type collection that should be used. The highest version number for a particular alias is the current configuration for this alias.

The constructor for the configdb class has the form configdb(server, h=None, create=False, root="NONE"), where:

  • server is a string identifying the MongoDB server and is either "user:password@host:port" or "host:port".