uptainer.providers.dockerhub¶
- class uptainer.providers.dockerhub.DockerHub(log: BoundLoggerLazyProxy)[source]¶
Bases:
BaseProvider- __init__(log: BoundLoggerLazyProxy) None[source]¶
DockerHub provider for getting the information from it.
- Parameters:
log (BoundLoggerLazyProxy) – Log class to inject into the vars. Class: structlog
- Returns:
None
- get_image_versions(parent: str, project: str) TyperImageVersion[source]¶
Query the DockerHub API in order to get the images version availables and return a list of it.
- Parameters:
parent (str) – Namespace or User in DockerHub
project (str) – Project Name
- Returns:
{‘error’: <bool>, ‘data’: [{‘last_update’: ‘<datetime object>”, ‘name’: [‘<version1>’, …]},]}
- Return type:
Return a dict that have image metadata like
- get_metadata(image_repository: str) TyperMetadata[source]¶
Getting the DockerHub metadata like user and orgs.
- Parameters:
image_repository (str) – Url on docker.io in order to detect the needed data.
- Returns:
{“error”: <bool>, “data”: {“parent”: “<organization name or user>”, “project”: “<project name>”}}
- Return type:
Return a dict that have image metadata like