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

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

Instance Attribute Summary collapse

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Fog::Compute::Server

#private_key=, #scp, #scp_download, #ssh, #ssh_port, #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 Attributes::InstanceMethods

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

Constructor Details

#initialize(attributes = {}) ⇒ Server

Returns a new instance of Server.



31
32
33
# File 'lib/rackspace-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/rackspace-fog/storm_on_demand/models/compute/server.rb', line 29

def password=(value)
  @password = value
end

#usernameObject



56
57
58
# File 'lib/rackspace-fog/storm_on_demand/models/compute/server.rb', line 56

def username
  @username ||= 'root'
end

Instance Method Details

#clone(options) ⇒ Object



60
61
62
63
64
# File 'lib/rackspace-fog/storm_on_demand/models/compute/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/rackspace-fog/storm_on_demand/models/compute/server.rb', line 35

def create(options)
  data = connection.create_server(options).body['servers']
  load(data)
end

#destroyObject



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

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

#ready?Boolean

Returns:

  • (Boolean)


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

def ready?
  active == 1
end

#rebootObject



50
51
52
53
54
# File 'lib/rackspace-fog/storm_on_demand/models/compute/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/rackspace-fog/storm_on_demand/models/compute/server.rb', line 65

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