StarCluster - Mailing List Archive

Re: Acquire the private IP via Starcluster as API

From: Håvard Wahl Kongsgård <no email>
Date: Thu, 7 Jun 2012 10:23:44 +0200

Thanks!

-håvard

On Wed, Jun 6, 2012 at 5:31 PM, Justin Riley <jtriley_at_mit.edu> wrote:
> Hi Håvard,
>
> My apologies for the lack of documentation for the API - it's a major
> item on the todo list. For now here's a rough overview to print all of
> the private ip addresses for all nodes in a cluster:
>
> ============================================================
> from starcluster import config
> from starcluster import cluster
>
> # Load the config
> cfg = config.StarClusterConfig().load()
> # Create a cluster "manager" object
> cm = cluster.ClusterManager(cfg)
> # Fetch an active cluster
> cl = cm.get_cluster('mycluster')
> # Iterate through the nodes and print the private ip address
> for node in cl.nodes:
>    print "%s: %s" % (node.alias, node.private_ip_address)
> ============================================================
>
> You can also fetch a specific node by name:
>
> node = cl.get_node_by_alias('node003')
>
> or by instance id:
>
> node = cl.get_node_by_id('i-99999')
>
> or by the instance's dns name:
>
> node = cl.get_node_by_id('ec2-blahblah.amazonaws.com')
>
> Hope that helps,
>
> ~Justin
>
> On Mon, Jun 04, 2012 at 02:34:51PM +0200, Håvard Wahl Kongsgård wrote:
>> Hi, I'am looking for a way to acquire the private IP's for current
>> instances via the Starcluster API. There is not much documentation for
>> how to use the Starcluster API, can anyone guide me in the right
>> direction?
>>
>> --
>> Håvard Wahl Kongsgård
>> Faculty of Medicine &
>> Department of Mathematical Sciences
>> NTNU
>>
>> http://havard.security-review.net/
>>
>> _______________________________________________
>> StarCluster mailing list
>> StarCluster_at_mit.edu
>> http://mailman.mit.edu/mailman/listinfo/starcluster



-- 
Håvard Wahl Kongsgård
NTNU
http://havard.security-review.net/
Received on Thu Jun 07 2012 - 04:23:45 EDT
This archive was generated by hypermail 2.3.0.

Search:

Sort all by:

Date

Month

Thread

Author

Subject