diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /lib/api/project_container_repositories.rb | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'lib/api/project_container_repositories.rb')
-rw-r--r-- | lib/api/project_container_repositories.rb | 49 |
1 files changed, 42 insertions, 7 deletions
diff --git a/lib/api/project_container_repositories.rb b/lib/api/project_container_repositories.rb index c5add42decc..e5e6ccdf025 100644 --- a/lib/api/project_container_repositories.rb +++ b/lib/api/project_container_repositories.rb @@ -20,9 +20,15 @@ module API end route_setting :authentication, job_token_allowed: true, job_token_scope: :project resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do - desc 'Get a project container repositories' do + desc 'List container repositories within a project' do detail 'This feature was introduced in GitLab 11.8.' success Entities::ContainerRegistry::Repository + failure [ + { code: 401, message: 'Unauthorized' }, + { code: 404, message: 'Not Found' } + ] + is_array true + tags %w[container_registry] end params do use :pagination @@ -41,6 +47,13 @@ module API desc 'Delete repository' do detail 'This feature was introduced in GitLab 11.8.' + success status: :accepted, message: 'Success' + failure [ + { code: 401, message: 'Unauthorized' }, + { code: 404, message: 'Not Found' } + ] + is_array true + tags %w[container_registry] end params do requires :repository_id, type: Integer, desc: 'The ID of the repository' @@ -49,18 +62,20 @@ module API authorize_admin_container_image! repository.delete_scheduled! - unless Feature.enabled?(:container_registry_delete_repository_with_cron_worker) - DeleteContainerRepositoryWorker.perform_async(current_user.id, repository.id) # rubocop:disable CodeReuse/Worker - end - track_package_event('delete_repository', :container, user: current_user, project: user_project, namespace: user_project.namespace) status :accepted end - desc 'Get a list of repositories tags' do + desc 'List tags of a repository' do detail 'This feature was introduced in GitLab 11.8.' success Entities::ContainerRegistry::Tag + failure [ + { code: 401, message: 'Unauthorized' }, + { code: 404, message: 'Not Found' } + ] + is_array true + tags %w[container_registry] end params do requires :repository_id, type: Integer, desc: 'The ID of the repository' @@ -77,6 +92,13 @@ module API desc 'Delete repository tags (in bulk)' do detail 'This feature was introduced in GitLab 11.8.' + success status: :accepted, message: 'Success' + failure [ + { code: 400, message: 'Bad Request' }, + { code: 401, message: 'Unauthorized' }, + { code: 404, message: 'Not Found' } + ] + tags %w[container_registry] end params do requires :repository_id, type: Integer, desc: 'The ID of the repository' @@ -104,9 +126,15 @@ module API status :accepted end - desc 'Get a details about repository tag' do + desc 'Get details about a repository tag' do detail 'This feature was introduced in GitLab 11.8.' success Entities::ContainerRegistry::TagDetails + failure [ + { code: 400, message: 'Bad Request' }, + { code: 401, message: 'Unauthorized' }, + { code: 404, message: 'Not Found' } + ] + tags %w[container_registry] end params do requires :repository_id, type: Integer, desc: 'The ID of the repository' @@ -121,6 +149,13 @@ module API desc 'Delete repository tag' do detail 'This feature was introduced in GitLab 11.8.' + success status: :ok, message: 'Success' + failure [ + { code: 400, message: 'Bad Request' }, + { code: 401, message: 'Unauthorized' }, + { code: 404, message: 'Not Found' } + ] + tags %w[container_registry] end params do requires :repository_id, type: Integer, desc: 'The ID of the repository' |