Sha256: bb88219efd2c65e646cf364123b5f6be226df3c12b055f12858e9573d5b6bdc8

Contents?: true

Size: 1.72 KB

Versions: 16

Compression:

Stored size: 1.72 KB

Contents

module Fog
  module Vcloud
    class Compute
      class Vdc < Fog::Vcloud::Model

        identity :href

        ignore_attributes :xmlns, :xmlns_xsi, :xmlns_xsd

        attribute :name
        attribute :type
        attribute :description, :aliases => :Description
        attribute :other_links, :aliases => :Link
        attribute :compute_capacity, :aliases => :ComputeCapacity
        attribute :storage_capacity, :aliases => :StorageCapacity
        attribute :available_networks, :aliases => :AvailableNetworks, :squash => :Network
        attribute :resource_entities, :aliases => :ResourceEntities, :squash => :ResourceEntity
        attribute :deployed_vm_quota
        attribute :instantiated_vm_quota

        def networks
          @networks ||= Fog::Vcloud::Compute::Networks.
            new( :connection => connection,
                 :href => href )
        end

        def servers
          @servers ||= Fog::Vcloud::Compute::Servers.
            new( :connection => connection,
                 :href => href )
        end

        def tasks
          @tasks ||= Fog::Vcloud::Compute::Tasks.
            new( :connection => connection,
                 :href => href + "/tasksList" )
        end

        private

        def collection_based_on_type(type, klass = nil)
          load_unless_loaded!
          test_links = other_links.kind_of?(Array) ? other_links : [other_links]
          if link = test_links.detect { |link| link[:type] == type }
            case type
            when "application/vnd.vmware.vcloud.catalog+xml"
              Fog::Vcloud::Compute::Catalog
            end.new( :connection => connection, :href => link[:href] )
          else
            [ ]
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/vdc.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/vdc.rb
fog_tractical-1.1.4 lib/fog/vcloud/models/compute/vdc.rb
fog_tractical-1.1.3 lib/fog/vcloud/models/compute/vdc.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/vdc.rb
fog-1.1.1 lib/fog/vcloud/models/compute/vdc.rb
fog-1.1.0 lib/fog/vcloud/models/compute/vdc.rb
brightbox-cli-0.15.0 lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/vdc.rb
tag-fog-1.0.1 lib/fog/vcloud/models/compute/vdc.rb
brightbox-cli-0.14.1 lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/vdc.rb
brightbox-cli-0.14.0 lib/brightbox-cli/vendor/fog/lib/fog/vcloud/models/compute/vdc.rb
fog-1.0.0 lib/fog/vcloud/models/compute/vdc.rb
brightbox-cli-0.13.1 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/vcloud/vdc.rb
brightbox-cli-0.13.0 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/vcloud/vdc.rb
fog-0.11.0 lib/fog/compute/models/vcloud/vdc.rb
fog-0.10.0 lib/fog/compute/models/vcloud/vdc.rb