forked from digitalocean/openapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregistry_run_garbageCollection.yml
More file actions
70 lines (53 loc) · 2.29 KB
/
registry_run_garbageCollection.yml
File metadata and controls
70 lines (53 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
operationId: registry_run_garbageCollection
deprecated: true
summary: 'Start Garbage Collection'
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](https://docs.digitalocean.com/products/container-registry/how-to/clean-up-container-registry/)
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.
tags:
- Container Registry
requestBody:
required: false
content:
application/json:
schema:
$ref: 'models/registry_run_gc.yml'
parameters:
- $ref: 'parameters.yml#/registry_name'
responses:
'201':
$ref: 'responses/garbage_collection.yml'
'401':
$ref: '../../shared/responses/unauthorized.yml'
'404':
$ref: '../../shared/responses/not_found.yml'
'429':
$ref: '../../shared/responses/too_many_requests.yml'
'500':
$ref: '../../shared/responses/server_error.yml'
default:
$ref: '../../shared/responses/unexpected_error.yml'
x-codeSamples:
- $ref: 'examples/curl/registry_run_garbageCollection.yml'
- $ref: 'examples/python/registry_run_garbageCollection.yml'
security:
- bearer_auth:
- 'registry:update'