diff options
Diffstat (limited to 'doc/api/container_registry.md')
-rw-r--r-- | doc/api/container_registry.md | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/doc/api/container_registry.md b/doc/api/container_registry.md index e4687994017..3a7ebf9a2aa 100644 --- a/doc/api/container_registry.md +++ b/doc/api/container_registry.md @@ -23,9 +23,8 @@ GET /projects/:id/registry/repositories | Attribute | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) accessible by the authenticated user. | -| `tags` | boolean | no | If the parameter is included as true, each repository will include an array of `"tags"` in the response. | -| `name` | string | no | Returns a list of repositories with a name that matches the value. ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/29763) in GitLab 13.0). | -| `tags_count` | boolean | no | If the parameter is included as true, each repository will include `"tags_count"` in the response ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/32141) in GitLab 13.1). | +| `tags` | boolean | no | If the parameter is included as true, each repository includes an array of `"tags"` in the response. | +| `tags_count` | boolean | no | If the parameter is included as true, each repository includes `"tags_count"` in the response ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/32141) in GitLab 13.1). | ```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories" @@ -41,7 +40,8 @@ Example response: "path": "group/project", "project_id": 9, "location": "gitlab.example.com:5000/group/project", - "created_at": "2019-01-10T13:38:57.391Z" + "created_at": "2019-01-10T13:38:57.391Z", + "cleanup_policy_started_at": "2020-01-10T15:40:57.391Z" }, { "id": 2, @@ -49,7 +49,8 @@ Example response: "path": "group/project/releases", "project_id": 9, "location": "gitlab.example.com:5000/group/project/releases", - "created_at": "2019-01-10T13:39:08.229Z" + "created_at": "2019-01-10T13:39:08.229Z", + "cleanup_policy_started_at": "2020-08-17T03:12:35.489Z" } ] ``` @@ -65,9 +66,8 @@ GET /groups/:id/registry/repositories | Attribute | Type | Required | Description | | --------- | ---- | -------- | ----------- | | `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) accessible by the authenticated user. | -| `tags` | boolean | no | If the parameter is included as true, each repository will include an array of `"tags"` in the response. | -| `name` | string | no | Returns a list of repositories with a name that matches the value. ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/29763) in GitLab 13.0). | -| `tags_count` | boolean | no | If the parameter is included as true, each repository will include `"tags_count"` in the response ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/32141) in GitLab 13.1). | +| `tags` | boolean | no | If the parameter is included as true, each repository includes an array of `"tags"` in the response. | +| `tags_count` | boolean | no | If the parameter is included as true, each repository includes `"tags_count"` in the response ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/32141) in GitLab 13.1). | ```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/2/registry/repositories?tags=1&tags_count=true" @@ -84,6 +84,7 @@ Example response: "project_id": 9, "location": "gitlab.example.com:5000/group/project", "created_at": "2019-01-10T13:38:57.391Z", + "cleanup_policy_started_at": "2020-08-17T03:12:35.489Z", "tags_count": 1, "tags": [ { @@ -100,6 +101,7 @@ Example response: "project_id": 11, "location": "gitlab.example.com:5000/group/other_project", "created_at": "2019-01-10T13:39:08.229Z", + "cleanup_policy_started_at": "2020-01-10T15:40:57.391Z", "tags_count": 3, "tags": [ { @@ -228,7 +230,7 @@ DELETE /projects/:id/registry/repositories/:repository_id/tags/:tag_name curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/registry/repositories/2/tags/v10.0.0" ``` -This action does not delete blobs. In order to delete them and recycle disk space, +This action doesn't delete blobs. To delete them and recycle disk space, [run the garbage collection](https://docs.gitlab.com/omnibus/maintenance/README.html#removing-unused-layers-not-referenced-by-manifests). ## Delete registry repository tags in bulk @@ -248,28 +250,29 @@ DELETE /projects/:id/registry/repositories/:repository_id/tags | `repository_id` | integer | yes | The ID of registry repository. | | `name_regex` | string | no | The [re2](https://github.com/google/re2/wiki/Syntax) regex of the name to delete. To delete all tags specify `.*`. **Note:** `name_regex` is deprecated in favor of `name_regex_delete`. This field is validated. | | `name_regex_delete` | string | yes | The [re2](https://github.com/google/re2/wiki/Syntax) regex of the name to delete. To delete all tags specify `.*`. This field is validated. | -| `name_regex_keep` | string | no | The [re2](https://github.com/google/re2/wiki/Syntax) regex of the name to keep. This value will override any matches from `name_regex_delete`. This field is validated. Note: setting to `.*` will result in a no-op. | +| `name_regex_keep` | string | no | The [re2](https://github.com/google/re2/wiki/Syntax) regex of the name to keep. This value overrides any matches from `name_regex_delete`. This field is validated. Note: setting to `.*` results in a no-op. | | `keep_n` | integer | no | The amount of latest tags of given name to keep. | | `older_than` | string | no | Tags to delete that are older than the given time, written in human readable form `1h`, `1d`, `1month`. | This API call performs the following operations: -1. It orders all tags by creation date. The creation date is the time of the - manifest creation, not the time of tag push. -1. It removes only the tags matching the given `name_regex_delete` (or deprecated `name_regex`), keeping any that match `name_regex_keep`. -1. It never removes the tag named `latest`. -1. It keeps N latest matching tags (if `keep_n` is specified). -1. It only removes tags that are older than X amount of time (if `older_than` is specified). -1. It schedules the asynchronous job to be executed in the background. - -These operations are executed asynchronously and it might -take time to get executed. You can run this at most -once an hour for a given container repository. -This action does not delete blobs. In order to delete them and recycle disk space, +- It orders all tags by creation date. The creation date is the time of the + manifest creation, not the time of tag push. +- It removes only the tags matching the given `name_regex_delete` (or deprecated + `name_regex`), keeping any that match `name_regex_keep`. +- It never removes the tag named `latest`. +- It keeps N latest matching tags (if `keep_n` is specified). +- It only removes tags that are older than X amount of time (if `older_than` is + specified). +- It schedules the asynchronous job to be executed in the background. + +These operations are executed asynchronously and can take time to get executed. +You can run this at most once an hour for a given container repository. This +action doesn't delete blobs. To delete them and recycle disk space, [run the garbage collection](https://docs.gitlab.com/omnibus/maintenance/README.html#removing-unused-layers-not-referenced-by-manifests). NOTE: **Note:** -Since GitLab 12.4, individual tags are deleted. +In GitLab 12.4 and later, individual tags are deleted. For more details, see the [discussion](https://gitlab.com/gitlab-org/gitlab/-/issues/15737). Examples: |