Class: Fog::Compute::StormOnDemand::Server
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::StormOnDemand::Server
show all
- Defined in:
- lib/fog/compute/models/storm_on_demand/server.rb
Instance Attribute Summary collapse
Attributes inherited from Model
#collection, #connection
Instance Method Summary
collapse
Methods inherited from Model
#inspect, #reload, #to_json, #wait_for
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires
Constructor Details
#initialize(attributes = {}) ⇒ Server
Returns a new instance of Server.
31
32
33
|
# File 'lib/fog/compute/models/storm_on_demand/server.rb', line 31
def initialize(attributes={})
super
end
|
Instance Attribute Details
#password=(value) ⇒ Object
Sets the attribute password
29
30
31
|
# File 'lib/fog/compute/models/storm_on_demand/server.rb', line 29
def password=(value)
@password = value
end
|
#username ⇒ Object
56
57
58
|
# File 'lib/fog/compute/models/storm_on_demand/server.rb', line 56
def username
@username ||= 'root'
end
|
Instance Method Details
#clone(options) ⇒ Object
60
61
62
63
64
|
# File 'lib/fog/compute/models/storm_on_demand/server.rb', line 60
def clone(options)
requires :identity
connection.clone_server({:uniq_id => identity}.merge!(options))
true
end
|
#create(options) ⇒ Object
35
36
37
38
|
# File 'lib/fog/compute/models/storm_on_demand/server.rb', line 35
def create(options)
data = connection.create_server(options).body['servers']
load(data)
end
|
#destroy ⇒ Object
40
41
42
43
44
|
# File 'lib/fog/compute/models/storm_on_demand/server.rb', line 40
def destroy
requires :identity
connection.delete_server(:uniq_id => identity)
true
end
|
#ready? ⇒ Boolean
46
47
48
|
# File 'lib/fog/compute/models/storm_on_demand/server.rb', line 46
def ready?
active == 1
end
|
#reboot ⇒ Object
50
51
52
53
54
|
# File 'lib/fog/compute/models/storm_on_demand/server.rb', line 50
def reboot
requires :identity
connection.reboot_server(:uniq_id => identity)
true
end
|
#resize(options) ⇒ Object
65
66
67
68
69
|
# File 'lib/fog/compute/models/storm_on_demand/server.rb', line 65
def resize(options)
requires :identity
connection.resize_server({:uniq_id => identity}.merge!(options))
true
end
|