Sha256: fd1316b522bd8c34208992b1fbd44d41e8e55fd33bdebe1ff5b01cf017927b3e

Contents?: true

Size: 1.55 KB

Versions: 32

Compression:

Stored size: 1.55 KB

Contents

module Fog
  module Compute
    class Rackspace
      class Real

        # Get details about a server
        #
        # ==== Parameters
        # * server_id<~Integer> - Id of server to get details for
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #   * 'server'<~Hash>:
        #     * 'addresses'<~Hash>:
        #       * 'public'<~Array> - public address strings
        #       * 'private'<~Array> - private address strings
        #     * 'flavorId'<~Integer> - Id of servers current flavor
        #     * 'hostId'<~String>
        #     * 'id'<~Integer> - Id of server
        #     * 'imageId'<~Integer> - Id of image used to boot server
        #     * 'metadata'<~Hash> - metadata
        #     * 'name<~String> - Name of server
        #     * 'progress'<~Integer> - Progress through current status
        #     * 'status'<~String> - Current server status
        def get_server_details(server_id)
          request(
            :expects  => [200, 203],
            :method   => 'GET',
            :path     => "servers/#{server_id}.json"
          )
        end

      end

      class Mock

        def get_server_details(server_id)
          response = Excon::Response.new
          if server = list_servers_detail.body['servers'].detect {|_| _['id'] == server_id}
            response.status = [200, 203][rand(1)]
            response.body = { 'server' => server }
            response
          else
            raise Fog::Compute::Rackspace::NotFound
          end
        end

      end
    end
  end
end

Version data entries

32 entries across 32 versions & 8 rubygems

Version Path
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/requests/compute/get_server_details.rb
michiels-fog-1.3.1 lib/fog/rackspace/requests/compute/get_server_details.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/rackspace/requests/compute/get_server_details.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/requests/compute/get_server_details.rb
fog-1.3.1 lib/fog/rackspace/requests/compute/get_server_details.rb
fog-1.3.0 lib/fog/rackspace/requests/compute/get_server_details.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/requests/compute/get_server_details.rb
fog-1.2.0 lib/fog/rackspace/requests/compute/get_server_details.rb
ktheory-fog-1.1.2 lib/fog/rackspace/requests/compute/get_server_details.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/requests/compute/get_server_details.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/requests/compute/get_server_details.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/requests/compute/get_server_details.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/requests/compute/get_server_details.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/requests/compute/get_server_details.rb
fog-1.1.2 lib/fog/rackspace/requests/compute/get_server_details.rb
fog_tractical-1.1.4 lib/fog/rackspace/requests/compute/get_server_details.rb
fog_tractical-1.1.3 lib/fog/rackspace/requests/compute/get_server_details.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/requests/compute/get_server_details.rb
fog-1.1.1 lib/fog/rackspace/requests/compute/get_server_details.rb
fog-1.1.0 lib/fog/rackspace/requests/compute/get_server_details.rb