Sha256: c24e3f08034be528d981c879c08bf6b9d941765adb17f809865c59d0916f154a

Contents?: true

Size: 835 Bytes

Versions: 29

Compression:

Stored size: 835 Bytes

Contents

module Fog
  module Compute
    class HPV2
      class Real
        # Delete a keypair
        #
        # ==== Parameters
        # * 'key_name'<~String> - Name of the keypair to delete
        #
        def delete_key_pair(key_name)
          request(
            :expects  => 202,
            :method   => 'DELETE',
            :path     => "os-keypairs/#{key_name}"
          )
        end
      end

      class Mock
        def delete_key_pair(key_name)
          response = Excon::Response.new
          if self.data[:key_pairs][key_name]
            self.data[:last_modified][:key_pairs].delete(key_name)
            self.data[:key_pairs].delete(key_name)
            response.status = 202
            response
          else
            raise Fog::Compute::HPV2::NotFound
          end
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 4 rubygems

Version Path
fog-1.37.0 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
fog-1.36.0 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
fog-1.35.0 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
fog-2.0.0.pre.0 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/hp/requests/compute_v2/delete_key_pair.rb
fog-1.34.0 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
fog-1.33.0 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
fog-1.32.0 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
fog-1.31.0 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/hp/requests/compute_v2/delete_key_pair.rb
fog-1.30.0 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
fog-1.29.0 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
fog-1.28.0 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
fog-1.27.0 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
fog-1.26.0 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
fog-1.25.0 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
nsidc-fog-1.24.1 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
fog-1.24.0 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
ns-fog-1.22.11 lib/fog/hp/requests/compute_v2/delete_key_pair.rb
ns-fog-1.22.10 lib/fog/hp/requests/compute_v2/delete_key_pair.rb