# Content removal of pushed images Given that the user has the according permissions he can manage removal of pushed images to the regisry. ### Delete Namespace ``` http :24817/pulp/api/v3/pulp_container/namespaces/ HTTP/1.1 200 OK Access-Control-Expose-Headers: Correlation-ID Allow: GET, POST, HEAD, OPTIONS Connection: close Content-Length: 204 Content-Type: application/json Correlation-ID: f23d4bef3feb48048c47d2e42470c98d Date: Tue, 25 May 2021 15:30:50 GMT Server: gunicorn Vary: Accept, Cookie X-Frame-Options: SAMEORIGIN { "count": 1, "next": null, "previous": null, "results": [ { "name": "ipanova", "pulp_created": "2021-05-25T15:25:34.690420Z", "pulp_href": "/pulp/api/v3/pulp_container/namespaces/fe27c8cf-5ff3-401b-8e02-604a49d0eeaa/" } ] } ``` Will delete the namespace, all distributions under it, and push repositories. Example: ipanova/test ipanova/dev ipanova/prod Deletion of namespace `ipanova` will take down everything under it. ``` http DELETE :24817/pulp/api/v3/pulp_container/namespaces/fe27c8cf-5ff3-401b-8e02-604a49d0eeaa/ ``` ### Delete specific distribution ``` $ http :24817/pulp/api/v3/distributions/container/container/ HTTP/1.1 200 OK Access-Control-Expose-Headers: Correlation-ID Allow: GET, POST, HEAD, OPTIONS Connection: close Content-Length: 667 Content-Type: application/json Correlation-ID: 8e55f477719e4f28b4ba471b11172d8d Date: Tue, 25 May 2021 15:25:44 GMT Server: gunicorn Vary: Accept, Cookie X-Frame-Options: SAMEORIGIN { "count": 1, "next": null, "previous": null, "results": [ { "base_path": "ipanova/test", "content_guard": "/pulp/api/v3/contentguards/container/content_redirect/3d51f84d-fe98-4b0d-9141-6145585d95e9/", "description": null, "name": "ipanova/test", "namespace": "/pulp/api/v3/pulp_container/namespaces/fe27c8cf-5ff3-401b-8e02-604a49d0eeaa/", "private": false, "pulp_created": "2021-05-25T15:25:34.820810Z", "pulp_href": "/pulp/api/v3/distributions/container/container/869a7f3e-d46f-4d7a-ae3d-7b87ac2c3204/", "pulp_labels": {}, "registry_path": "localhost:24817/ipanova/test", "repository": "/pulp/api/v3/repositories/container/container-push/df019286-a909-4da0-89c6-4d6aed9f8f04/", "repository_version": null } ] } ``` Deletion of the distribution that has base_path `ipanova/test` will remove automatically also entire push-repo that contains multiple images. Namespace will stay intact. ``` http DELETE :24817/pulp/api/v3/distributions/container/container/869a7f3e-d46f-4d7a-ae3d-7b87ac2c3204/ ``` ### Delete a specific image from a repository. Content that is being served by distribution can be inspected in the push-repository ``` $ http :24817/pulp/api/v3/repositories/container/container-push/ HTTP/1.1 200 OK Access-Control-Expose-Headers: Correlation-ID Allow: GET, HEAD, OPTIONS Connection: close Content-Length: 535 Content-Type: application/json Correlation-ID: bd466305a60443e3ac06887aa203603a Date: Tue, 25 May 2021 15:34:42 GMT Server: gunicorn Vary: Accept, Cookie X-Frame-Options: SAMEORIGIN { "count": 1, "next": null, "previous": null, "results": [ { "description": null, "latest_version_href": "/pulp/api/v3/repositories/container/container-push/620acaf7-e2ae-4e2f-a3e0-b0907fd42f46/versions/3/", "name": "ipanova/test", "pulp_created": "2021-05-25T15:34:20.024914Z", "pulp_href": "/pulp/api/v3/repositories/container/container-push/620acaf7-e2ae-4e2f-a3e0-b0907fd42f46/", "pulp_labels": {}, "remote": null, "retained_versions": null, "versions_href": "/pulp/api/v3/repositories/container/container-push/620acaf7-e2ae-4e2f-a3e0-b0907fd42f46/versions/" } ] } $ http :24817/pulp/api/v3/repositories/container/container-push/620acaf7-e2ae-4e2f-a3e0-b0907fd42f46/versions/3/ HTTP/1.1 200 OK Access-Control-Expose-Headers: Correlation-ID Allow: GET, DELETE, HEAD, OPTIONS Connection: close Content-Length: 1349 Content-Type: application/json Correlation-ID: bca00af95baa446aa73c45388e5682c7 Date: Tue, 25 May 2021 15:35:27 GMT Server: gunicorn Vary: Accept, Cookie X-Frame-Options: SAMEORIGIN { "base_version": null, "content_summary": { "added": { "container.manifest": { "count": 1, "href": "/pulp/api/v3/content/container/manifests/?repository_version_added=/pulp/api/v3/repositories/container/container-push/620acaf7-e2ae-4e2f-a3e0-b0907fd42f46/versions/3/" }, "container.tag": { "count": 1, "href": "/pulp/api/v3/content/container/tags/?repository_version_added=/pulp/api/v3/repositories/container/container-push/620acaf7-e2ae-4e2f-a3e0-b0907fd42f46/versions/3/" } }, "present": { "container.blob": { "count": 2, "href": "/pulp/api/v3/content/container/blobs/?repository_version=/pulp/api/v3/repositories/container/container-push/620acaf7-e2ae-4e2f-a3e0-b0907fd42f46/versions/3/" }, "container.manifest": { "count": 1, "href": "/pulp/api/v3/content/container/manifests/?repository_version=/pulp/api/v3/repositories/container/container-push/620acaf7-e2ae-4e2f-a3e0-b0907fd42f46/versions/3/" }, "container.tag": { "count": 1, "href": "/pulp/api/v3/content/container/tags/?repository_version=/pulp/api/v3/repositories/container/container-push/620acaf7-e2ae-4e2f-a3e0-b0907fd42f46/versions/3/" } }, "removed": {} }, "number": 3, "pulp_created": "2021-05-25T15:34:22.810077Z", "pulp_href": "/pulp/api/v3/repositories/container/container-push/620acaf7-e2ae-4e2f-a3e0-b0907fd42f46/versions/3/", "repository": "/pulp/api/v3/repositories/container/container-push/620acaf7-e2ae-4e2f-a3e0-b0907fd42f46/" } ``` Find the image you want to remove. ``` $ http :24817/pulp/api/v3/content/container/manifests/?repository_version=/pulp/api/v3/repositories/container/container-push/620acaf7-e2ae-4e2f-a3e0-b0907fd42f46/versions/3/ HTTP/1.1 200 OK Access-Control-Expose-Headers: Correlation-ID Allow: GET, HEAD, OPTIONS Connection: close Content-Length: 635 Content-Type: application/json Correlation-ID: 7487ed29d42745c4b5df40271338fe1e Date: Tue, 25 May 2021 15:39:43 GMT Server: gunicorn Vary: Accept, Cookie X-Frame-Options: SAMEORIGIN { "count": 1, "next": null, "previous": null, "results": [ { "artifact": "/pulp/api/v3/artifacts/3850f77a-2d43-4bf6-8a26-8a19d9000e65/", "blobs": [ "/pulp/api/v3/content/container/blobs/a04d6065-6f04-4865-87fd-9bfc61fd314c/" ], "config_blob": "/pulp/api/v3/content/container/blobs/d9778463-c637-4785-85cc-082ec9153fa9/", "digest": "sha256:223a1d721d8ed8f625d03969c14e858afd714822875d536086c78514a04a544e", "listed_manifests": [], "media_type": "application/vnd.docker.distribution.manifest.v2+json", "pulp_created": "2021-05-12T16:32:26.868135Z", "pulp_href": "/pulp/api/v3/content/container/manifests/4fb6b115-a55e-414c-955e-d6a5a8b70b23/", "schema_version": 2 } ] } ``` The image is removed by digest. ``` http POST :24817/pulp/api/v3/repositories/container/container-push/620acaf7-e2ae-4e2f-a3e0-b0907fd42f46/remove_image/ digest='sha256:223a1d721d8ed8f625d03969c14e858afd714822875d536086c78514a04a544e' ``` ### Trigger orphan cleanup (purge) This will call will delete artifacts from the filesystem. It can triggered by admin only. ``` http DELETE :24817/pulp/api/v3/orphans/ ```