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