Sha256: 561aa3d545685de05cb5793bf3d8a237dd40cf15cef9e725dc4015cc0b0acc41

Contents?: true

Size: 625 Bytes

Versions: 4

Compression:

Stored size: 625 Bytes

Contents

module Fog
  module Compute
    class Ecloud
      class Real
        basic_request :get_ssh_key
      end

      class Mock
        def get_ssh_key(uri)
          ssh_key_id = id_from_uri(uri).to_i
          ssh_key    = self.data[:ssh_keys][ssh_key_id.to_i]

          if ssh_key
            response(:body => Fog::Ecloud.slice(ssh_key, :id, :admin_organization))
          else
            body = "<Error message=\"Resource Not Found\" majorErrorCode=\"404\" minorErrorCode=\"ResourceNotFound\" />"
            response(:body => body, :expects => 200, :status => 404)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 2 versions & 2 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-ecloud-0.3.0/lib/fog/compute/ecloud/requests/get_ssh_key.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-ecloud-0.3.0/lib/fog/compute/ecloud/requests/get_ssh_key.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-ecloud-0.3.0/lib/fog/compute/ecloud/requests/get_ssh_key.rb
fog-ecloud-0.3.0 lib/fog/compute/ecloud/requests/get_ssh_key.rb