mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
42 lines
943 B
Ruby
42 lines
943 B
Ruby
module Fog
|
|
module Dynect
|
|
class DNS
|
|
class Real
|
|
|
|
require 'fog/dns/parsers/dynect/session'
|
|
|
|
def session
|
|
builder = Builder::XmlMarkup.new
|
|
xml = builder.parameters do |root|
|
|
root.customer_name(@dynect_customer)
|
|
root.user_name( @dynect_username)
|
|
root.password(@dynect_password)
|
|
end
|
|
|
|
request(
|
|
:parser => Fog::Parsers::Dynect::DNS::Session.new,
|
|
:expects => 200,
|
|
:method => "POST",
|
|
:path => "Session",
|
|
:body => xml
|
|
)
|
|
end
|
|
end
|
|
|
|
class Mock
|
|
|
|
def session
|
|
response = Excon::Response.new
|
|
response.status = 200
|
|
response.body = {
|
|
'API-Version' => '2.3.1',
|
|
'API-Token' => 'thetoken=='
|
|
}
|
|
response
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|