Class: Tiktalik::Computing::Instance
- Defined in:
- lib/tiktalik/computing/instance.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
String.
-
#default_password ⇒ Object
readonly
String.
-
#gross_cost_per_hour ⇒ Object
readonly
String.
-
#hostname ⇒ Object
readonly
String.
-
#interfaces ⇒ Object
readonly
String.
-
#owner ⇒ Object
readonly
String.
-
#running ⇒ Object
readonly
String.
-
#service_name ⇒ Object
readonly
String.
-
#state ⇒ Object
readonly
String.
-
#uuid ⇒ Object
readonly
String.
-
#vpsimage ⇒ Object
readonly
String.
-
#vpsimage_uuid ⇒ Object
readonly
String.
Class Method Summary collapse
-
.all(params = {}) ⇒ Object
List of user virtual machines.
-
.create(params = {}) ⇒ Object
Create a new virtual machine.
-
.find(uuid) ⇒ Object
Get virtual machine details.
Instance Method Summary collapse
-
#backup ⇒ Object
Do “Backup” of virtual machine.
-
#build_interface(params = {}) ⇒ Object
Create virtual machine network interface.
-
#destroy ⇒ Object
Delete instance.
-
#force_stop ⇒ Object
Force “Shutdown” operation on virtual machine.
-
#install ⇒ Object
Call “Install” operation on virtual machine.
-
#start ⇒ Object
Call “Boot” or “Start” operation on virtual machine.
-
#stop ⇒ Object
Call “Shutdown” operation on virtual machine.
Methods inherited from Object
Constructor Details
This class inherits a constructor from Tiktalik::Object
Instance Attribute Details
#actions ⇒ Object (readonly)
String
9 10 11 |
# File 'lib/tiktalik/computing/instance.rb', line 9 def actions @actions end |
#default_password ⇒ Object (readonly)
String
9 10 11 |
# File 'lib/tiktalik/computing/instance.rb', line 9 def default_password @default_password end |
#gross_cost_per_hour ⇒ Object (readonly)
String
9 10 11 |
# File 'lib/tiktalik/computing/instance.rb', line 9 def gross_cost_per_hour @gross_cost_per_hour end |
#hostname ⇒ Object (readonly)
String
9 10 11 |
# File 'lib/tiktalik/computing/instance.rb', line 9 def hostname @hostname end |
#interfaces ⇒ Object (readonly)
String
9 10 11 |
# File 'lib/tiktalik/computing/instance.rb', line 9 def interfaces @interfaces end |
#owner ⇒ Object (readonly)
String
9 10 11 |
# File 'lib/tiktalik/computing/instance.rb', line 9 def owner @owner end |
#running ⇒ Object (readonly)
String
9 10 11 |
# File 'lib/tiktalik/computing/instance.rb', line 9 def running @running end |
#service_name ⇒ Object (readonly)
String
9 10 11 |
# File 'lib/tiktalik/computing/instance.rb', line 9 def service_name @service_name end |
#state ⇒ Object (readonly)
String
9 10 11 |
# File 'lib/tiktalik/computing/instance.rb', line 9 def state @state end |
#uuid ⇒ Object (readonly)
String
9 10 11 |
# File 'lib/tiktalik/computing/instance.rb', line 9 def uuid @uuid end |
#vpsimage ⇒ Object (readonly)
String
9 10 11 |
# File 'lib/tiktalik/computing/instance.rb', line 9 def vpsimage @vpsimage end |
#vpsimage_uuid ⇒ Object (readonly)
String
9 10 11 |
# File 'lib/tiktalik/computing/instance.rb', line 9 def vpsimage_uuid @vpsimage_uuid end |
Class Method Details
.all(params = {}) ⇒ Object
List of user virtual machines.
29 30 31 32 |
# File 'lib/tiktalik/computing/instance.rb', line 29 def self.all(params = {}) results = request(:get, '/computing/instance', params) results.collect { |result| new(result) } end |
.create(params = {}) ⇒ Object
Create a new virtual machine.
42 43 44 45 46 |
# File 'lib/tiktalik/computing/instance.rb', line 42 def self.create(params = {}) require_params(params, :image_uuid, :size, :hostname) result = request(:post, '/computing/instance', params) new(result) end |
.find(uuid) ⇒ Object
Get virtual machine details.
51 52 53 54 |
# File 'lib/tiktalik/computing/instance.rb', line 51 def self.find(uuid) result = request(:get, "/computing/instance/#{uuid}") new(result) end |
Instance Method Details
#backup ⇒ Object
Do “Backup” of virtual machine. VPS need to be stopped in order to create its backup.
99 100 101 102 |
# File 'lib/tiktalik/computing/instance.rb', line 99 def backup request(:post, "/computing/instance/#{@uuid}/backup") true end |
#build_interface(params = {}) ⇒ Object
Create virtual machine network interface.
68 69 70 71 72 |
# File 'lib/tiktalik/computing/instance.rb', line 68 def build_interface(params = {}) require_params(params, :network_uuid, :seq) result = request(:post, "/computing/instance/#{@uuid}/interface", params) VPSNetInterface.new(result) end |
#destroy ⇒ Object
Delete instance.
57 58 59 60 |
# File 'lib/tiktalik/computing/instance.rb', line 57 def destroy request(:delete, "/computing/instance/#{@uuid}") true end |
#force_stop ⇒ Object
Force “Shutdown” operation on virtual machine.
93 94 95 96 |
# File 'lib/tiktalik/computing/instance.rb', line 93 def force_stop request(:post, "/computing/instance/#{@uuid}/force_stop") true end |
#install ⇒ Object
Call “Install” operation on virtual machine.
75 76 77 78 |
# File 'lib/tiktalik/computing/instance.rb', line 75 def install request(:post, "/computing/instance/#{@uuid}/install") true end |
#start ⇒ Object
Call “Boot” or “Start” operation on virtual machine.
81 82 83 84 |
# File 'lib/tiktalik/computing/instance.rb', line 81 def start request(:post, "/computing/instance/#{@uuid}/start") true end |
#stop ⇒ Object
Call “Shutdown” operation on virtual machine.
87 88 89 90 |
# File 'lib/tiktalik/computing/instance.rb', line 87 def stop request(:post, "/computing/instance/#{@uuid}/stop") true end |