Class: Fog::Compute::DigitalOcean::Volumes
- Inherits:
-
PagingCollection
- Object
- Fog::Collection
- PagingCollection
- Fog::Compute::DigitalOcean::Volumes
- Defined in:
- lib/fog/compute/digitalocean/models/volumes.rb
Instance Method Summary collapse
-
#all(filters = {}) ⇒ Fog::Compute::DigitalOcean::Volume
Retrieves volumes.
-
#get(id) ⇒ Fog::Compute::DigitalOcean:Image
Retrieves volume.
Methods inherited from PagingCollection
Instance Method Details
#all(filters = {}) ⇒ Fog::Compute::DigitalOcean::Volume
Retrieves volumes
16 17 18 19 20 21 22 |
# File 'lib/fog/compute/digitalocean/models/volumes.rb', line 16 def all(filters = {}) data = service.list_volumes(filters) links = data.body["links"] get_paged_links(links) volumes = data.body["volumes"] load(volumes) end |
#get(id) ⇒ Fog::Compute::DigitalOcean:Image
Retrieves volume
32 33 34 35 36 37 |
# File 'lib/fog/compute/digitalocean/models/volumes.rb', line 32 def get(id) volume = service.get_volume_details(id).body['volume'] new(volume) if volume rescue Fog::Errors::NotFound nil end |