Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker_manifest_lists endpoint #1240

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions nailgun/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -6938,6 +6938,8 @@ def path(self, which=None):

docker_manifests
/repositories/<id>/docker_manifests
docker_manifest_lists
/repositories/<id>/docker_manifest_lists
errata
/repositories/<id>/errata
files
Expand All @@ -6962,6 +6964,7 @@ def path(self, which=None):
"""
if which in (
'docker_manifests',
'docker_manifest_lists',
'errata',
'files',
'packages',
Expand Down Expand Up @@ -7020,6 +7023,25 @@ def docker_manifests(self, synchronous=True, timeout=None, **kwargs):
response = client.get(self.path('docker_manifests'), **kwargs)
return _handle_response(response, self._server_config, synchronous, timeout)

def docker_manifest_lists(self, synchronous=True, timeout=None, **kwargs):
"""List docker manifest lists inside repository.

:param synchronous: What should happen if the server returns an HTTP
202 (accepted) status code? Wait for the task to complete if
``True``. Immediately return the server's response otherwise.
:param timeout: Maximum number of seconds to wait until timing out.
Defaults to ``nailgun.entity_mixins.TASK_TIMEOUT``.
:param kwargs: Arguments to pass to requests.
:returns: The server's response, with all JSON decoded.
:raises: ``requests.exceptions.HTTPError`` If the server responds with
an HTTP 4XX or 5XX message.

"""
kwargs = kwargs.copy()
kwargs.update(self._server_config.get_client_kwargs())
response = client.get(self.path('docker_manifest_lists'), **kwargs)
return _handle_response(response, self._server_config, synchronous, timeout)

def delete_with_args(self, synchronous=True, timeout=None, **kwargs):
"""Delete a repository, and respect args passed to it.

Expand Down
2 changes: 2 additions & 0 deletions tests/test_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ def test_id_and_which(self):
(entities.Product, 'sync'),
(entities.PuppetClass, 'smart_class_parameters'),
(entities.Repository, 'docker_manifests'),
(entities.Repository, 'docker_manifest_lists'),
(entities.Repository, 'errata'),
(entities.Repository, 'packages'),
(entities.Repository, 'remove_content'),
Expand Down Expand Up @@ -2177,6 +2178,7 @@ def setUpClass(cls):
(entities.RHCIDeployment(**generic).deploy, 'put'),
(entities.RecurringLogic(**generic).cancel, 'post'),
(entities.Repository(**generic).docker_manifests, 'get'),
(entities.Repository(**generic).docker_manifest_lists, 'get'),
(entities.Repository(**generic).errata, 'get'),
(entities.Repository(**generic).packages, 'get'),
(entities.Repository(**generic).module_streams, 'get'),
Expand Down
Loading