Skip to content

Add REST endpoint to create runner associated to a user

Pedro Pombeiro requested to merge pedropombeiro/390427/add-rest-endpoint into master

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR adds a REST endpoint to create runner associated to a user. This is the REST equivalent to the GraphQL: Create group and project runners in ru... (!115890 - merged), and will support the new workflow to create CI runners from the UI (as specified in https://docs.gitlab.com/ee/architecture/blueprints/runner_tokens/#details).

Closes #390427 (closed)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Create a PAT at http://gdk.test:3000/-/profile/personal_access_tokens and assign it to GITLAB_GDK_TOKEN.

xh -v POST http://gdk.test:3000/api/v4/user/runners runner_type=instance_type PRIVATE-TOKEN:$GITLAB_GDK_TOKEN

or

curl -v -X POST http://gdk.test:3000/api/v4/user/runners -H "private-token: $GITLAB_GDK_TOKEN" -H 'content-type: application/json' -H 'accept: application/json, */*;q=0.5' -d '{"runner_type":"group_type","namespace_id":"24"}'

The server should respond with a runner token for the newly-created runner.

MR acceptance checklist

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

Edited by Pedro Pombeiro

Merge request reports

Loading