Class: Fog::Compute::Softlayer::Servers
- Inherits:
-
Fog::Collection
- Object
- Fog::Collection
- Fog::Compute::Softlayer::Servers
- Defined in:
- lib/fog/softlayer/models/compute/servers.rb
Instance Method Summary collapse
- #all ⇒ Object
- #bootstrap(options = {}) ⇒ Object
-
#get(identifier) ⇒ Object
Get a SoftLayer server.
Instance Method Details
#all ⇒ Object
18 19 20 21 |
# File 'lib/fog/softlayer/models/compute/servers.rb', line 18 def all data = service.list_servers load(data) end |
#bootstrap(options = {}) ⇒ Object
37 38 39 40 41 |
# File 'lib/fog/softlayer/models/compute/servers.rb', line 37 def bootstrap(={}) server = service.create() server.wait_for { ready? } server end |
#get(identifier) ⇒ Object
Get a SoftLayer server.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fog/softlayer/models/compute/servers.rb', line 25 def get(identifier) return nil if identifier.nil? || identifier == "" response = service.get_vm(identifier) if response.status == 404 # we didn't find it as a VM, look for a BMC server response = service.(identifier) end data = response.body new.merge_attributes(data) rescue Excon::Errors::NotFound nil end |