7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/fog/vcloud/requests/compute/configure_vm_password.rb', line 7
def configure_vm_password(vmdata)
edit_uri = vmdata[:href]
body = " <GuestCustomizationSection xmlns=\"http://www.vmware.com/vcloud/v1.5\" xmlns:ovf=\"http://schemas.dmtf.org/ovf/envelope/1\" type=\"application/vnd.vmware.vcloud.guestCustomizationSection+xml\" href=\"https://zone01.bluelock.com/api/vApp/vm-cc8e27be-f18c-4263-87c5-58a9297bac5b/guestCustomizationSection/\" ovf:required=\"false\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://schemas.dmtf.org/ovf/envelope/1 http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd http://www.vmware.com/vcloud/v1.5 http://zone01.bluelock.com/api/v1.5/schema/master.xsd\">\n<ovf:Info>Specifies Guest OS Customization Settings</ovf:Info>\n<Enabled>true</Enabled>\n<ChangeSid>false</ChangeSid>\n<VirtualMachineId>\#{vmdata[:VirtualMachineId]}</VirtualMachineId>\n<JoinDomainEnabled>false</JoinDomainEnabled>\n<UseOrgSettings>false</UseOrgSettings>\n<AdminPasswordEnabled>true</AdminPasswordEnabled>\n<AdminPasswordAuto>false</AdminPasswordAuto>\n<AdminPassword>\#{vmdata[:AdminPassword]}</AdminPassword>\n<ResetPasswordRequired>false</ResetPasswordRequired>\n<ComputerName>\#{vmdata[:ComputerName]}</ComputerName>\n<Link rel=\"edit\" type=\"application/vnd.vmware.vcloud.guestCustomizationSection+xml\" href=\"\#{edit_uri}\"/>\n</GuestCustomizationSection>\n"
request(
:body => body,
:expects => 202,
:headers => {'Content-Type' => vmdata[:type] },
:method => 'PUT',
:uri => "#{edit_uri}",
:parse => true
)
end
|