Sha256: 8457ba9dec140dde18258b978566b30868b59dd8681b1aae1e6d754706da111e

Contents?: true

Size: 851 Bytes

Versions: 47

Compression:

Stored size: 851 Bytes

Contents

#
# Author:: Matt Eldridge (<matt.eldridge@us.ibm.com>)
# © Copyright IBM Corporation 2014.
#
# LICENSE: MIT (http://opensource.org/licenses/MIT)
#
module Fog
  module Compute
    class Softlayer

      class Mock

        def delete_key_pair(id)
          response = Excon::Response.new
          response.status = 200
          if @key_pairs.reject! { |kp| kp['id'] == id }.nil?
            response.status = 404
            response.body = {
              "error" => "Unable to find object with id of '#{id}'.",
              "code" => "SoftLayer_Exception_ObjectNotFound"
            }
          else
            response.body = true
          end
          response
        end
      end

      class Real
        def delete_key_pair(id)
          request(:security_ssh_key, id, :http_method => :delete)
        end
      end

    end
  end
end

Version data entries

47 entries across 45 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-softlayer-1.1.4/lib/fog/softlayer/requests/compute/delete_key_pair.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-softlayer-1.1.4/lib/fog/softlayer/requests/compute/delete_key_pair.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-softlayer-1.1.4/lib/fog/softlayer/requests/compute/delete_key_pair.rb
fog-softlayer-1.1.4 lib/fog/softlayer/requests/compute/delete_key_pair.rb
fog-softlayer-1.1.3 lib/fog/softlayer/requests/compute/delete_key_pair.rb
fog-softlayer-1.1.2 lib/fog/softlayer/requests/compute/delete_key_pair.rb
fog-softlayer-1.1.1 lib/fog/softlayer/requests/compute/delete_key_pair.rb
fog-softlayer-1.1.0 lib/fog/softlayer/requests/compute/delete_key_pair.rb
fog-softlayer-1.0.3 lib/fog/softlayer/requests/compute/delete_key_pair.rb
fog-softlayer-1.0.2 lib/fog/softlayer/requests/compute/delete_key_pair.rb
fog-softlayer-1.0.1 lib/fog/softlayer/requests/compute/delete_key_pair.rb
fog-softlayer-1.0.0 lib/fog/softlayer/requests/compute/delete_key_pair.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-softlayer-0.4.7/lib/fog/softlayer/requests/compute/delete_key_pair.rb
fog-softlayer-0.4.7 lib/fog/softlayer/requests/compute/delete_key_pair.rb
fog-softlayer-0.4.6 lib/fog/softlayer/requests/compute/delete_key_pair.rb
fog-softlayer-0.4.5 lib/fog/softlayer/requests/compute/delete_key_pair.rb
fog-softlayer-0.4.4 lib/fog/softlayer/requests/compute/delete_key_pair.rb
fog-softlayer-0.4.3 lib/fog/softlayer/requests/compute/delete_key_pair.rb
fog-softlayer-0.4.2 lib/fog/softlayer/requests/compute/delete_key_pair.rb
fog-softlayer-0.4.2.pre lib/fog/softlayer/requests/compute/delete_key_pair.rb