Class: Fog::Compute::Ecloud::SshKeys
- Inherits:
-
Ecloud::Collection
- Object
- Fog::Collection
- Ecloud::Collection
- Fog::Compute::Ecloud::SshKeys
- Defined in:
- lib/fog/compute/ecloud/models/ssh_keys.rb
Instance Method Summary collapse
Methods inherited from Ecloud::Collection
Instance Method Details
#all ⇒ Object
11 12 13 14 |
# File 'lib/fog/compute/ecloud/models/ssh_keys.rb', line 11 def all data = service.get_ssh_keys(href).body[:SshKey] || [] load(data) end |
#create(options = {}) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fog/compute/ecloud/models/ssh_keys.rb', line 25 def create( = {}) # Make sure we only pass what we should = {} [:Name] = [:Name] unless [:Name].nil? [:Default] = [:Default] || false [:uri] = href + "/action/createSshKey" data = service.ssh_key_create() object = service.ssh_keys.new(data) object end |
#environment_id ⇒ Object
37 38 39 |
# File 'lib/fog/compute/ecloud/models/ssh_keys.rb', line 37 def environment_id href.scan(/\d+/)[0] end |
#get(uri) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/fog/compute/ecloud/models/ssh_keys.rb', line 16 def get(uri) if data = service.get_ssh_key(uri).body new(data) end rescue ServiceError => e raise e unless e.status_code == 404 nil end |