Package starcluster :: Module cluster :: Class ClusterManager
[hide private]
[frames] | no frames]

Class ClusterManager

source code


Manager class for Cluster objects

Instance Methods [hide private]
 
__repr__(self)
repr(x)
source code
 
get_cluster(self, cluster_name, group=None, load_receipt=True, load_plugins=True, require_keys=True)
Returns a Cluster object representing an active cluster
source code
 
get_clusters(self, load_receipt=True, load_plugins=True)
Returns a list of all active clusters
source code
 
get_default_cluster_template(self)
Returns name of the default cluster template defined in the config
source code
 
get_cluster_template(self, template_name, tag_name=None)
Returns a new Cluster object using the settings from the cluster template template_name
source code
 
get_cluster_or_none(self, cluster_name, **kwargs)
Same as get_cluster but returns None instead of throwing an exception if the cluster does not exist
source code
 
cluster_exists(self, tag_name)
Returns True if cluster exists
source code
 
ssh_to_master(self, cluster_name, user='root', command=None)
ssh to master node of cluster_name
source code
 
ssh_to_cluster_node(self, cluster_name, node_id, user='root', command=None)
ssh to a node in cluster_name that has either an id, dns name, or alias matching node_id
source code
 
_get_cluster_name(self, cluster_name)
Returns human readable cluster name/tag prefixed with '@sc-'
source code
 
add_node(self, cluster_name, alias=None, no_create=False) source code
 
add_nodes(self, cluster_name, num_nodes, aliases=None, no_create=False)
Add one or more nodes to cluster
source code
 
remove_node(self, cluster_name, alias, terminate=True)
Remove a single node from a cluster
source code
 
restart_cluster(self, cluster_name)
Reboots and reconfigures cluster_name
source code
 
stop_cluster(self, cluster_name, terminate_unstoppable=False)
Stop an EBS-backed cluster
source code
 
terminate_cluster(self, cluster_name)
Terminates cluster_name
source code
 
get_cluster_security_group(self, group_name)
Return all security groups on EC2 that start with '@sc-'
source code
 
get_cluster_security_groups(self)
Return all security groups on EC2 that start with '@sc-'
source code
 
get_tag_from_sg(self, sg)
Returns the cluster tag name from a security group name that starts with static.SECURITY_GROUP_PREFIX
source code
 
list_clusters(self, cluster_groups=None, show_ssh_status=False)
Prints a summary for each active cluster on EC2
source code
 
run_plugin(self, plugin_name, cluster_tag)
Run a plugin defined in the config.
source code

Inherited from managers.Manager: __init__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

get_cluster_template(self, template_name, tag_name=None)

source code 

Returns a new Cluster object using the settings from the cluster template template_name

If tag_name is passed, the Cluster object's cluster_tag setting will be set to tag_name

ssh_to_master(self, cluster_name, user='root', command=None)

source code 

ssh to master node of cluster_name

user keyword specifies an alternate user to login as

ssh_to_cluster_node(self, cluster_name, node_id, user='root', command=None)

source code 

ssh to a node in cluster_name that has either an id, dns name, or alias matching node_id

user keyword specifies an alternate user to login as

get_tag_from_sg(self, sg)

source code 

Returns the cluster tag name from a security group name that starts
with static.SECURITY_GROUP_PREFIX

Example:
    sg = '@sc-mycluster'
    print get_tag_from_sg(sg)
    mycluster

run_plugin(self, plugin_name, cluster_tag)

source code 

Run a plugin defined in the config.

plugin_name must match the plugin's section name in the config cluster_tag specifies the cluster to run the plugin on