clap.node_manager
¶
Module Contents¶
Classes¶
Attributes¶
- exception clap.node_manager.DeploymentError¶
Bases:
Exception
Common base class for all non-exit exceptions.
Initialize self. See help(type(self)) for accurate signature.
- exception clap.node_manager.InvalidNodeError(node_id)¶
Bases:
Exception
Common base class for all non-exit exceptions.
Initialize self. See help(type(self)) for accurate signature.
- exception clap.node_manager.InvalidProvider¶
Bases:
Exception
Common base class for all non-exit exceptions.
Initialize self. See help(type(self)) for accurate signature.
- class clap.node_manager.NodeManager(node_repository_controller, providers, private_dir)¶
- static _group_instances_by_provider(instances)¶
- Parameters
instances (List[Tuple[clap.configs.InstanceInfo, int]]) –
- Return type
Dict[str, List[Tuple[clap.configs.InstanceInfo, int]]]
- add_tags(self, node_ids, tags)¶
- Parameters
node_ids (List[str]) –
tags (Dict[str, str]) –
- Return type
List[str]
- get_all_nodes(self)¶
- Return type
List[clap.node.NodeDescriptor]
- get_nodes(self, filter_func, from_node_ids=None)¶
- Parameters
filter_func (Callable[[clap.node.NodeDescriptor], bool]) –
from_node_ids (List[str]) –
- Return type
List[clap.node.NodeDescriptor]
- get_nodes_by_id(self, node_ids)¶
- Parameters
node_ids (List[str]) –
- Return type
List[clap.node.NodeDescriptor]
- get_nodes_with_tag(self, key, from_node_ids=None)¶
- Parameters
key (str) –
from_node_ids (List[str]) –
- Return type
List[clap.node.NodeDescriptor]
- get_nodes_with_tag_value(self, key, value, from_node_ids=None)¶
- Parameters
key (str) –
value (str) –
from_node_ids (List[str]) –
- Return type
List[clap.node.NodeDescriptor]
- get_not_running_nodes(self, from_node_ids=None)¶
- Parameters
from_node_ids (List[str]) –
- Return type
List[clap.node.NodeDescriptor]
- get_reachable_nodes(self, from_node_ids=None)¶
- Parameters
from_node_ids (List[str]) –
- Return type
List[clap.node.NodeDescriptor]
- get_up_nodes(self, from_node_ids=None)¶
- Parameters
from_node_ids (List[str]) –
- Return type
List[clap.node.NodeDescriptor]
- static group_nodes_by_provider(nodes)¶
- Parameters
nodes (List[clap.node.NodeDescriptor]) –
- Return type
Dict[str, List[clap.node.NodeDescriptor]]
- is_alive(self, node_ids, retries=5, wait_timeout=30, update_timeout=30, max_workers=1, test_command='echo "OK"')¶
- Parameters
node_ids (List[str]) –
retries (int) –
wait_timeout (int) –
update_timeout (int) –
max_workers (int) –
test_command (str) –
- Return type
Dict[str, bool]
- pause_nodes(self, node_ids, timeout=180, max_workers=1)¶
- Parameters
node_ids (List[str]) –
timeout (int) –
max_workers (int) –
- Return type
List[str]
- remove_node(self, node_id)¶
- Parameters
node_id (str) –
- remove_tags(self, node_ids, tags)¶
- Parameters
node_ids (List[str]) –
tags (List[str]) –
- Return type
List[str]
- resume_nodes(self, node_ids, timeout=600, connection_retries=10, retry_timeout=30, max_workers=1)¶
- Parameters
node_ids (List[str]) –
timeout (int) –
connection_retries (int) –
retry_timeout (int) –
max_workers (int) –
- Return type
List[str]
- start_node(self, instance, count=1, start_timeout=600)¶
- Parameters
instance (clap.configs.InstanceInfo) –
count (int) –
start_timeout (int) –
- Return type
List[str]
- start_nodes(self, instance_counts, start_timeout=600, max_workers=1)¶
- Parameters
instance_counts (List[Tuple[clap.configs.InstanceInfo, int]]) –
start_timeout (int) –
max_workers (int) –
- Return type
List[str]
- stop_nodes(self, node_ids, timeout=180, max_workers=1, remove_nodes=True)¶
- Parameters
node_ids (List[str]) –
timeout (int) –
max_workers (int) –
remove_nodes (bool) –
- Return type
List[str]
- upsert_node(self, node)¶
- Parameters
node (clap.node.NodeDescriptor) –
- class clap.node_manager.NodeRepositoryController(repository)¶
- get_all_nodes(self)¶
- Return type
List[clap.node.NodeDescriptor]
- get_nodes_by_id(self, node_ids)¶
- Parameters
node_ids (List[str]) –
- Return type
List[clap.node.NodeDescriptor]
- get_nodes_filter(self, filter_func)¶
- Parameters
filter_func (Callable[[clap.node.NodeDescriptor], bool]) –
- Return type
List[clap.node.NodeDescriptor]
- remove_node(self, node_id)¶
- Parameters
node_id (str) –
- remove_nodes(self, node_ids)¶
- Parameters
node_ids (List[str]) –
- upsert_node(self, node)¶
- Parameters
node (clap.node.NodeDescriptor) –
- exception clap.node_manager.UnhandledProviderError(provider)¶
Bases:
Exception
Common base class for all non-exit exceptions.
Initialize self. See help(type(self)) for accurate signature.
- clap.node_manager.logger¶