RSPImageTagCollection#
- class nublado.controller.models.domain.rsptag.RSPImageTagCollection(tags)#
Bases:
GenericHold and perform operations on a set of
RSPImageTagobjects.- Parameters:
tags (
Iterable[TypeVar(T, bound=RSPImageTag)]) –RSPImageTagobjects to store.
Methods Summary
add(tag)Add a tag to the collection.
all_tags(*[, hide_arch_specific])Iterate over all tags.
filter(policy, age_basis, *[, ...])Apply a filter policy and return the remaining tags.
from_tag_names(tag_names, aliases[, cycle])Create a collection from tag strings.
latest(image_type)Get the latest tag of a given type.
subset(*[, releases, weeklies, dailies, ...])Return a subset of the tag collection.
tag_for_tag_name(tag_name)Look up a tag by tag name.
Methods Documentation
- add(tag)#
Add a tag to the collection.
- Parameters:
tag (
TypeVar(T, bound=RSPImageTag)) – The tag to add.- Return type:
- all_tags(*, hide_arch_specific=True)#
Iterate over all tags.
- Parameters:
hide_arch_specific (
bool, default:True) – IfTrue, hide tags for a specific architecture and only include tags for all supported architectures.- Yields:
RSPImageTag – Each tag in sorted order.
- Return type:
Iterator[TypeVar(T, bound=RSPImageTag)]
- filter(policy, age_basis, *, remove_arch_specific=True)#
Apply a filter policy and return the remaining tags.
- Parameters:
policy (
RSPImageFilterPolicy) – Policy governing tag filtering.age_basis (
datetime) – Timestamp to use as basis for image age calculation.remove_arch_specific (
bool, default:True) – IfTrue, remove tags for a specific architecture and only include tags for all supported architectures.
- Yields:
RSPImageTag – Next tag allowed under the policy.
- Return type:
Iterator[TypeVar(T, bound=RSPImageTag)]
- classmethod from_tag_names(tag_names, aliases, cycle=None)#
Create a collection from tag strings.
- Parameters:
- Returns:
The resulting collection of tags.
- Return type:
- latest(image_type)#
Get the latest tag of a given type.
- Parameters:
image_type (
RSPImageType) – Image type to retrieve.- Returns:
Latest tag of that type, if any.
- Return type:
RSPImageTag or None
- subset(*, releases=0, weeklies=0, dailies=0, include=None, remove_arch_specific=True)#
Return a subset of the tag collection.
- Parameters:
releases (
int, default:0) – Number of releases to include.weeklies (
int, default:0) – Number of weeklies to include.dailies (
int, default:0) – Number of dailies to include.include (
Optional[set[str]], default:None) – Include this list of tags even if they don’t meet other criteria.remove_arch_specific (
bool, default:True) – IfTrue, remove tags for a specific architecture and only include tags for all supported architectures.
- Returns:
The desired subset.
- Return type: