Class: Fog::Terremark::Shared::Images

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/terremark/models/shared/images.rb

Instance Attribute Summary

Attributes inherited from Collection

#service

Instance Method Summary collapse

Methods inherited from 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 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 Method Details

#allObject



26
27
28
29
30
31
# File 'lib/fog/terremark/models/shared/images.rb', line 26

def all
  data = service.get_catalog(vdc_id).body['CatalogItems'].select do |entity|
    entity['type'] == "application/vnd.vmware.vcloud.catalogItem+xml"
  end
  load(data)
end

#vdc_idObject



34
35
36
# File 'lib/fog/terremark/models/shared/images.rb', line 34

def vdc_id
  @vdc_id ||= service.default_vdc_id
end