Class: Aeolus::Image::Factory::Builder

Inherits:
Base
  • Object
show all
Defined in:
lib/aeolus_image/model/factory/builder.rb

Constant Summary collapse

ACTIVE_STATES =
['FAILED', 'COMPLETED']

Instance Method Summary collapse

Methods inherited from Base

collection_path, config, config=, custom_method_collection_url, #custom_method_element_url, element_path, get, #get, #initialize, instantiate_collection, use_oauth?

Constructor Details

This class inherits a constructor from Aeolus::Image::Factory::Base

Instance Method Details

#failed_build_count(build_id, target) ⇒ Object



35
36
37
# File 'lib/aeolus_image/model/factory/builder.rb', line 35

def failed_build_count(build_id, target)
  builders.count {|b| b.status == 'FAILED' && b.operation == 'build' && b.build_id == build_id && b.target == target}
end

#failed_push_count(target_image_id, provider, account) ⇒ Object



39
40
41
42
# File 'lib/aeolus_image/model/factory/builder.rb', line 39

def failed_push_count(target_image_id, provider, )
  builders.count {|b| b.status == 'FAILED' && b.operation == 'push' && b.target_image_id == target_image_id &&
                      b.provider == provider && b. == }
end

#find_active_build(build_id, target) ⇒ Object



22
23
24
# File 'lib/aeolus_image/model/factory/builder.rb', line 22

def find_active_build(build_id, target)
  builders.find {|b| !ACTIVE_STATES.include?(b.status) && b.operation == 'build' && b.build_id == build_id && b.target == target}
end

#find_active_build_by_imageid(image_id, target) ⇒ Object



26
27
28
# File 'lib/aeolus_image/model/factory/builder.rb', line 26

def find_active_build_by_imageid(image_id, target)
  builders.find {|b| !ACTIVE_STATES.include?(b.status) && b.operation == 'build' && b.image_id == image_id && b.target == target}
end

#find_active_push(target_image_id, provider, account) ⇒ Object



30
31
32
33
# File 'lib/aeolus_image/model/factory/builder.rb', line 30

def find_active_push(target_image_id, provider, )
  builders.find {|b| !ACTIVE_STATES.include?(b.status) && b.operation == 'push' && b.target_image_id == target_image_id &&
                      b.provider == provider && b. == }
end