diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-15 00:08:29 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-15 00:08:29 +0000 |
commit | 38b948a54e00841b51c446beb0adf079af60c963 (patch) | |
tree | 2e9dfe54e2d0ec444223f773dc283b1c639baae9 /lib/api/package_files.rb | |
parent | 7f35b02e86cd3d2e8b4a81c5c3a8483ff6973c5a (diff) | |
download | gitlab-ce-38b948a54e00841b51c446beb0adf079af60c963.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/package_files.rb')
-rw-r--r-- | lib/api/package_files.rb | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/api/package_files.rb b/lib/api/package_files.rb index bf1cd88c18c..bb9f96cdbb1 100644 --- a/lib/api/package_files.rb +++ b/lib/api/package_files.rb @@ -8,19 +8,23 @@ module API authorize_packages_access!(user_project) end + PACKAGE_FILES_TAGS = %w[package_files].freeze + feature_category :package_registry urgency :low helpers ::API::Helpers::PackagesHelpers params do - requires :id, types: [String, Integer], desc: 'The ID or URL-encoded path of the project' - requires :package_id, type: Integer, desc: 'The ID of a package' + requires :id, types: [String, Integer], desc: 'ID or URL-encoded path of the project' + requires :package_id, type: Integer, desc: 'ID of a package' end resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do - desc 'Get all package files' do - detail 'This feature was introduced in GitLab 11.8' + desc 'List package files' do + detail 'Get a list of package files of a single package' success ::API::Entities::PackageFile + is_array true + tags PACKAGE_FILES_TAGS end params do use :pagination @@ -35,11 +39,17 @@ module API present paginate(package_files), with: ::API::Entities::PackageFile end - desc 'Remove a package file' do + desc 'Delete a package file' do detail 'This feature was introduced in GitLab 13.12' + success code: 204 + failure [ + { code: 403, message: 'Forbidden' }, + { code: 404, message: 'Not found' } + ] + tags PACKAGE_FILES_TAGS end params do - requires :package_file_id, type: Integer, desc: 'The ID of a package file' + requires :package_file_id, type: Integer, desc: 'ID of a package file' end delete ':id/packages/:package_id/package_files/:package_file_id' do authorize_destroy_package!(user_project) |