Class: Fog::Compute::RackspaceV2::Servers
- Inherits:
-
Fog::Collection
- Object
- Fog::Collection
- Fog::Compute::RackspaceV2::Servers
- Defined in:
- lib/fog/rackspace/models/compute_v2/servers.rb
Instance Method Summary collapse
-
#all(filters = {}) ⇒ Fog::Compute::RackspaceV2::Servers
Returns list of servers.
-
#bootstrap(new_attributes = {}) ⇒ Fog::Compute::RackspaceV2::Server
Creates a new server and populates ssh keys.
-
#get(server_id) ⇒ Fog::Compute::RackspaceV2:Server
Retrieves server.
Instance Method Details
#all(filters = {}) ⇒ Fog::Compute::RackspaceV2::Servers
Note:
Fog’s current implementation only returns 1000 servers
Note:
The filter parameter on the method is just to maintain compatability with other providers that support filtering.
Returns list of servers
19 20 21 22 |
# File 'lib/fog/rackspace/models/compute_v2/servers.rb', line 19 def all(filters = {}) data = service.list_servers.body['servers'] load(data) end |
#bootstrap(new_attributes = {}) ⇒ Fog::Compute::RackspaceV2::Server
Note:
This method is incompatible with Cloud Servers utlizing RackConnect ***if and only if*** provided the attribute “passwd_lock” left at false.
Creates a new server and populates ssh keys
40 41 42 43 44 45 |
# File 'lib/fog/rackspace/models/compute_v2/servers.rb', line 40 def bootstrap(new_attributes = {}) server = create(new_attributes) server.wait_for { ready? && !public_ip_address.empty? } server.setup(:password => server.password) server end |
#get(server_id) ⇒ Fog::Compute::RackspaceV2:Server
Retrieves server
55 56 57 58 59 60 |
# File 'lib/fog/rackspace/models/compute_v2/servers.rb', line 55 def get(server_id) data = service.get_server(server_id).body['server'] new(data) rescue Fog::Compute::RackspaceV2::NotFound nil end |