Sha256: 513e0275e729d5a54e3737935a4ff197c8a59056001fb8532e2be15dede46022

Contents?: true

Size: 1.34 KB

Versions: 32

Compression:

Stored size: 1.34 KB

Contents

module Fog
  module Compute
    class Ecloud

      class Real
        basic_request :get_catalog
      end

      class Mock
        def get_catalog(catalog_uri)
          catalog_uri = ensure_unparsed(catalog_uri)
          xml = nil

          if catalog = mock_data.catalog_from_href(catalog_uri)
            builder = Builder::XmlMarkup.new

            xml = builder.Catalog(xmlns.merge(
                                              :type => "application/vnd.vmware.vcloud.catalog+xml",
                                              :href => catalog.href,
                                              :name => catalog.name
                                  )) do |xml|
              xml.CatalogItems do |xml|
                catalog.items.each do |catalog_item|
                  xml.CatalogItem(
                                  :type => "application/vnd.vmware.vcloud.catalogItem+xml",
                                  :href => catalog_item.href,
                                  :name => catalog_item.name
                                  )
                end
              end
            end
          end

          if xml
            mock_it 200,
              xml, { 'Content-Type' => 'application/vnd.vmware.vcloud.catalog+xml' }
          else
            mock_error 200, "401 Unauthorized"
          end
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 8 rubygems

Version Path
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog.rb
michiels-fog-1.3.1 lib/fog/ecloud/requests/compute/get_catalog.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/ecloud/requests/compute/get_catalog.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog.rb
fog-1.3.1 lib/fog/ecloud/requests/compute/get_catalog.rb
fog-1.3.0 lib/fog/ecloud/requests/compute/get_catalog.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog.rb
fog-1.2.0 lib/fog/ecloud/requests/compute/get_catalog.rb
ktheory-fog-1.1.2 lib/fog/ecloud/requests/compute/get_catalog.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog.rb
fog-1.1.2 lib/fog/ecloud/requests/compute/get_catalog.rb
fog_tractical-1.1.4 lib/fog/ecloud/requests/compute/get_catalog.rb
fog_tractical-1.1.3 lib/fog/ecloud/requests/compute/get_catalog.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog.rb
fog-1.1.1 lib/fog/ecloud/requests/compute/get_catalog.rb
fog-1.1.0 lib/fog/ecloud/requests/compute/get_catalog.rb