Class: Fog::Compute::Glesys::Server
- Extended by:
- Deprecation
- Defined in:
- lib/fog/glesys/models/compute/server.rb
Instance Attribute Summary
Attributes inherited from Server
#private_key, #private_key_path, #public_key, #public_key_path, #username
Attributes inherited from Model
Instance Method Summary collapse
Methods included from Deprecation
Methods inherited from Server
#scp, #scp_download, #ssh, #ssh_port, #sshable?
Methods inherited from Model
#initialize, #inspect, #reload, #symbolize_keys, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Model
Instance Method Details
#destroy ⇒ Object
48 49 50 51 |
# File 'lib/fog/glesys/models/compute/server.rb', line 48 def destroy requires :identity connection.destroy(:serverid => identity, :keepip => keepip) end |
#ready? ⇒ Boolean
29 30 31 |
# File 'lib/fog/glesys/models/compute/server.rb', line 29 def ready? state == 'running' end |
#reboot ⇒ Object
43 44 45 46 |
# File 'lib/fog/glesys/models/compute/server.rb', line 43 def reboot requires :identity connection.reboot(:serverid => identity) end |
#save ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/fog/glesys/models/compute/server.rb', line 53 def save raise "Operation not supported" if self.identity requires :hostname, :rootpassword = { :datacenter => datacenter || "Falkenberg", :platform => platform || "Xen", :hostname => hostname, :templatename => templatename || "Debian-6 x64", :disksize => disksize || "10", :memorysize => memorysize || "512", :cpucores => cpucores || "1", :rootpassword => rootpassword, :transfer => transfer || "500", } data = connection.create() merge_attributes(data.body['response']['server']) data.status == 200 ? true : false end |
#start ⇒ Object
33 34 35 36 |
# File 'lib/fog/glesys/models/compute/server.rb', line 33 def start requires :identity connection.start(:serverid => identity) end |
#stop ⇒ Object
38 39 40 41 |
# File 'lib/fog/glesys/models/compute/server.rb', line 38 def stop requires :identity connection.stop(:serverid => identity) end |