diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
commit | 3b1af5cc7ed2666ff18b718ce5d30fa5a2756674 (patch) | |
tree | 3bc4a40e0ee51ec27eabf917c537033c0c5b14d4 /lib/api/concerns/packages/nuget/public_endpoints.rb | |
parent | 9bba14be3f2c211bf79e15769cd9b77bc73a13bc (diff) |
Add latest changes from gitlab-org/gitlab@16-1-stable-eev16.1.0-rc42
Diffstat (limited to 'lib/api/concerns/packages/nuget/public_endpoints.rb')
-rw-r--r-- | lib/api/concerns/packages/nuget/public_endpoints.rb | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/api/concerns/packages/nuget/public_endpoints.rb b/lib/api/concerns/packages/nuget/public_endpoints.rb new file mode 100644 index 00000000000..37b503212d9 --- /dev/null +++ b/lib/api/concerns/packages/nuget/public_endpoints.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# NuGet Package Manager Client API + +# These API endpoints are not consumed directly by users, so there is no documentation for the +# individual endpoints. They are called by the NuGet package manager client when users run commands +# like `nuget install` or `nuget push`. The usage of the GitLab NuGet registry is documented here: +# https://docs.gitlab.com/ee/user/packages/nuget_repository/ + +module API + module Concerns + module Packages + module Nuget + module PublicEndpoints + extend ActiveSupport::Concern + + included do + # https://docs.microsoft.com/en-us/nuget/api/service-index + desc 'The NuGet Service Index' do + detail 'This feature was introduced in GitLab 12.6' + success code: 200, model: ::API::Entities::Nuget::ServiceIndex + failure [ + { code: 404, message: 'Not Found' } + ] + tags %w[nuget_packages] + end + get 'index', format: :json, urgency: :default do + track_package_event( + 'cli_metadata', + :nuget, + **snowplow_gitlab_standard_context_without_auth.merge(category: 'API::NugetPackages') + ) + + present ::Packages::Nuget::ServiceIndexPresenter.new(project_or_group_without_auth), + with: ::API::Entities::Nuget::ServiceIndex + end + end + end + end + end + end +end |