diff options
Diffstat (limited to 'lib/api/ci/resource_groups.rb')
-rw-r--r-- | lib/api/ci/resource_groups.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/api/ci/resource_groups.rb b/lib/api/ci/resource_groups.rb index 616bec499d4..e3fd887475a 100644 --- a/lib/api/ci/resource_groups.rb +++ b/lib/api/ci/resource_groups.rb @@ -3,14 +3,29 @@ module API module Ci class ResourceGroups < ::API::Base + include PaginationParams + before { authenticate! } feature_category :continuous_delivery + urgency :low params do requires :id, type: String, desc: 'The ID of a project' end resource :projects, requirements: ::API::API::NAMESPACE_OR_PROJECT_REQUIREMENTS do + desc 'Get all resource groups for this project' do + success Entities::Ci::ResourceGroup + end + params do + use :pagination + end + get ':id/resource_groups' do + authorize! :read_resource_group, user_project + + present paginate(user_project.resource_groups), with: Entities::Ci::ResourceGroup + end + desc 'Get a single resource group' do success Entities::Ci::ResourceGroup end |