ConfigManager¶
- class geodesic.config.ConfigManager[source]¶
Bases:
object
Manages the active config. Mostly just used by the CLI, but if you needed to programatically change config, that’s also an option.
- get_config(name)[source]¶
Returns the cluster config for the given name. Useful for when the user needs to hop between clusters as runtime, also used internally in the CLI.
- Parameters
name (str) – the name of the cluster to get the config for
- Returns
the requests cluster config
- get_active_config()[source]¶
Gets whichever cluster config is active in the config file
- Returns
the active cluster config
- set_active_config(name, add_cluster=None, overwrite=False)[source]¶
Set the active cluster config. This can either be a config that’s already in the file or a new one
- Parameters
name (str) – the name of the cluster to make active
add_cluster (Optional[Union[geodesic.config.ClusterConfig, dict]]) – a ClusterConfig (or dict) to add. Name in the config must match the name argument
overwrite (bool) – overwrite an existing config, if present
- Returns
the new active cluster config