Class: Fog::Brightbox::Compute::Server
- Inherits:
-
Model
- Object
- Model
- Fog::Brightbox::Compute::Server
show all
- Defined in:
- lib/fog/compute/models/brightbox/server.rb
Instance Attribute Summary
Attributes inherited from Model
#collection, #connection
Instance Method Summary
collapse
Methods inherited from Model
#initialize, #inspect, #reload, #to_json, #wait_for
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
#_dump, #attributes, #identity, #identity=, #merge_attributes, #new_record?, #requires
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
#destroy ⇒ Object
58
59
60
61
62
|
# File 'lib/fog/compute/models/brightbox/server.rb', line 58
def destroy
requires :identity
connection.destroy_server(identity)
true
end
|
#flavor ⇒ Object
64
65
66
67
|
# File 'lib/fog/compute/models/brightbox/server.rb', line 64
def flavor
requires :flavor_id
connection.flavors.get(flavor_id)
end
|
#image ⇒ Object
69
70
71
72
|
# File 'lib/fog/compute/models/brightbox/server.rb', line 69
def image
requires :image_id
connection.images.get(image_id)
end
|
#ready? ⇒ Boolean
74
75
76
|
# File 'lib/fog/compute/models/brightbox/server.rb', line 74
def ready?
status == 'active'
end
|
#reboot ⇒ Object
36
37
38
|
# File 'lib/fog/compute/models/brightbox/server.rb', line 36
def reboot
false
end
|
#save ⇒ Object
78
79
80
81
82
83
84
85
86
87
88
89
90
|
# File 'lib/fog/compute/models/brightbox/server.rb', line 78
def save
requires :image_id
options = {
:image => image_id,
:server_type => flavor_id,
:name => name,
:zone => zone_id,
:user_data => user_data
}.delete_if {|k,v| v.nil? || v == "" }
data = connection.create_server(options)
merge_attributes(data)
true
end
|
#shutdown ⇒ Object
52
53
54
55
56
|
# File 'lib/fog/compute/models/brightbox/server.rb', line 52
def shutdown
requires :identity
connection.shutdown_server(identity)
true
end
|
#snapshot ⇒ Object
31
32
33
34
|
# File 'lib/fog/compute/models/brightbox/server.rb', line 31
def snapshot
requires :identity
connection.snapshot_server(identity)
end
|
#start ⇒ Object
40
41
42
43
44
|
# File 'lib/fog/compute/models/brightbox/server.rb', line 40
def start
requires :identity
connection.start_server(identity)
true
end
|
#stop ⇒ Object
46
47
48
49
50
|
# File 'lib/fog/compute/models/brightbox/server.rb', line 46
def stop
requires :identity
connection.stop_server(identity)
true
end
|