Sha256: e3635101617d252fbf6d51b9ad1517c1e3c3bac1ca46d2a6d3f83105915826ce

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

module Fog
  module Compute
    class OneAndOne

      class Real

        ##
        # Returns information about an ISO image
        # URL: [https://cloudpanel-api.1and1.com/documentation/1and1/v1/en/documentation.html#dvd_isos__id__get]
        ##
        def get_dvd_iso(dvd_id)
          
          params = {
            'method' => :get,
            'endpoint' => "/dvd_isos/#{dvd_id}"
          }

          request(params)

        end

      end # Real

      
      class Mock

        def get_dvd_iso(dvd_id)
          
          # Search for dvd to return
          if dvd = self.data[:dvd_isos].find {
            |hash| hash['id'] == dvd_id
          }
          else
            raise Fog::Errors::NotFound.new('The requested resource could
              not be found.')
          end

          # Return Response Object to User
          response = Excon::Response.new
          response.status = 200
          response.body = dvd
          response

        end

      end # Mock

    end # OneAndOne
  end # Compute
end # Fog

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-oneandone-1.2 lib/oneandone/requests/compute/get_dvd_iso.rb
fog-oneandone-1.0 lib/oneandone/requests/compute/get_dvd_iso.rb