Class: Fog::Brightbox::Compute::Servers
- Inherits:
-
Collection
- Object
- Collection
- Fog::Brightbox::Compute::Servers
- Defined in:
- lib/fog/brightbox/models/compute/servers.rb
Instance Method Summary collapse
- #all ⇒ Object
-
#bootstrap(options = {}) ⇒ Object
Creates a server and maps an Cloud IP.
- #get(identifier) ⇒ Object
Instance Method Details
#all ⇒ Object
9 10 11 12 |
# File 'lib/fog/brightbox/models/compute/servers.rb', line 9 def all data = service.list_servers load(data) end |
#bootstrap(options = {}) ⇒ Object
TODO:
Support uploading of arbitary SSH keys
Creates a server and maps an Cloud IP
By default the public SSH key you have registered with Brightbox is already made available in an AWS compatible metdata service.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/fog/brightbox/models/compute/servers.rb', line 31 def bootstrap( = {}) server = create() # Ensure server is now available server.wait_for { ready? } # To get a public IP address we need to map a cloud IP address cip = service.cloud_ips.allocate cip.map(server) cip.wait_for { mapped? } # Reload so the public IP is now available server.reload end |
#get(identifier) ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/fog/brightbox/models/compute/servers.rb', line 46 def get(identifier) return nil if identifier.nil? || identifier == "" data = service.get_server(identifier) new(data) rescue Excon::Errors::NotFound nil end |