Sha256: e1a366b1634e2e6fc1e7ec6e625b15ba5fa8703c8422c7a83a4ce90907e20425

Contents?: true

Size: 911 Bytes

Versions: 7

Compression:

Stored size: 911 Bytes

Contents

require 'fog/compute/models/ecloud/vdc'

module Fog
  module Compute
    class Ecloud

      class Vdcs < Collection

        model Fog::Compute::Ecloud::Vdc

        undef_method :create

        def all
          data = connection.get_organization(organization_uri).body[:Link].select { |link| link[:type] == "application/vnd.vmware.vcloud.vdc+xml" }
          data.each { |link| link.delete_if { |key, value| [:rel].include?(key) } }
          load(data)
        end

        def get(uri)
          if data = connection.get_vdc(uri)
            new(data.body)
          end
        rescue Fog::Errors::NotFound
          nil
        end

        def organization_uri
          @organizatio_uri ||= connection.default_organization_uri
        end

        private

        def organization_uri=(new_organization_uri)
          @organization_uri = new_organization_uri
        end

      end
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
brightbox-cli-0.13.1 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/ecloud/vdcs.rb
brightbox-cli-0.13.0 lib/brightbox-cli/vendor/fog/lib/fog/compute/models/ecloud/vdcs.rb
fog-0.11.0 lib/fog/compute/models/ecloud/vdcs.rb
fog-0.10.0 lib/fog/compute/models/ecloud/vdcs.rb
fog4encbs-0.9.0.1 lib/fog/compute/models/ecloud/vdcs.rb
fog4encbs-0.9.0 lib/fog/compute/models/ecloud/vdcs.rb
fog-0.9.0 lib/fog/compute/models/ecloud/vdcs.rb