Class: OctaSpace::Resources::Services::SessionProxy
- Inherits:
-
Object
- Object
- OctaSpace::Resources::Services::SessionProxy
- Defined in:
- lib/octaspace/resources/services/session_proxy.rb
Overview
Proxy object for operations on a specific service session
Obtained via: client.services.session(“uuid”)
Instance Method Summary collapse
-
#info ⇒ OctaSpace::Response
Fetch session details GET /services/:uuid/info.
-
#initialize(transport, uuid) ⇒ SessionProxy
constructor
A new instance of SessionProxy.
-
#logs(recent: nil) ⇒ OctaSpace::Response
Fetch session logs GET /services/:uuid/logs.
-
#stop(**params) ⇒ OctaSpace::Response
Stop the session POST /services/:uuid/stop.
Constructor Details
#initialize(transport, uuid) ⇒ SessionProxy
Returns a new instance of SessionProxy.
20 21 22 23 |
# File 'lib/octaspace/resources/services/session_proxy.rb', line 20 def initialize(transport, uuid) @transport = transport @uuid = URI.encode_www_form_component(uuid.to_s) end |
Instance Method Details
#info ⇒ OctaSpace::Response
Fetch session details GET /services/:uuid/info
28 29 30 |
# File 'lib/octaspace/resources/services/session_proxy.rb', line 28 def info @transport.get("/services/#{@uuid}/info") end |
#logs(recent: nil) ⇒ OctaSpace::Response
Fetch session logs GET /services/:uuid/logs
36 37 38 39 40 41 42 |
# File 'lib/octaspace/resources/services/session_proxy.rb', line 36 def logs(recent: nil) params = {} params[:recent] = true if recent return @transport.get("/services/#{@uuid}/logs") if params.empty? @transport.get("/services/#{@uuid}/logs", params:) end |
#stop(**params) ⇒ OctaSpace::Response
Stop the session POST /services/:uuid/stop
48 49 50 |
# File 'lib/octaspace/resources/services/session_proxy.rb', line 48 def stop(**params) @transport.post("/services/#{@uuid}/stop", body: params.empty? ? nil : params) end |