2011-03-04 15:03:51 -05:00
|
|
|
module Fog
|
2011-06-16 19:28:54 -04:00
|
|
|
module Compute
|
|
|
|
class Linode
|
2011-03-04 15:03:51 -05:00
|
|
|
class Real
|
2011-06-16 19:28:54 -04:00
|
|
|
|
2011-03-04 15:03:51 -05:00
|
|
|
def linode_shutdown(linode_id)
|
|
|
|
request(
|
|
|
|
:expects => 200,
|
|
|
|
:method => 'GET',
|
|
|
|
:query => { :api_action => 'linode.shutdown', :linodeId => linode_id }
|
|
|
|
)
|
|
|
|
end
|
2011-06-16 19:28:54 -04:00
|
|
|
|
2011-03-04 15:03:51 -05:00
|
|
|
end
|
2012-05-17 14:31:15 -04:00
|
|
|
|
|
|
|
class Mock
|
|
|
|
def linode_shutdown(linode_id)
|
|
|
|
response = Excon::Response.new
|
|
|
|
response.status = 200
|
|
|
|
response.body = {
|
|
|
|
"ERRORARRAY" => [],
|
|
|
|
"ACTION" => "linode.shutdown",
|
|
|
|
"DATA" => { "JobID" => rand(1000..9999) }
|
|
|
|
}
|
|
|
|
response
|
|
|
|
end
|
|
|
|
end
|
2011-03-04 15:03:51 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|