diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-25 21:10:56 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-25 21:10:56 +0300 |
commit | d612723c35d7fdaeb8b09e91232053e04850c2ae (patch) | |
tree | 0a55d7d5dcb3745f60b25aabe508c27a734a9e37 /lib | |
parent | 35e5a7c8455f916bc969ec814c74cefd98d24f19 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/api.rb | 2 | ||||
-rw-r--r-- | lib/api/helm_packages.rb | 39 |
2 files changed, 34 insertions, 7 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb index ae830e13b91..2a671c240cb 100644 --- a/lib/api/api.rb +++ b/lib/api/api.rb @@ -216,6 +216,7 @@ module API mount ::API::GroupImport mount ::API::GroupPackages mount ::API::GroupVariables + mount ::API::HelmPackages mount ::API::ImportBitbucketServer mount ::API::ImportGithub mount ::API::Integrations @@ -300,7 +301,6 @@ module API mount ::API::GroupLabels mount ::API::GroupMilestones mount ::API::Groups - mount ::API::HelmPackages mount ::API::Issues mount ::API::Labels mount ::API::MavenPackages diff --git a/lib/api/helm_packages.rb b/lib/api/helm_packages.rb index 2e493eee7f8..8260d8a88f8 100644 --- a/lib/api/helm_packages.rb +++ b/lib/api/helm_packages.rb @@ -32,15 +32,21 @@ module API end params do - requires :id, type: String, desc: 'The ID or full path of a project' + requires :id, types: [Integer, String], desc: 'The ID or full path of a project' end resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do namespace ':id/packages/helm', requirements: HELM_REQUIREMENTS do desc 'Download a chart index' do detail 'This feature was introduced in GitLab 14.0' + success code: 200 + failure [ + { code: 401, message: 'Unauthorized' }, + { code: 403, message: 'Forbidden' } + ] + tags %w[helm_packages] end params do - requires :channel, type: String, desc: 'Helm channel', regexp: Gitlab::Regex.helm_channel_regex + requires :channel, type: String, desc: 'Helm channel', regexp: Gitlab::Regex.helm_channel_regex, documentation: { example: 'stable' } end get ":channel/index.yaml" do @@ -56,10 +62,17 @@ module API desc 'Download a chart' do detail 'This feature was introduced in GitLab 14.0' + success code: 200 + failure [ + { code: 401, message: 'Unauthorized' }, + { code: 403, message: 'Forbidden' }, + { code: 404, message: 'Not Found' } + ] + tags %w[helm_packages] end params do - requires :channel, type: String, desc: 'Helm channel', regexp: Gitlab::Regex.helm_channel_regex - requires :file_name, type: String, desc: 'Helm package file name' + requires :channel, type: String, desc: 'Helm channel', regexp: Gitlab::Regex.helm_channel_regex, documentation: { example: 'stable' } + requires :file_name, type: String, desc: 'Helm package file name', documentation: { example: 'mychart' } end get ":channel/charts/:file_name.tgz" do project = authorized_user_project(action: :read_package) @@ -74,9 +87,16 @@ module API desc 'Authorize a chart upload from workhorse' do detail 'This feature was introduced in GitLab 14.0' + success code: 200 + failure [ + { code: 401, message: 'Unauthorized' }, + { code: 403, message: 'Forbidden' }, + { code: 404, message: 'Not Found' } + ] + tags %w[helm_packages] end params do - requires :channel, type: String, desc: 'Helm channel', regexp: Gitlab::Regex.helm_channel_regex + requires :channel, type: String, desc: 'Helm channel', regexp: Gitlab::Regex.helm_channel_regex, documentation: { example: 'stable' } end post "api/:channel/charts/authorize" do authorize_workhorse!( @@ -88,9 +108,16 @@ module API desc 'Upload a chart' do detail 'This feature was introduced in GitLab 14.0' + success code: 201 + failure [ + { code: 401, message: 'Unauthorized' }, + { code: 403, message: 'Forbidden' }, + { code: 404, message: 'Not Found' } + ] + tags %w[helm_packages] end params do - requires :channel, type: String, desc: 'Helm channel', regexp: Gitlab::Regex.helm_channel_regex + requires :channel, type: String, desc: 'Helm channel', regexp: Gitlab::Regex.helm_channel_regex, documentation: { example: 'stable' } requires :chart, type: ::API::Validations::Types::WorkhorseFile, desc: 'The chart file to be published (generated by Multipart middleware)', documentation: { type: 'file' } end post "api/:channel/charts" do |