G2ConfigMgr

Version 3.x Version 2.x

G2ConfigMgr modifies Senzing configurations in the Senzing database.

from senzing import G2ConfigMgr, G2Exception

init

init() initializes the G2ConfigMgr object. It must be called prior to any other calls.

g2_config_mgr.init(g2_object_name, senzing_config_json, verbose_logging)
Parameters
  • g2_object_name: (str) A short name given to this instance of the G2ConfigMgr object, to help identify it within system logs.
  • senzing_config_json: (str) A JSON string containing configuration parameters.
  • verbose_logging: A boolean which enables diagnostic logging. 0 for no logging; 1 for logging.
Click to expand init() example

addConfig

addConfig() adds a configuration JSON document to the Senzing database.

g2_config_mgr.addConfig(senzing_config_json, config_comment, config_id_bytearray)
Parameters
  • senzing_config_json: (JSON str) The configuration JSON document.
  • config_comment: (str) A free-form string of comments describing the configuration document.
  • config_id_bytearray: (bytearray) The returned configID for the new config document registered in the data store.
Click to expand addConfig() example

getConfigList

getConfigList() retrieves a list of the configuration JSON documents contained in the data repository.

g2_config_mgr.getConfigList(response_bytearray)
Parameters
  • response_bytearray: (bytearray) Object to store the output of the method.
Click to expand getConfigList() example

getConfig

getConfig() retrieves a specific configuration JSON document from the data repository.

g2_config_mgr.getConfig(config_id_bytearray, response_bytearray)
Parameters
  • config_id_bytearray: (bytearray) The configID for the config document that you wish to retrieve.
  • response_bytearray: (bytearray) Object to store the output of the method.
Click to expand getConfig() example

getDefaultConfigID

getDefaultConfigID() retrieves a specific configuration ID from the data repository.

g2_config_mgr.getDefaultConfigID(config_id_bytearray)
Parameters
  • config_id_bytearray: (bytearray) Returns the configID for the current default configuration, or 0 if none is set.
Click to expand getDefaultConfigID() example

setDefaultConfigID

setDefaultConfigID() sets the default configuration JSON document in the data repository.

g2_config_mgr.setDefaultConfigID(config_id_bytearray)
Parameters
  • config_id_bytearray: (bytearray or int) The configuration ID for a configuration JSON document previously added to the database.
Click to expand setDefaultConfigID() example

replaceDefaultConfigID

getDefaultConfigID() checks the current default configuration ID, and if it matches, replaces it with another configured ID in the database.

g2_config_mgr.replaceDefaultConfigID(config_id_bytearray, new_config_id_bytearray)
Parameters
  • default_config_id_bytearray: (bytearray) The current default configuration value to verify.
  • new_config_id_bytearray: (bytearray) The new configID value.
Click to expand replaceDefaultConfigID() example

Cleanup

destroy

destroy() destroys and performs cleanup for G2Config.

g2_config_mgr.destroy()
Click to expand destroy() example