5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/fog/vcloud/requests/compute/undeploy.rb', line 5
def undeploy(vapp_uri, save_state = false)
builder = if version =='1.0'
"<UndeployVAppParams saveState=\"#{save_state.to_s}\" xmlns=\"http://www.vmware.com/vcloud/v1\"/>"
else
<<EOF
<UndeployVAppParams xmlns="http://www.vmware.com/vcloud/v1.5">
<UndeployPowerAction>shutdown</UndeployPowerAction>
</UndeployVAppParams>
EOF
end
request(
:body => builder,
:expects => 202,
:headers => {'Content-Type' => 'application/vnd.vmware.vcloud.undeployVAppParams+xml' },
:method => 'POST',
:uri => vapp_uri + '/action/undeploy',
:parse => true
)
end
|