Method: OpenStack::Compute::Server#initialize
- Defined in:
- lib/openstack/compute/server.rb
#initialize(compute, id) ⇒ Server
This class is the representation of a single Server object. The constructor finds the server identified by the specified ID number, accesses the API via the populate method to get information about that server, and returns the object.
Will be called via the get_server or create_server methods on the OpenStack::Compute::Connection object, and will likely not be called directly.
>> server = cs.get_server(110917)
=> #<OpenStack::Compute::Server:0x1014e5438 ....>
>> server.name
=> "RenamedRubyTest"
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/openstack/compute/server.rb', line 35 def initialize(compute,id) @compute = compute @id = id @svrmgmthost = @compute.connection.service_host @svrmgmtpath = @compute.connection.service_path @svrmgmtport = @compute.connection.service_port @svrmgmtscheme = @compute.connection.service_scheme populate return self end |