Sha256: f2f7f198b68f2edf5088f71fb001504d0165f94b21c5ece4b4ffc6f010f413d0

Contents?: true

Size: 1.46 KB

Versions: 32

Compression:

Stored size: 1.46 KB

Contents

module Fog
  module Compute
    class Ecloud

      class Real
        basic_request :get_catalog_item
      end

      class Mock

        #
        # Based on
        # http://support.theenterprisecloud.com/kb/default.asp?id=542&Lang=1&SID=
        #

        def get_catalog_item(catalog_item_uri)
          if catalog_item = mock_data.catalog_item_from_href(catalog_item_uri)
            builder = Builder::XmlMarkup.new

            xml = builder.CatalogItem(xmlns.merge(:href => catalog_item.href, :name => catalog_item.name)) do
              builder.Link(
                           :rel => "down",
                           :href => catalog_item.customization.href,
                           :type => "application/vnd.tmrk.ecloud.catalogItemCustomizationParameters+xml",
                           :name => catalog_item.customization.name
                           )

              builder.Entity(
                             :href => catalog_item.vapp_template.href,
                             :type => "application/vnd.vmware.vcloud.vAppTemplate+xml",
                             :name => catalog_item.vapp_template.name
                             )

              builder.Property(0, :key => "LicensingCost")
            end
          end

          if xml
            mock_it 200, xml, {'Content-Type' => 'application/vnd.vmware.vcloud.catalogItem+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_item.rb
michiels-fog-1.3.1 lib/fog/ecloud/requests/compute/get_catalog_item.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/ecloud/requests/compute/get_catalog_item.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog_item.rb
fog-1.3.1 lib/fog/ecloud/requests/compute/get_catalog_item.rb
fog-1.3.0 lib/fog/ecloud/requests/compute/get_catalog_item.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog_item.rb
fog-1.2.0 lib/fog/ecloud/requests/compute/get_catalog_item.rb
ktheory-fog-1.1.2 lib/fog/ecloud/requests/compute/get_catalog_item.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog_item.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog_item.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog_item.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog_item.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog_item.rb
fog-1.1.2 lib/fog/ecloud/requests/compute/get_catalog_item.rb
fog_tractical-1.1.4 lib/fog/ecloud/requests/compute/get_catalog_item.rb
fog_tractical-1.1.3 lib/fog/ecloud/requests/compute/get_catalog_item.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/ecloud/requests/compute/get_catalog_item.rb
fog-1.1.1 lib/fog/ecloud/requests/compute/get_catalog_item.rb
fog-1.1.0 lib/fog/ecloud/requests/compute/get_catalog_item.rb