Skip to content

Resolve "[Resource group API] Get all resource groups in a project"

What does this MR do and why?

Adds an endpoint to fetch all resource groups in a project - /project/:id/resource_groups

Performance considerations

ci_resource_groups already has an index on project_id which is sufficient for this endpoint

Screenshots or screen recordings

Output from endpoint

[
	{
		"id": 1,
		"key": "test",
		"process_mode": "unordered",
		"created_at": "2022-04-28T18:37:40.587Z",
		"updated_at": "2022-04-28T18:37:40.587Z"
	}
]

How to set up and validate locally

Hit the endpoint with curl or any REST client

curl --request GET \
  --url 'http://<GITLAB_HOST>/api/v4/projects/<PROJECT_ID>/resource_groups' \
  --header 'Authorization: Bearer <ACCESS_TOKEN>'

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #360619 (closed)

Edited by Allen Cook

Merge request reports

Loading