Class: Fog::Compute::StormOnDemand::Server

Inherits:
Fog::Compute::Server show all
Defined in:
lib/fog/storm_on_demand/models/compute/server.rb

Instance Attribute Summary collapse

Attributes inherited from Fog::Compute::Server

#private_key, #private_key_path, #public_key, #public_key_path, #ssh_options, #ssh_port, #username

Attributes inherited from Model

#collection, #service

Instance Method Summary collapse

Methods inherited from Fog::Compute::Server

#scp, #scp_download, #ssh, #ssh_ip_address, #ssh_ip_address=, #sshable?

Methods inherited from Model

#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 Fog::Core::DeprecatedConnectionAccessors

#connection, #connection=, #prepare_service_value

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one

Constructor Details

#initialize(attributes = {}) ⇒ Server

Returns a new instance of Server.



31
32
33
# File 'lib/fog/storm_on_demand/models/compute/server.rb', line 31

def initialize(attributes={})
  super
end

Instance Attribute Details

#password=(value) ⇒ Object (writeonly)

Sets the attribute password

Parameters:

  • value

    the value to set the attribute password to.



29
30
31
# File 'lib/fog/storm_on_demand/models/compute/server.rb', line 29

def password=(value)
  @password = value
end

Instance Method Details

#clone(options) ⇒ Object



51
52
53
54
55
# File 'lib/fog/storm_on_demand/models/compute/server.rb', line 51

def clone(options)
  requires :identity
  service.clone_server({:uniq_id => identity}.merge!(options))
  true
end

#destroyObject



35
36
37
38
39
# File 'lib/fog/storm_on_demand/models/compute/server.rb', line 35

def destroy
  requires :identity
  service.delete_server(:uniq_id => identity)
  true
end

#history(options = {}) ⇒ Object



63
64
65
66
67
68
# File 'lib/fog/storm_on_demand/models/compute/server.rb', line 63

def history(options={})
  requires :identity
  params = {:uniq_id => identity}.merge!(options)
  res = service.server_history(params).body
  res['items']
end

#ready?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/fog/storm_on_demand/models/compute/server.rb', line 41

def ready?
  active == 1
end

#reboot(options = {}) ⇒ Object



45
46
47
48
49
# File 'lib/fog/storm_on_demand/models/compute/server.rb', line 45

def reboot(options={})
  requires :identity
  service.reboot_server({:uniq_id => identity}.merge!(options))
  true
end

#resize(options) ⇒ Object



57
58
59
60
61
# File 'lib/fog/storm_on_demand/models/compute/server.rb', line 57

def resize(options)
  requires :identity
  service.resize_server({:uniq_id => identity}.merge!(options))
  true
end

#shutdown(options = {}) ⇒ Object



70
71
72
73
# File 'lib/fog/storm_on_demand/models/compute/server.rb', line 70

def shutdown(options={})
  requires :identity
  service.shutdown_server({:uniq_id => identity}.merge!(options)).body
end

#startObject



75
76
77
78
# File 'lib/fog/storm_on_demand/models/compute/server.rb', line 75

def start
  reqwuires :identity
  service.start_server({:uniq_id => identity}).body
end

#statusObject



80
81
82
83
# File 'lib/fog/storm_on_demand/models/compute/server.rb', line 80

def status
  requires :identity
  service.server_status({:uniq_id => identity}).body
end

#update(options) ⇒ Object



85
86
87
88
# File 'lib/fog/storm_on_demand/models/compute/server.rb', line 85

def update(options)
  requires :identity
  service.update_server({:uniq_id => identity}.merge!(options)).body
end