Sha256: a52f3dbbec804eb9f8e835e95f9ccf61300a12d89bdd8eb69c39d8e4b918af53

Contents?: true

Size: 1.7 KB

Versions: 76

Compression:

Stored size: 1.7 KB

Contents

# -*- encoding: utf-8 -*-
module Fog
  module Vcloud
    class Compute
      class Real

        def configure_vm_password(vmdata)
          edit_uri = vmdata[:href]
          body = <<EOF
          <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">
<ovf:Info>Specifies Guest OS Customization Settings</ovf:Info>
<Enabled>true</Enabled>
<ChangeSid>false</ChangeSid>
<VirtualMachineId>#{vmdata[:VirtualMachineId]}</VirtualMachineId>
<JoinDomainEnabled>false</JoinDomainEnabled>
<UseOrgSettings>false</UseOrgSettings>
<AdminPasswordEnabled>true</AdminPasswordEnabled>
<AdminPasswordAuto>false</AdminPasswordAuto>
<AdminPassword>#{vmdata[:AdminPassword]}</AdminPassword>
<ResetPasswordRequired>false</ResetPasswordRequired>
<ComputerName>#{vmdata[:ComputerName]}</ComputerName>
<Link rel="edit" type="application/vnd.vmware.vcloud.guestCustomizationSection+xml" href="#{edit_uri}"/>
</GuestCustomizationSection>
EOF
          request(
            :body     => body,
            :expects  => 202,
            :headers  => {'Content-Type' => vmdata[:type] },
            :method   => 'PUT',
            :uri      => "#{edit_uri}",
            :parse    => true
          )
        end

      end

    end
  end
end

Version data entries

76 entries across 76 versions & 11 rubygems

Version Path
fog-1.22.0 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-1.21.0 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-1.20.0 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-1.19.0 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/vcloud/requests/compute/configure_vm_password.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/vcloud/requests/compute/configure_vm_password.rb