Class: Server

Inherits:
RightResource::Base show all
Defined in:
lib/right_resource/server.rb

Instance Attribute Summary

Attributes inherited from RightResource::Base

#attributes, #id

Class Method Summary collapse

Methods inherited from RightResource::Base

collection_path, connection, connection=, create, #destory, destory, element_path, format, format=, generate_attributes, headers, index, #initialize, #load_accessor, #loads, logger, logger=, #new?, resource_id, resource_name, #save, show, status, update, #update_attributes

Constructor Details

This class inherits a constructor from RightResource::Base

Class Method Details

.actionObject

TODO: refactor define_method or method_missing



4
# File 'lib/right_resource/server.rb', line 4

def action; end

.attach_volume(id, params = {}) ⇒ Object

Raises:

  • (NotImplementedError)


29
30
31
# File 'lib/right_resource/server.rb', line 29

def attach_volume(id, params={})
  raise NotImplementedError
end

.get_sketchy_data(id, params = {}) ⇒ Object

Raises:

  • (NotImplementedError)


33
34
35
# File 'lib/right_resource/server.rb', line 33

def get_sketchy_data(id, params={})
  raise NotImplementedError
end

.reboot(id) ⇒ Object

server restart(Starting created instance)



19
20
21
# File 'lib/right_resource/server.rb', line 19

def reboot(id)
  connection.post(element_path(id, :reboot))
end

.run_script(id, params = {}) ⇒ Object

Run rightscript location header is status href

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/right_resource/server.rb', line 25

def run_script(id, params={})
  raise NotImplementedError
end

.settings(id) ⇒ Object



37
38
39
40
# File 'lib/right_resource/server.rb', line 37

def settings(id)
  path = element_path(id, :settings)
  generate_attributes(format.decode(connection.get(path)))
end

.start(id) ⇒ Object

server start(Starting created instance)

Examples

server_id = Server.index(:filter => "nickname=dev001").first.id
Server.start(server_id)


9
10
11
# File 'lib/right_resource/server.rb', line 9

def start(id)
  connection.post(element_path(id, :start))
end

.stop(id) ⇒ Object

server stop(Starting created instance)



14
15
16
# File 'lib/right_resource/server.rb', line 14

def stop(id)
  connection.post(element_path(id, :stop))
end