Class: Fog::Compute::DigitalOcean::SshKeys
- Inherits:
-
PagingCollection
- Object
- Fog::Collection
- PagingCollection
- Fog::Compute::DigitalOcean::SshKeys
- Defined in:
- lib/fog/compute/digitalocean/models/ssh_keys.rb
Instance Method Summary collapse
-
#all(filters = {}) ⇒ Fog::Compute::DigitalOceanV2::Sshkeys
Returns list of ssh keys.
-
#get(id) ⇒ Fog::Compute::DigitalOceanV2::Sshkeys
Returns ssh key.
Methods inherited from PagingCollection
Instance Method Details
#all(filters = {}) ⇒ Fog::Compute::DigitalOceanV2::Sshkeys
Returns list of ssh keys
16 17 18 19 20 21 22 |
# File 'lib/fog/compute/digitalocean/models/ssh_keys.rb', line 16 def all(filters = {}) data = service.list_ssh_keys(filters) links = data.body["links"] get_paged_links(links) keys = data.body["ssh_keys"] load(keys) end |
#get(id) ⇒ Fog::Compute::DigitalOceanV2::Sshkeys
Returns ssh key
31 32 33 34 35 36 |
# File 'lib/fog/compute/digitalocean/models/ssh_keys.rb', line 31 def get(id) key = service.get_ssh_key(id).body['ssh_key'] new(key) if key rescue Fog::Errors::NotFound nil end |