Created
October 15, 2010 19:40
-
-
Save hugoduncan/628802 to your computer and use it in GitHub Desktop.
A ComputeService with fixed list of nodes
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
(ns pallet.compute.node-list-compute-service | |
"A jclouds compute service using a node list" | |
(:import org.jclouds.compute.ComputeService)) | |
(defrecord NodeListComputeService | |
[node-list] | |
org.jclouds.compute.ComputeService | |
(listNodes [_] node-list) | |
(getNodeMetadata | |
[_ id] | |
(some #(= (.getId %) id) node-list)) | |
(listNodesDetailsMatching | |
[_ predicate] | |
(filter #(.apply predicate %) node-list))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment