Sha256: 43aecacd50bb126de59f767ef9ff843ffe3bcd9f94f520a4f960c180ff415b73

Contents?: true

Size: 865 Bytes

Versions: 19

Compression:

Stored size: 865 Bytes

Contents

class Ey::Core::Client
  class Real
    def start_server(params={})
      id  = params["id"]
      url = params["url"]

      request(
        :method => :put,
        :path   => "servers/#{id}/start",
        :url    => url,
      )
    end
  end # Real

  class Mock
    def start_server(params={})
      request_id  = self.uuid
      identity = resource_identity(params)

      find(:servers, identity)

      start_request = {
        "finished_at" => Time.now,
        "id"          => request_id,
        "started_at"  => Time.now,
        "successful"  => "true",
        "server"      => url_for("/servers/#{identity}"),
        "type"        => "start_server_request",
      }

      self.data[:requests][request_id] = start_request

      response(
        :body   => {"request" => start_request},
        :status => 201,
      )
    end
  end # Mock
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
ey-core-3.6.0.autoscaling1 lib/ey-core/requests/start_server.rb
ey-core-3.6.4 lib/ey-core/requests/start_server.rb
ey-core-3.6.3 lib/ey-core/requests/start_server.rb
ey-core-3.6.1 lib/ey-core/requests/start_server.rb
groove-ey-core-3.6.3 lib/ey-core/requests/start_server.rb
groove-ey-core-3.6.2 lib/ey-core/requests/start_server.rb
groove-ey-core-3.6.1 lib/ey-core/requests/start_server.rb
ey-core-3.5.0 lib/ey-core/requests/start_server.rb
ey-core-3.4.4 lib/ey-core/requests/start_server.rb
ey-core-3.4.2 lib/ey-core/requests/start_server.rb
ey-core-3.4.1 lib/ey-core/requests/start_server.rb
ey-core-3.4.0 lib/ey-core/requests/start_server.rb
ey-core-3.3.1 lib/ey-core/requests/start_server.rb
ey-core-3.3.0 lib/ey-core/requests/start_server.rb
ey-core-3.2.6 lib/ey-core/requests/start_server.rb
ey-core-3.2.5 lib/ey-core/requests/start_server.rb
ey-core-3.2.4 lib/ey-core/requests/start_server.rb
ey-core-3.2.3 lib/ey-core/requests/start_server.rb
ey-core-3.2.2 lib/ey-core/requests/start_server.rb