Class: Server
- Inherits:
-
RightResource::Base
- Object
- RightResource::Base
- Server
- Defined in:
- lib/right_resource/server.rb
Instance Attribute Summary
Attributes inherited from RightResource::Base
Class Method Summary collapse
-
.action ⇒ Object
TODO: refactor define_method or method_missing.
- .attach_volume(id, params = {}) ⇒ Object
- .get_sketchy_data(id, params = {}) ⇒ Object
-
.reboot(id) ⇒ Object
server restart(Starting created instance).
-
.run_script(id, params = {}) ⇒ Object
Run rightscript location header is status href.
- .settings(id) ⇒ Object
-
.start(id) ⇒ Object
server start(Starting created instance) === Examples server_id = Server.index(:filter => “nickname=dev001”).first.id Server.start(server_id).
-
.stop(id) ⇒ Object
server stop(Starting created instance).
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
.action ⇒ Object
TODO: refactor define_method or method_missing
4 |
# File 'lib/right_resource/server.rb', line 4 def action; end |
.attach_volume(id, params = {}) ⇒ Object
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
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
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
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 |