Class: Fog::Compute::RackspaceV2::Images

Inherits:
Fog::Collection show all
Defined in:
lib/fog/rackspace/models/compute_v2/images.rb

Instance Attribute Summary collapse

Attributes inherited from Fog::Collection

#service

Instance Method Summary collapse

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

#limitInteger

Returns For an integer value n, limits the number of results to at most n values.

Returns:

  • (Integer)

    For an integer value n, limits the number of results to at most n values.

See Also:



26
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 26

attribute :limit

#markerString

Returns Given a string value x, return object names greater in value than the specified marker.

Returns:

  • (String)

    Given a string value x, return object names greater in value than the specified marker.

See Also:



21
# File 'lib/fog/rackspace/models/compute_v2/images.rb', line 21

attribute :marker

#nameString

Returns Given a string value x, filters the list of images by image name.

Returns:

  • (String)

    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

#statusString

Note:

Possible values are ACTIVE, DELETED, ERROR, SAVING, and UNKNOWN.

Returns Given a string value x, filters the list of images by status.

Returns:

  • (String)

    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

#typeString

Note:

Valid values are BASE and SNAPSHOT

Returns Given a string value x, filters the list of images by type.

Returns:

  • (String)

    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

Note:

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(options = {})
  options = {
    'name'          => name,
    'status'        => status,
    'marker'        => marker,
    'limit'         => limit,
    'type'          => type
  }.merge!(options)
  merge_attributes(options)

  data = service.list_images_detail(options).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