<?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>valid_credentials? (Deltacloud::Drivers::Gogrid::GogridDriver)</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/gogrid/gogrid_driver.rb, line 319</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">valid_credentials?</span>(<span class="ruby-identifier">credentials</span>) <span class="ruby-identifier">client</span> = <span class="ruby-identifier">new_client</span>(<span class="ruby-identifier">credentials</span>) <span class="ruby-comment cmt"># FIXME: We need to do this call to determine if</span> <span class="ruby-comment cmt"># GoGrid is working with given credentials. There is no</span> <span class="ruby-comment cmt"># other way to check, if given credentials are valid or not.</span> <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">new_client</span>(<span class="ruby-identifier">credentials</span>).<span class="ruby-identifier">request</span>(<span class="ruby-value str">'common/lookup/list'</span>, { <span class="ruby-value str">'lookup'</span> =<span class="ruby-operator">></span> <span class="ruby-value str">'ip.datacenter'</span> }) <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">end</span></pre> </body> </html>