Skip to content

Instantly share code, notes, and snippets.

@hugoduncan
Created October 15, 2010 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hugoduncan/628802 to your computer and use it in GitHub Desktop.
Save hugoduncan/628802 to your computer and use it in GitHub Desktop.
A ComputeService with fixed list of nodes
(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