Sha256: 1bde7e53b5b7e048a5c3b73a0d1a72b22e6e180dba5890426241060b452b8a78

Contents?: true

Size: 894 Bytes

Versions: 43

Compression:

Stored size: 894 Bytes

Contents

require 'fog/vcloud/models/compute/catalog'

module Fog
  module Vcloud
    class Compute
      class Catalogs < Fog::Vcloud::Collection
        model Fog::Vcloud::Compute::Catalog

        attribute :organization_uri

        def all
          org_uri = self.organization_uri || service.default_organization_uri
          data = service.get_organization(org_uri).links.select { |link| link[:type] == "application/vnd.vmware.vcloud.catalog+xml" }
          load(data)
        end

        def get(uri)
          service.get_catalog(uri)
        rescue Fog::Errors::NotFound
          nil
        end

        def item_by_name(name)
          res = nil
          items = all.map { |catalog| catalog.catalog_items }
          items.each do |i|
            i.map do |ii|
              res = ii if ii.name == name
            end
          end
          res
        end
      end
    end
  end
end

Version data entries

43 entries across 41 versions & 6 rubygems

Version Path
fog-2.3.0 lib/fog/vcloud/models/compute/catalogs.rb
fog-ifeel-2.2.0 lib/fog/vcloud/models/compute/catalogs.rb
fog-2.2.0 lib/fog/vcloud/models/compute/catalogs.rb
fog-2.1.0 lib/fog/vcloud/models/compute/catalogs.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/vcloud/models/compute/catalogs.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/vcloud/models/compute/catalogs.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/vcloud/models/compute/catalogs.rb
fog-1.42.1 lib/fog/vcloud/models/compute/catalogs.rb
fog-2.0.0 lib/fog/vcloud/models/compute/catalogs.rb
fog-1.42.0 lib/fog/vcloud/models/compute/catalogs.rb
fog-1.41.0 lib/fog/vcloud/models/compute/catalogs.rb
fog-1.40.0 lib/fog/vcloud/models/compute/catalogs.rb
fog-1.39.0 lib/fog/vcloud/models/compute/catalogs.rb
fog-1.38.0 lib/fog/vcloud/models/compute/catalogs.rb
fog-1.37.0 lib/fog/vcloud/models/compute/catalogs.rb
fog-1.36.0 lib/fog/vcloud/models/compute/catalogs.rb
fog-1.35.0 lib/fog/vcloud/models/compute/catalogs.rb
fog-2.0.0.pre.0 lib/fog/vcloud/models/compute/catalogs.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/vcloud/models/compute/catalogs.rb
fog-1.34.0 lib/fog/vcloud/models/compute/catalogs.rb