<?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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Module: DeltacloudTestCommon</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" /> <script type="text/javascript"> // <![CDATA[ function popupCode( url ) { window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") } function toggleCode( id ) { if ( document.getElementById ) elem = document.getElementById( id ); else if ( document.all ) elem = eval( "document.all." + id ); else return false; elemStyle = elem.style; if ( elemStyle.display != "block" ) { elemStyle.display = "block" } else { elemStyle.display = "none" } return true; } // Make codeblocks hidden by default document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) // ]]> </script> </head> <body> <div id="classHeader"> <table class="header-table"> <tr class="top-aligned-row"> <td><strong>Module</strong></td> <td class="class-name-in-header">DeltacloudTestCommon</td> </tr> <tr class="top-aligned-row"> <td><strong>In:</strong></td> <td> <a href="../files/tests/common_rb.html"> tests/common.rb </a> <br /> </td> </tr> </table> </div> <!-- banner header --> <div id="bodyContent"> <div id="contextContent"> </div> <div id="method-list"> <h3 class="section-bar">Methods</h3> <div class="name-list"> <a href="#M000249">accept</a> <a href="#M000258">add_created_instance</a> <a href="#M000248">authenticate</a> <a href="#M000253">delete_url</a> <a href="#M000251">get_auth_url</a> <a href="#M000250">get_url</a> <a href="#M000255">last_xml_response</a> <a href="#M000252">post_url</a> <a href="#M000254">put_url</a> <a href="#M000247">record!</a> <a href="#M000246">recording?</a> <a href="#M000256">require_authentication?</a> <a href="#M000257">with_provider</a> </div> </div> </div> <!-- if includes --> <div id="section"> <!-- if method_list --> <div id="methods"> <h3 class="section-bar">Public Instance methods</h3> <div id="method-M000249" class="method-detail"> <a name="M000249"></a> <div class="method-heading"> <a href="DeltacloudTestCommon.src/M000249.html" target="Code" class="method-signature" onclick="popupCode('DeltacloudTestCommon.src/M000249.html');return false;"> <span class="method-name">accept</span><span class="method-args">(format=:xml)</span> </a> </div> <div class="method-description"> <p> HTTP Accept header helper. Will set appropriate value for this header. Available options for format are: :json, :html or :xml By default :xml is used </p> </div> </div> <div id="method-M000258" class="method-detail"> <a name="M000258"></a> <div class="method-heading"> <a href="DeltacloudTestCommon.src/M000258.html" target="Code" class="method-signature" onclick="popupCode('DeltacloudTestCommon.src/M000258.html');return false;"> <span class="method-name">add_created_instance</span><span class="method-args">(id)</span> </a> </div> <div class="method-description"> </div> </div> <div id="method-M000248" class="method-detail"> <a name="M000248"></a> <div class="method-heading"> <a href="DeltacloudTestCommon.src/M000248.html" target="Code" class="method-signature" onclick="popupCode('DeltacloudTestCommon.src/M000248.html');return false;"> <span class="method-name">authenticate</span><span class="method-args">(opts={})</span> </a> </div> <div class="method-description"> <p> Authentication helper for Basic HTTP authentication To change default user credentials stored in ENV[‘API_USER|PASSWORD’] you need to set opts[:credentials] = { :user => ’…’, :password => ’…’} </p> </div> </div> <div id="method-M000253" class="method-detail"> <a name="M000253"></a> <div class="method-heading"> <a href="DeltacloudTestCommon.src/M000253.html" target="Code" class="method-signature" onclick="popupCode('DeltacloudTestCommon.src/M000253.html');return false;"> <span class="method-name">delete_url</span><span class="method-args">(uri, params={}, opts={})</span> </a> </div> <div class="method-description"> </div> </div> <div id="method-M000251" class="method-detail"> <a name="M000251"></a> <div class="method-heading"> <a href="DeltacloudTestCommon.src/M000251.html" target="Code" class="method-signature" onclick="popupCode('DeltacloudTestCommon.src/M000251.html');return false;"> <span class="method-name">get_auth_url</span><span class="method-args">(uri, params={}, opts={})</span> </a> </div> <div class="method-description"> </div> </div> <div id="method-M000250" class="method-detail"> <a name="M000250"></a> <div class="method-heading"> <a href="DeltacloudTestCommon.src/M000250.html" target="Code" class="method-signature" onclick="popupCode('DeltacloudTestCommon.src/M000250.html');return false;"> <span class="method-name">get_url</span><span class="method-args">(uri, params={}, opts={})</span> </a> </div> <div class="method-description"> <p> This helper will execute GET operation on given URI. You can set additional parameters using params <a href="Hash.html">Hash</a>, which will be passed to request. You can change format used for communication using opts[:format] = :xml | :html :json You can turn on recording (you need to configure it first in setup.rb) using opts[:record] (true/false) You can force authentication using opts[:auth] parameter or use ‘<a href="DeltacloudTestCommon.html#M000251">get_auth_url</a>’ which will do it for you ;-) </p> </div> </div> <div id="method-M000255" class="method-detail"> <a name="M000255"></a> <div class="method-heading"> <a href="DeltacloudTestCommon.src/M000255.html" target="Code" class="method-signature" onclick="popupCode('DeltacloudTestCommon.src/M000255.html');return false;"> <span class="method-name">last_xml_response</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> This helper will automatically convert output from method above to Nokogiri XML object </p> </div> </div> <div id="method-M000252" class="method-detail"> <a name="M000252"></a> <div class="method-heading"> <a href="DeltacloudTestCommon.src/M000252.html" target="Code" class="method-signature" onclick="popupCode('DeltacloudTestCommon.src/M000252.html');return false;"> <span class="method-name">post_url</span><span class="method-args">(uri, params={}, opts={})</span> </a> </div> <div class="method-description"> </div> </div> <div id="method-M000254" class="method-detail"> <a name="M000254"></a> <div class="method-heading"> <a href="DeltacloudTestCommon.src/M000254.html" target="Code" class="method-signature" onclick="popupCode('DeltacloudTestCommon.src/M000254.html');return false;"> <span class="method-name">put_url</span><span class="method-args">(uri, params={}, opts={})</span> </a> </div> <div class="method-description"> </div> </div> <div id="method-M000247" class="method-detail"> <a name="M000247"></a> <div class="method-heading"> <a href="DeltacloudTestCommon.src/M000247.html" target="Code" class="method-signature" onclick="popupCode('DeltacloudTestCommon.src/M000247.html');return false;"> <span class="method-name">record!</span><span class="method-args">()</span> </a> </div> <div class="method-description"> </div> </div> <div id="method-M000246" class="method-detail"> <a name="M000246"></a> <div class="method-heading"> <a href="DeltacloudTestCommon.src/M000246.html" target="Code" class="method-signature" onclick="popupCode('DeltacloudTestCommon.src/M000246.html');return false;"> <span class="method-name">recording?</span><span class="method-args">()</span> </a> </div> <div class="method-description"> </div> </div> <div id="method-M000256" class="method-detail"> <a name="M000256"></a> <div class="method-heading"> <a href="DeltacloudTestCommon.src/M000256.html" target="Code" class="method-signature" onclick="popupCode('DeltacloudTestCommon.src/M000256.html');return false;"> <span class="method-name">require_authentication?</span><span class="method-args">(uri)</span> </a> </div> <div class="method-description"> <p> Check if given URI require authentication </p> </div> </div> <div id="method-M000257" class="method-detail"> <a name="M000257"></a> <div class="method-heading"> <a href="DeltacloudTestCommon.src/M000257.html" target="Code" class="method-signature" onclick="popupCode('DeltacloudTestCommon.src/M000257.html');return false;"> <span class="method-name">with_provider</span><span class="method-args">(new_provider) {|| ...}</span> </a> </div> <div class="method-description"> </div> </div> </div> </div> <div id="validator-badges"> <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> </div> </body> </html>