Sha256: 1aca0c41110ea266a316ec7ff5761265099f4a846e5008b2d6b8041e614c7d23

Contents?: true

Size: 1.34 KB

Versions: 79

Compression:

Stored size: 1.34 KB

Contents

module Fog
  module CDN
    class HP
      class Real

        # List cdn properties for a container
        #
        # ==== Parameters
        # * name<~String> - Name of container to retrieve info for
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * headers<~Hash>:
        #     * 'X-Cdn-Enabled'<~Boolean> - cdn status for container
        #     * 'X-Cdn-Uri'<~String> - cdn url for this container
        #     * 'X-Ttl'<~String> - integer seconds before data expires, defaults to 86400 (1 day)
        #     * 'X-Log-Retention'<~Boolean> - ?
        def head_container(name)
          response = request(
            :expects  => 204,
            :method   => 'HEAD',
            :path     => Fog::HP.escape(name),
            :query    => {'format' => 'json'}
          )
          response
        end

      end

      class Mock # :nodoc:all
        def head_container(name)
          response = Excon::Response.new
          headers = {}
          if data = self.data[:cdn_containers][name]
            data.each do |k,_|
              headers[k] = data[k] if data[k]
            end
            response.headers = headers
            response.status = 204
            response.body = ""
            response
          else
            raise Fog::CDN::HP::NotFound
          end
        end
      end

    end
  end
end

Version data entries

79 entries across 79 versions & 12 rubygems

Version Path
fog-maestrodev-1.18.0.20131209090811 lib/fog/hp/requests/cdn/head_container.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/hp/requests/cdn/head_container.rb
fog-maestrodev-1.18.0.20131205181604 lib/fog/hp/requests/cdn/head_container.rb
fog-maestrodev-1.18.0.20131127194823 lib/fog/hp/requests/cdn/head_container.rb
fog-maestrodev-1.18.0.20131126183714 lib/fog/hp/requests/cdn/head_container.rb
fog-maestrodev-1.18.0.20131126122111 lib/fog/hp/requests/cdn/head_container.rb
fog-maestrodev-1.18.0.20131125111730 lib/fog/hp/requests/cdn/head_container.rb
fog-maestrodev-1.18.0.20131125083406 lib/fog/hp/requests/cdn/head_container.rb
fog-maestrodev-1.18.0.20131123105121 lib/fog/hp/requests/cdn/head_container.rb
fog-maestrodev-1.18.0.20131122203507 lib/fog/hp/requests/cdn/head_container.rb
fog-maestrodev-1.18.0.20131121075022 lib/fog/hp/requests/cdn/head_container.rb
fog-maestrodev-1.18.0.20131118164830 lib/fog/hp/requests/cdn/head_container.rb
fog-maestrodev-1.18.0.20131115184302 lib/fog/hp/requests/cdn/head_container.rb
fog-maestrodev-1.18.0.20131114200144 lib/fog/hp/requests/cdn/head_container.rb
gapinc-fog-1.12.1.2.1 lib/fog/hp/requests/cdn/head_container.rb
fog-maestrodev-1.18.0.20131112185232 lib/fog/hp/requests/cdn/head_container.rb
fog-maestrodev-1.18.0.20131111203459 lib/fog/hp/requests/cdn/head_container.rb
fog-1.18.0 lib/fog/hp/requests/cdn/head_container.rb
fog-1.17.0 lib/fog/hp/requests/cdn/head_container.rb
fog-1.16.0 lib/fog/hp/requests/cdn/head_container.rb