Class: Fog::Compute::RackspaceV2::Servers
- Inherits:
-
Fog::Collection
- Object
- Array
- Fog::Collection
- Fog::Compute::RackspaceV2::Servers
- Defined in:
- lib/fog/rackspace/models/compute_v2/servers.rb
Instance Attribute Summary
Attributes inherited from Fog::Collection
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.
Methods inherited from Fog::Collection
#clear, #create, #destroy, #initialize, #inspect, #load, model, #model, #new, #reload, #table, #to_json
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
This class inherits a constructor from Fog::Collection
Instance Method Details
#all(filters = {}) ⇒ Fog::Compute::RackspaceV2::Servers
Fog’s current implementation only returns 1000 servers
The filter parameter on the method is just to maintain compatability with other providers that support filtering.
Returns list of servers
21 22 23 24 |
# File 'lib/fog/rackspace/models/compute_v2/servers.rb', line 21 def all(filters = {}) data = service.list_servers.body['servers'] load(data) end |
#bootstrap(new_attributes = {}) ⇒ Fog::Compute::RackspaceV2::Server
This method is incompatible with Cloud Servers utlizing RackConnect. RackConnect users should use server personalization to install keys. Please see Server#personality for more information.
Creates a new server and populates ssh keys
42 43 44 45 46 47 |
# File 'lib/fog/rackspace/models/compute_v2/servers.rb', line 42 def bootstrap(new_attributes = {}) server = create(new_attributes) server.wait_for(1500) { ready? && !public_ip_address.empty? } server.setup(:password => server.password) server end |
#get(server_id) ⇒ Fog::Compute::RackspaceV2:Server
Retrieves server
57 58 59 60 61 62 |
# File 'lib/fog/rackspace/models/compute_v2/servers.rb', line 57 def get(server_id) data = service.get_server(server_id).body['server'] new(data) rescue Fog::Compute::RackspaceV2::NotFound nil end |