Sha256: 32255dc6ead62400c8554b96a4e278f255c3999c966c7fd86d044b289053e982

Contents?: true

Size: 998 Bytes

Versions: 57

Compression:

Stored size: 998 Bytes

Contents

module Fog
  module Generators
    module Compute
      module VcloudDirector
        # @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/types/VmType.html
        class Vm
          attr_reader :attrs

          def initialize(attrs={})
            @attrs = attrs
          end

          def generate_xml
            attrs = @attrs
            Nokogiri::XML::Builder.new do
              Vm('xmlns' => 'http://www.vmware.com/vcloud/v1.5', 'name' => attrs[:name]) {
                Description attrs[:Description] if attrs.key?(:Description)
                if  attrs.key?(:StorageProfile)
                  StorageProfile(
                    'type' => 'application/vnd.vmware.vcloud.vdcStorageProfile+xml',
                    'name' => attrs[:StorageProfile][:name],
                    'href' => attrs[:StorageProfile][:href]
                  )
                end
              }
            end.to_xml
          end
        end
      end
    end
  end
end

Version data entries

57 entries across 55 versions & 7 rubygems

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