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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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:



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

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:



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

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.



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

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.



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

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.



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

attribute :type

Instance Method Details

#all(options = {}) ⇒ Fog::Compute::RackspaceV2::Images

Note:

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(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

Parameters:

  • image_id (String)

    id of image

Returns:

  • (Fog::Compute::RackspaceV2:Image)

    image

Raises:

See Also:



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