[ Web Proxy ]
URL:
Viewing: https://docs.digitalocean.com/reference/pydo/reference/registry/run_garbage_collection/ [Back]  [Original]

pydo.registry.run_garbage_collection() | DigitalOcean Documentation

For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).

pydo.registry.run_garbage_collection()

Generated on 3 Aug 2026 from pydo version v0.40.0

Copy page as Markdown View page as Markdown

deprecated

Usage

client.registry.run_garbage_collection(
    registry_name="example",
    body={
        "type": "unreferenced blobs only",
    },
)
Returns JSONRaises HttpResponseError

Description

Note: This endpoint is deprecated. Please use the /v2/registries endpoint instead.

Garbage collection enables users to clear out unreferenced blobs (layer & manifest data) after deleting one or more manifests from a repository. If there are no unreferenced blobs resulting from the deletion of one or more manifests, garbage collection is effectively a noop. See here for more information about how and why you should clean up your container registry periodically.

To request a garbage collection run on your registry, send a POST request to /v2/registry/{registry_name}/garbage-collection. This will initiate the following sequence of events on your registry.

Parameters

registry_name string required

The name of a container registry.

type string optional

Type of the garbage collection to run against this registry

One of: untagged manifests only, unreferenced blobs only, untagged manifests and unreferenced blobs

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
      "type": "unreferenced blobs only"
      
}

resp = client.registry.run_garbage_collection(registry_name="example",body=req)

Response Example

Show Response Example
{
  "garbage_collection": {
    "uuid": "eff0feee-49c7-4e8f-ba5c-a320c109c8a8",
    "registry_name": "example",
    "status": "requested",
    "created_at": "2020-10-30T21:03:24Z",
    "updated_at": "2020-10-30T21:03:44Z",
    "blobs_deleted": 42,
    "freed_bytes": 667
  }
}

More Information

See /v2/registry/{registry_name}/garbage-collection in the API reference for additional detail on responses, headers, parameters, and more.

In this article...


We can't find any results for your search.

Try using different keywords or simplifying your search terms.


Web Proxy Viewer  |  New URL  |  Original Page