Class: Fog::Compute::RackspaceV2::Images
- Inherits:
-
Fog::Collection
- Object
- Array
- 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.
Attributes inherited from Fog::Collection
Instance Method Summary collapse
-
#all(options = {}) ⇒ Fog::Compute::RackspaceV2::Images
Returns list of images.
-
#get(image_id) ⇒ Fog::Compute::RackspaceV2:Image
Retrieve image.
Methods inherited from Fog::Collection
#clear, #create, #destroy, #initialize, #inspect, #load, model, #model, #new, #reload, #table, #to_json
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Fog::Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
This class inherits a constructor from Fog::Collection
Instance Attribute Details
#limit ⇒ Integer
Returns For an integer value n, limits the number of results to at most n values.
26 |
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 26 attribute :limit |
#marker ⇒ String
Returns Given a string value x, return object names greater in value than the specified marker.
21 |
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 21 attribute :marker |
#name ⇒ String
Returns Given a string value x, filters the list of images by image name.
11 |
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 11 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.
16 |
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 16 attribute :status |
#type ⇒ String
Valid values are BASE and SNAPSHOT
Returns Given a string value x, filters the list of images by type.
31 |
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 31 attribute :type |
Instance Method Details
#all(options = {}) ⇒ Fog::Compute::RackspaceV2::Images
Fog’s current implementation only returns 1000 images.
Returns list of images
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 43 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
65 66 67 68 69 70 |
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 65 def get(image_id) data = service.get_image(image_id).body['image'] new(data) rescue Fog::Compute::RackspaceV2::NotFound nil end |