Sha256: c8be5368e92b214a94c7dea05c3b68456fcd7645f6f50edd867129b3e03bb332

Contents?: true

Size: 694 Bytes

Versions: 29

Compression:

Stored size: 694 Bytes

Contents

module Fog
  module Compute
    class DigitalOcean
      class Real
        def get_server_details(server_id)
          request(
            :expects  => [200],
            :method   => 'GET',
            :path     => "droplets/#{server_id}"
          )
        end
      end

      class Mock
        def get_server_details(server_id)
          response = Excon::Response.new
          response.status = 200

          server = self.data[:servers].find { |s| s['id'] == server_id }

          response.body = {
            "status" => "OK",
            "droplet"  => self.data[:servers].find { |s| s['id'] == server_id }
          }

          response
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 4 rubygems

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