adjusted run-node to only return a single node, as its name doesn't imply sequence; added location

This commit is contained in:
Adrian Cole 2010-04-13 15:37:09 -07:00
parent 69ddfb38ca
commit d08b359956
1 changed files with 9 additions and 4 deletions

View File

@ -174,13 +174,13 @@ See http://code.google.com/p/jclouds for details."
"
([tag]
(run-nodes tag 1 (default-template *compute*) *compute*))
(first (run-nodes tag 1 (default-template *compute*) *compute*)))
([tag compute-or-template]
(if (compute-service? compute-or-template)
(run-nodes tag 1 (default-template compute-or-template) compute-or-template)
(run-nodes tag 1 compute-or-template *compute*)))
(first (run-nodes tag 1 (default-template compute-or-template) compute-or-template))
(first (run-nodes tag 1 compute-or-template *compute*))))
([tag template compute]
(run-nodes tag 1 template compute)))
(first (run-nodes tag 1 template compute))))
(defn #^NodeMetadata node-details
"Retrieve the node metadata."
@ -266,6 +266,11 @@ See http://code.google.com/p/jclouds for details."
[#^ComputeMetadata node]
(.getName node))
(defn location
"Returns the compute node's location id"
[#^ComputeMetadata node]
(.getLocationId node))
(define-accessors Template image size location options)
(define-accessors Image version os-family os-description architecture)
(define-accessors Size cores ram disk)