registry_garbage_collections
Creates, updates, deletes, gets or lists a registry_garbage_collections
resource.
Overview
Name | registry_garbage_collections |
Type | Resource |
Id | digitalocean.container_registry.registry_garbage_collections |
Fields
Name | Datatype | Description |
---|---|---|
blobs_deleted | integer | The number of blobs deleted as a result of this garbage collection. |
created_at | string | The time the garbage collection was created. |
freed_bytes | integer | The number of bytes freed as a result of this garbage collection. |
registry_name | string | The name of the container registry. |
status | string | The current status of this garbage collection. |
updated_at | string | The time the garbage collection was last updated. |
uuid | string | A string specifying the UUID of the garbage collection. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
registry_list_garbage_collections | SELECT | registry_name | To get information about past garbage collections for a registry, send a GET request to /v2/registry/$REGISTRY_NAME/garbage-collections . |
registry_get_garbage_collection | EXEC | registry_name | To get information about the currently-active garbage collection for a registry, send a GET request to /v2/registry/$REGISTRY_NAME/garbage-collection . |
registry_run_garbage_collection | EXEC | registry_name | 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. Set the registry to read-only mode, meaning no further write-scoped JWTs will be issued to registry clients. Existing write-scoped JWTs will continue to work until they expire which can take up to 15 minutes. Wait until all existing write-scoped JWTs have expired. Scan all registry manifests to determine which blobs are unreferenced. Delete all unreferenced blobs from the registry. Record the number of blobs deleted and bytes freed, mark the garbage collection status as success . Remove the read-only mode restriction from the registry, meaning write-scoped JWTs will once again be issued to registry clients. |
registry_update_garbage_collection | EXEC | garbage_collection_uuid, registry_name | To cancel the currently-active garbage collection for a registry, send a PUT request to /v2/registry/$REGISTRY_NAME/garbage-collection/$GC_UUID and specify one or more of the attributes below. |
SELECT
examples
To get information about past garbage collections for a registry, send a GET request to /v2/registry/$REGISTRY_NAME/garbage-collections
.
SELECT
blobs_deleted,
created_at,
freed_bytes,
registry_name,
status,
updated_at,
uuid
FROM digitalocean.container_registry.registry_garbage_collections
WHERE registry_name = '{{ registry_name }}';