Sha256: 833fae147bfafe2677986e4ab7366bfd396821e49a4a632e1a9fa7834a4099df

Contents?: true

Size: 1.88 KB

Versions: 55

Compression:

Stored size: 1.88 KB

Contents

module Fog
  module Compute
    class VcloudDirector
      class Real
        # Retrieve the operating system section of a VM.
        #
        # @param [String] id The object identifier of the VM.
        # @return [Excon::Response]
        #   * body<~Hash>:
        #
        # @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/operations/GET-OperatingSystemSection.html
        # @since vCloud API version 0.9
        def get_operating_system_section(id)
          request(
            :expects    => 200,
            :idempotent => true,
            :method     => 'GET',
            :parser     => Fog::ToHashDocument.new,
            :path       => "vApp/#{id}/operatingSystemSection/"
          )
        end
      end

      class Mock

        def get_operating_system_section(id)

          type = 'application/vnd.vmware.vcloud.operatingSystemSection+xml'

          unless vm = data[:vms][id]
            raise Fog::Compute::VcloudDirector::Forbidden.new(
              'This operation is denied.'
            )
          end

          Excon::Response.new(
            :status => 200,
            :headers => {'Content-Type' => "#{type};version=#{api_version}"},
            :body => get_vm_operating_system_section_body(id, vm)
          )

        end

        def get_vm_operating_system_section_body(id, vm)
          {
            :xmlns_ns12=>"http://www.vmware.com/vcloud/v1.5",
            :ovf_id => "94", # TODO: What is this?
            :ns12_href => make_href("vApp/#{id}/operatingSystemSection/"),
            :ns12_type => "application/vnd.vmware.vcloud.operatingSystemSection+xml",
            :vmw_osType => vm[:guest_os_type], # eg "ubuntu64Guest"
            :"ovf:Info"=>"Specifies the operating system installed",
            :"ovf:Description"=> vm[:guest_os_description], # eg "Ubuntu Linux (64-bit)",
          }
        end

      end
    end
  end
end

Version data entries

55 entries across 53 versions & 7 rubygems

Version Path
fog-2.3.0 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
fog-ifeel-2.2.0 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
fog-2.2.0 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
fog-2.1.0 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
fog-1.42.1 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
fog-vcloud-director-0.2.2 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
fog-vcloud-director-0.2.1 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
fog-vcloud-director-0.2.0 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
fog-vcloud-director-0.1.10 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
fog-vcloud-director-0.1.9 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
fog-2.0.0 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
fog-1.42.0 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
fog-1.41.0 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
fog-1.40.0 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
fog-1.39.0 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
fog-vcloud-director-0.1.8 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb
fog-vcloud-director-0.1.7 lib/fog/vcloud_director/requests/compute/get_operating_system_section.rb