Created
October 26, 2011 14:02
-
-
Save davidrupp/1316455 to your computer and use it in GitHub Desktop.
Find the running Pallet nodes in a group, along with their IP addresses
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Get the running nodes and the their ip addresses for the named group | |
; Need to define: | |
; service - the pallet.compute service on which the nodes are running | |
(defn nodes-in-group | |
[group] | |
(filter | |
#(and (.equals group (pallet.compute/group-name %)) | |
(pallet.compute/running? %)) | |
(pallet.compute/nodes service))) | |
(defn ips-in-group | |
[group] | |
(map | |
#(pallet.compute/primary-ip %) | |
(nodes-in-group group))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment