Class: Aeolus::Image::Warehouse::TargetImage
Instance Attribute Summary
#body
Instance Method Summary
collapse
#==, all, #bucket_object, bucket_objects, config, config=, create!, delete, find, first, #id, #initialize, iwhd_url, last, oauth_consumer_key, oauth_consumer_secret, #set_attr, set_warehouse_and_bucket, use_oauth?, where
Instance Method Details
#build ⇒ Object
21
22
23
|
# File 'lib/aeolus_image/model/warehouse/target_image.rb', line 21
def build
ImageBuild.find(@build) if @build
end
|
#delete! ⇒ Object
Deletes this targetimage and all child objects
34
35
36
37
38
39
40
41
42
|
# File 'lib/aeolus_image/model/warehouse/target_image.rb', line 34
def delete!
begin
provider_images.each do |pi|
pi.delete!
end
rescue NoMethodError
end
TargetImage.delete(@uuid)
end
|
#find_provider_image_by_provider_and_account(provider, provider_account) ⇒ Object
44
45
46
47
48
49
|
# File 'lib/aeolus_image/model/warehouse/target_image.rb', line 44
def find_provider_image_by_provider_and_account(provider, provider_account)
conditions = ["$target_image == \"#{@uuid}\""]
conditions << "$provider == \"#{provider}\"" if provider
conditions << "$provider_account_identifier == \"#{provider_account}\"" if provider_account
ProviderImage.where('(' + conditions.join(' && ') + ')')
end
|
#provider_images ⇒ Object
25
26
27
|
# File 'lib/aeolus_image/model/warehouse/target_image.rb', line 25
def provider_images
ProviderImage.where("($target_image == \"" + @uuid.to_s + "\")")
end
|
#target_template ⇒ Object
29
30
31
|
# File 'lib/aeolus_image/model/warehouse/target_image.rb', line 29
def target_template
Template.find(@template) if @template
end
|