Class: OctaSpace::Resources::Services

Inherits:
Base
  • Object
show all
Defined in:
lib/octaspace/resources/services.rb,
lib/octaspace/resources/services/vpn.rb,
lib/octaspace/resources/services/render.rb,
lib/octaspace/resources/services/session_proxy.rb,
lib/octaspace/resources/services/machine_rental.rb

Overview

Services namespace — aggregates MR, VPN, Render subresources and provides the session proxy pattern

Examples:

client.services.mr.list
client.services.vpn.create(node_id: 123)
client.services.render.create(node_id: 456, disk_size: 100)

# Session proxy pattern
client.services.session("uuid-123").info
client.services.session("uuid-123").stop(score: 5)

Defined Under Namespace

Classes: MachineRental, Render, SessionProxy, Vpn

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ Services

Returns a new instance of Services.



19
20
21
22
23
24
# File 'lib/octaspace/resources/services.rb', line 19

def initialize(transport)
  super
  @mr = Services::MachineRental.new(transport)
  @vpn = Services::Vpn.new(transport)
  @render = Services::Render.new(transport)
end

Instance Attribute Details

#mrObject (readonly)

Returns the value of attribute mr.



17
18
19
# File 'lib/octaspace/resources/services.rb', line 17

def mr
  @mr
end

#renderObject (readonly)

Returns the value of attribute render.



17
18
19
# File 'lib/octaspace/resources/services.rb', line 17

def render
  @render
end

#vpnObject (readonly)

Returns the value of attribute vpn.



17
18
19
# File 'lib/octaspace/resources/services.rb', line 17

def vpn
  @vpn
end

Instance Method Details

#session(uuid) ⇒ OctaSpace::Resources::Services::SessionProxy

Return a proxy object for operations on a specific session

Parameters:

  • uuid (String)

    session UUID

Returns:



29
30
31
# File 'lib/octaspace/resources/services.rb', line 29

def session(uuid)
  Services::SessionProxy.new(transport, uuid)
end