class Aeolus::Image::Warehouse::TargetImage

Public Instance Methods

build() click to toggle source
# File lib/aeolus_image/model/warehouse/target_image.rb, line 21
def build
  ImageBuild.find(@build) if @build
end
delete!() click to toggle source

Deletes this targetimage and all child objects

# 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) click to toggle source
# 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() click to toggle source
# File lib/aeolus_image/model/warehouse/target_image.rb, line 25
def provider_images
  ProviderImage.where("($target_image == \"" + @uuid.to_s + "\")")
end
target_template() click to toggle source
# File lib/aeolus_image/model/warehouse/target_image.rb, line 29
def target_template
  Template.find(@template) if @template
end