From e8a31d8dc2afd673ca50d74d26edab0a0fec83ca Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 7 May 2021 09:10:27 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- doc/api/packages.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'doc/api/packages.md') diff --git a/doc/api/packages.md b/doc/api/packages.md index 7ad99475515..c257105f72e 100644 --- a/doc/api/packages.md +++ b/doc/api/packages.md @@ -352,3 +352,33 @@ Can return the following status codes: - `204 No Content`, if the package was deleted successfully. - `404 Not Found`, if the package was not found. + +## Delete a package file + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/32107) in GitLab 13.12. + +WARNING: +Deleting a package file may corrupt your package making it unusable or unpullable from your package +manager client. When deleting a package file, be sure that you understand what you're doing. + +Delete a package file: + +```plaintext +DELETE /projects/:id/packages/:package_id/package_files/:package_file_id +``` + +| Attribute | Type | Required | Description | +| ----------------- | -------------- | -------- | ----------- | +| `id` | integer/string | yes | ID or [URL-encoded path of the project](README.md#namespaced-path-encoding). | +| `package_id` | integer | yes | ID of a package. | +| `package_file_id` | integer | yes | ID of a package file. | + +```shell +curl --request DELETE --header "PRIVATE-TOKEN: " "https://gitlab.example.com/api/v4/projects/:id/packages/:package_id/package_files/:package_file_id" +``` + +Can return the following status codes: + +- `204 No Content`: The package was deleted successfully. +- `403 Forbidden`: The user does not have permission to delete the file. +- `404 Not Found`: The package or package file was not found. -- cgit v1.2.3