From d08b359956ad2750a96b2d50b8d8d3195bcaa226 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Tue, 13 Apr 2010 15:37:09 -0700 Subject: [PATCH] adjusted run-node to only return a single node, as its name doesn't imply sequence; added location --- compute/src/main/clojure/org/jclouds/compute.clj | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/compute/src/main/clojure/org/jclouds/compute.clj b/compute/src/main/clojure/org/jclouds/compute.clj index 178a507f51..ba4dbd80c8 100644 --- a/compute/src/main/clojure/org/jclouds/compute.clj +++ b/compute/src/main/clojure/org/jclouds/compute.clj @@ -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)