2011-07-14 19:22:43 -05:00
|
|
|
module Fog
|
|
|
|
module DNS
|
|
|
|
class Dynect
|
|
|
|
class Real
|
|
|
|
|
|
|
|
def post_session
|
|
|
|
request(
|
|
|
|
:expects => 200,
|
2012-05-28 16:20:29 +02:00
|
|
|
:idempotent => true,
|
2011-07-14 19:22:43 -05:00
|
|
|
:method => :post,
|
|
|
|
:path => "Session",
|
2012-04-25 10:31:28 -04:00
|
|
|
:body => Fog::JSON.encode({
|
2011-07-14 19:22:43 -05:00
|
|
|
:customer_name => @dynect_customer,
|
|
|
|
:user_name => @dynect_username,
|
|
|
|
:password => @dynect_password
|
|
|
|
})
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Mock
|
|
|
|
def post_session
|
|
|
|
response = Excon::Response.new
|
|
|
|
response.status = 200
|
|
|
|
response.body = {
|
2011-08-29 16:04:13 -07:00
|
|
|
"status" => "success",
|
|
|
|
"data" => {
|
|
|
|
"token" => auth_token,
|
|
|
|
"version" => Fog::Dynect::Mock.version
|
|
|
|
},
|
|
|
|
"job_id" => Fog::Dynect::Mock.job_id,
|
|
|
|
"msgs"=>[{
|
|
|
|
"INFO"=>"login: Login successful",
|
|
|
|
"SOURCE"=>"BLL",
|
|
|
|
"ERR_CD"=>nil,
|
|
|
|
"LVL"=>"INFO"
|
|
|
|
}]
|
2011-07-14 19:22:43 -05:00
|
|
|
}
|
|
|
|
response
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|