Class: Fog::Compute::RackspaceV2::Images
- Inherits:
-
Fog::Collection
- Object
- Fog::Collection
- Fog::Compute::RackspaceV2::Images
- Defined in:
- lib/fog/rackspace/models/compute_v2/images.rb
Instance Attribute Summary collapse
-
#limit ⇒ Integer
For an integer value n, limits the number of results to at most n values.
-
#marker ⇒ String
Given a string value x, return object names greater in value than the specified marker.
-
#name ⇒ String
Given a string value x, filters the list of images by image name.
-
#status ⇒ String
Given a string value x, filters the list of images by status.
-
#type ⇒ String
Given a string value x, filters the list of images by type.
Instance Method Summary collapse
-
#all(options = {}) ⇒ Fog::Compute::RackspaceV2::Images
Returns list of images.
-
#get(image_id) ⇒ Fog::Compute::RackspaceV2:Image
Retrieve image.
Instance Attribute Details
#limit ⇒ Integer
Returns For an integer value n, limits the number of results to at most n values.
25 |
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 25 attribute :limit |
#marker ⇒ String
Returns Given a string value x, return object names greater in value than the specified marker.
20 |
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 20 attribute :marker |
#name ⇒ String
Returns Given a string value x, filters the list of images by image name.
10 |
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 10 attribute :name |
#status ⇒ String
Possible values are ACTIVE, DELETED, ERROR, SAVING, and UNKNOWN.
Returns Given a string value x, filters the list of images by status.
15 |
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 15 attribute :status |
#type ⇒ String
Valid values are BASE and SNAPSHOT
Returns Given a string value x, filters the list of images by type.
30 |
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 30 attribute :type |
Instance Method Details
#all(options = {}) ⇒ Fog::Compute::RackspaceV2::Images
Fog’s current implementation only returns 1000 images.
Returns list of images
42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 42 def all( = {}) = { 'name' => name, 'status' => status, 'marker' => marker, 'limit' => limit, 'type' => type }.merge!() merge_attributes() data = service.list_images_detail().body['images'] load(data) end |
#get(image_id) ⇒ Fog::Compute::RackspaceV2:Image
Retrieve image
64 65 66 67 68 69 |
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 64 def get(image_id) data = service.get_image(image_id).body['image'] new(data) rescue Fog::Compute::RackspaceV2::NotFound nil end |