mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[compute|vcloud] move vcloud compute to its own shared area (namespacing should probably be corrected)
This commit is contained in:
parent
0cc2609f93
commit
d6f9fb4c35
49 changed files with 10 additions and 9 deletions
38
lib/fog/vcloud/requests/compute/configure_node.rb
Normal file
38
lib/fog/vcloud/requests/compute/configure_node.rb
Normal file
|
@ -0,0 +1,38 @@
|
|||
module Fog
|
||||
module Vcloud
|
||||
class Compute
|
||||
module Shared
|
||||
private
|
||||
|
||||
def generate_configure_node_request(node_data)
|
||||
builder = Builder::XmlMarkup.new
|
||||
builder.NodeService(:"xmlns:i" => "http://www.w3.org/2001/XMLSchema-instance",
|
||||
:xmlns => "urn:tmrk:eCloudExtensions-2.0") {
|
||||
builder.Name(node_data[:name])
|
||||
builder.Enabled(node_data[:enabled].to_s)
|
||||
builder.Description(node_data[:description])
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class Real
|
||||
include Shared
|
||||
|
||||
def configure_node(node_uri, node_data)
|
||||
validate_node_data(node_data, true)
|
||||
|
||||
request(
|
||||
:body => generate_configure_node_request(node_data),
|
||||
:expects => 200,
|
||||
:headers => {'Content-Type' => 'application/vnd.vmware.vcloud.nodeService+xml'},
|
||||
:method => 'PUT',
|
||||
:uri => node_uri,
|
||||
:parse => true
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue