Module cartridge.confapplier¶
Configuration management primitives.
Implements the internal state machine which helps to manage cluster operation and protects from invalid state transitions.
Functions¶
get_active_config ()¶
Get current ClusterwideConfig object of instance
Returns:
cartridge.clusterwide-config or nil, if instance not bootstrapped.
get_readonly ([section_name])¶
Get a read-only view on the clusterwide configuration.
Returns either conf[section_name]
or entire conf
.
Any attempt to modify the section or its children
will raise an error.
Parameters:
section_name: (string) (optional)
Returns:
(table)
get_deepcopy ([section_name])¶
Get a read-write deep copy of the clusterwide configuration.
Returns either conf[section_name]
or entire conf
.
Changing it has no effect
unless it’s used to patch clusterwide configuration.
Parameters:
section_name: (string) (optional)
Returns:
(table)
Local Functions¶
set_state (state[, err])¶
Perform state transition.
Parameters:
state: (string) New state
err: (optional)
Returns:
(nil)
wish_state (state[, timeout])¶
Make a wish for meeting desired state.
Parameters:
state: (string) Desired state.
timeout: (number) (optional)
Returns:
(string) Final state, may differ from desired.
validate_config (clusterwide_config_new)¶
Validate configuration by all roles.
Parameters:
clusterwide_config_new: (table)
Returns:
(boolean) true
Or
(nil)
(table) Error description
apply_config (clusterwide_config)¶
Apply the role configuration.
Parameters:
clusterwide_config: (table)
Returns:
(boolean) true
Or
(nil)
(table) Error description