Class: Fog::XenServer::Connection
- Inherits:
-
Object
- Object
- Fog::XenServer::Connection
- Defined in:
- lib/chef/provisioning/fog_driver/providers/xenserver.rb
Instance Attribute Summary collapse
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
Instance Method Summary collapse
Instance Attribute Details
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
207 208 209 |
# File 'lib/chef/provisioning/fog_driver/providers/xenserver.rb', line 207 def credentials @credentials end |
Instance Method Details
#request(options, *params) ⇒ Object
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/chef/provisioning/fog_driver/providers/xenserver.rb', line 209 def request(, *params) parser = .delete(:parser) method = .delete(:method) if params.empty? response = @factory.call_async(method, @credentials) else if params.length.eql?(1) && params.first.is_a?(Hash) response = @factory.call_async(method, @credentials, params.first) elsif params.length.eql?(2) && params.last.is_a?(Array) response = @factory.call_async(method, @credentials, params.first, params.last) else response = eval("@factory.call_async('#{method}', '#{@credentials}', #{params.map { |p| p.is_a?(String) ? "'#{p}'" : p }.join(',')})") end end raise RequestFailed, "#{method}: " + response["ErrorDescription"].to_s unless response["Status"].eql? "Success" if parser parser.parse(response["Value"]) response = parser.response end response end |