---
title: pydo.registry.update_garbage_collection()
description: Update Garbage Collection
product: Reference
url: https://docs.digitalocean.com/reference/pydo/reference/registry/update_garbage_collection/
last_updated: "2026-11-06"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](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.update_garbage_collection()

Generated on 6 Nov 2026 from `pydo` version [`v0.45.0`](https://github.com/digitalocean/pydo/releases/tag/v0.45.0)

deprecated

## Usage

```python
client.registry.update_garbage_collection(
    registry_name="example",
    garbage_collection_uuid="eff0feee-49c7-4e8f-ba5c-a320c109c8a8",
    body={
        "cancel": True,
    },
)
```

Returns `JSON` Raises `HttpResponseError`

## Description

**Note: This endpoint is deprecated. Please use the [`/v2/registries`](https://docs.digitalocean.com/reference/api/reference/container-registries/index.html.md) endpoint instead.**

To cancel the currently-active garbage collection for a registry, send a PUT request to [`/v2/registry/{registry_name}/garbage-collection/{garbage_collection_uuid}`](https://docs.digitalocean.com/reference/api/reference/container-registry/index.html.md#registry_update_garbageCollection) and specify one or more of the attributes below.

## Parameters

`registry_name` string required

The name of a container registry.

`garbage_collection_uuid` string required

The UUID of a garbage collection run.

`cancel` boolean optional

Example: `True`

A boolean value indicating that the garbage collection should be cancelled.

## Request Sample

## Show Request Sample

```python
import os
from pydo import Client

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

resp = client.registry.run_garbage_collection(registry_name="example")
```

## Response Example

## Show Response Example

```json
{
  "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/{garbage_collection_uuid}`](https://docs.digitalocean.com/reference/api/reference/container-registry/index.html.md#registry_update_garbageCollection) in the API reference for additional detail on responses, headers, parameters, and more.