lib/runcible/extensions/repository.rb in runcible-1.5.1 vs lib/runcible/extensions/repository.rb in runcible-1.6.0
- old
+ new
@@ -258,10 +258,30 @@
def docker_manifests(id)
criteria = {:type_ids => [Runcible::Extensions::DockerManifest.content_type]}
unit_search(id, criteria).map { |i| i['metadata'].with_indifferent_access }
end
+ # Retrieves the docker tag IDs for a single repository
+ #
+ # @param [String] id the ID of the repository
+ # @return [RestClient::Response] the set of repository docker tag IDs
+ def docker_tag_ids(id)
+ criteria = {:type_ids => [Runcible::Extensions::DockerTag.content_type],
+ :fields => {:unit => [], :association => ['unit_id']}}
+
+ unit_search(id, criteria).map { |i| i['unit_id'] }
+ end
+
+ # Retrieves the docker tags for a single repository
+ #
+ # @param [String] id the ID of the repository
+ # @return [RestClient::Response] the set of repository docker tags
+ def docker_tags(id)
+ criteria = {:type_ids => [Runcible::Extensions::DockerTag.content_type]}
+ unit_search(id, criteria).map { |i| i['metadata'].with_indifferent_access }
+ end
+
# Retrieves the docker image IDs for a single repository
#
# @param [String] id the ID of the repository
# @return [RestClient::Response] the set of repository docker image IDs
def docker_image_ids(id)
@@ -338,12 +358,18 @@
end
# Regenerate the applicability for consumers bound to a given set of repositories
#
# @param [String, Array] ids array of repo ids
+ # @param [boolean] parallel when true run the regeneration in parallel and return a task group
+ # tracking the summary,
+ # when false run this operation serially and return a list of
+ # spawned tasks that are to be tracked separately.
+ # False is the default option.
# @return [RestClient::Response]
- def regenerate_applicability_by_ids(ids)
+ def regenerate_applicability_by_ids(ids, parallel = false)
criteria = {
+ 'parallel' => parallel,
'repo_criteria' => { 'filters' => { 'id' => { '$in' => ids } } }
}
regenerate_applicability(criteria)
end
end