Sha256: a6a878a18da516ae5d5a45fb3e428dda32fdfdb39a872afcb7d5d0e6f20b3aed

Contents?: true

Size: 999 Bytes

Versions: 23

Compression:

Stored size: 999 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

23 entries across 23 versions & 2 rubygems

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