<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>images (Deltacloud::Drivers::SBC::SBCDriver)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../../../../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> <pre><span class="ruby-comment cmt"># File lib/deltacloud/drivers/sbc/sbc_driver.rb, line 32</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">images</span>(<span class="ruby-identifier">credentials</span>, <span class="ruby-identifier">opts</span>={}) <span class="ruby-identifier">sbc_client</span> = <span class="ruby-identifier">new_client</span>(<span class="ruby-identifier">credentials</span>) <span class="ruby-identifier">opts</span> <span class="ruby-operator">||=</span> {} <span class="ruby-identifier">images</span> = [] <span class="ruby-identifier">images</span> = <span class="ruby-identifier">sbc_client</span>.<span class="ruby-identifier">list_images</span>(<span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:id</span>]).<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">image</span><span class="ruby-operator">|</span> <span class="ruby-comment cmt"># Cache image for create_instance; hwp is image-specific. In the</span> <span class="ruby-comment cmt"># current flow of the server, images is always called before a</span> <span class="ruby-comment cmt"># create_instance, making this caching profitable</span> <span class="ruby-ivar">@last_image</span> = <span class="ruby-identifier">image</span> <span class="ruby-identifier">convert_image</span>(<span class="ruby-identifier">image</span>) <span class="ruby-keyword kw">end</span> <span class="ruby-identifier">images</span> = <span class="ruby-identifier">filter_on</span>(<span class="ruby-identifier">images</span>, <span class="ruby-identifier">:architecture</span>, <span class="ruby-identifier">opts</span>) <span class="ruby-identifier">images</span> = <span class="ruby-identifier">filter_on</span>(<span class="ruby-identifier">images</span>, <span class="ruby-identifier">:owner_id</span>, <span class="ruby-identifier">opts</span>) <span class="ruby-identifier">images</span> <span class="ruby-keyword kw">end</span></pre> </body> </html>