Sha256: 8456050e76cd770016d1aafe66997fd31c76f9920eed26687772fb37e12d3780

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

module Fog
  module Compute
    class OneAndOne
      class Real
        ##
        # Returns a list of images available for recovering purposes
        # URL: [https://cloudpanel-api.1and1.com/documentation/1and1/v1/en/documentation.html#]
        ##
        def list_recovery_appliances(page: nil, per_page: nil, sort: nil, q: nil,
          fields: nil)

          # Build hash for query parameters
          keyword_args = {
            :page => page,
            :per_page => per_page,
            :sort => sort,
            :q => q,
            :fields => fields
          }

          # Clean out null query parameters
          query = clean_hash(keyword_args)

          # Request
          params = {
            'method' => :get,
            'endpoint' => '/recovery_appliances',
            'params' => query
          }

          request(params)
        end
      end # Real
      
      class Mock
        def list_recovery_appliances(page: nil, per_page: nil, sort: nil, q: nil,
          fields: nil)
          
          response = Excon::Response.new
          response.status = 200
          response.body = self.data[:recovery_appliances]
          response
        end
      end # Mock
    end # OneAndOne
  end # Compute
end # Fog

Version data entries

1 entries across 1 versions & 1 rubygems

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