mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
add request for linode.config.update
This commit is contained in:
parent
18208f0d95
commit
a21a8d7206
2 changed files with 34 additions and 0 deletions
|
@ -40,6 +40,7 @@ module Fog
|
|||
request :linode_config_list
|
||||
request :linode_config_create
|
||||
request :linode_config_delete
|
||||
request :linode_config_update
|
||||
request :linode_create
|
||||
request :linode_delete
|
||||
request :linode_list
|
||||
|
|
33
lib/fog/linode/requests/compute/linode_config_update.rb
Normal file
33
lib/fog/linode/requests/compute/linode_config_update.rb
Normal file
|
@ -0,0 +1,33 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class Linode
|
||||
class Real
|
||||
# api docs say LinodeID is optional, turns out its required
|
||||
def linode_config_update(linode_id, config_id, options={})
|
||||
request(
|
||||
:expects => 200,
|
||||
:method => 'GET',
|
||||
:query => {
|
||||
:api_action => 'linode.config.update',
|
||||
:configId => config_id,
|
||||
:linodeID => linode_id
|
||||
}.merge!(options)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
class Mock
|
||||
def linode_config_update(linode_id, config_id, options={})
|
||||
response = Excon::Response.new
|
||||
response.status = 200
|
||||
response.body = {
|
||||
"ERRORARRAY" => [],
|
||||
"ACTION" => "linode.config.update",
|
||||
"DATA" => { "ConfigID" => rand(10000..99999) }
|
||||
}
|
||||
response
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue