diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-03 15:08:08 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-03 15:08:08 +0000 |
commit | 946771d0b016ae92b15a60bc3290a33b94191ffe (patch) | |
tree | 64862c2433989483f5fce45d5539242577a362eb /doc/api/admin_sidekiq_queues.md | |
parent | f1e2fca19a90a6992c2020cf8c2159cfb0b61bca (diff) | |
download | gitlab-ce-946771d0b016ae92b15a60bc3290a33b94191ffe.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/api/admin_sidekiq_queues.md')
-rw-r--r-- | doc/api/admin_sidekiq_queues.md | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/doc/api/admin_sidekiq_queues.md b/doc/api/admin_sidekiq_queues.md new file mode 100644 index 00000000000..73568581d7f --- /dev/null +++ b/doc/api/admin_sidekiq_queues.md @@ -0,0 +1,47 @@ +# Admin Sidekiq queues API + +> **Note:** This feature was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25998) in GitLab 12.9 + +Delete jobs from a Sidekiq queue that match the given +[metadata](../development/logging.md#logging-context-metadata-through-rails-or-grape-requests). + +The response has three fields: + +1. `deleted_jobs` - the number of jobs deleted by the request. +1. `queue_size` - the remaining size of the queue after processing the + request. +1. `completed` - whether or not the request was able to process the + entire queue in time. If not, retrying with the same parameters may + delete further jobs (including those added after the first request + was issued). + +This API endpoint is only available to admin users. + +``` +DELETE /admin/sidekiq/queues/:queue_name +``` + +| Attribute | Type | Required | Description | +| --------- | -------------- | -------- | ----------- | +| `queue_name` | string | yes | The name of the queue to delete jobs from | +| `user` | string | no | The username of the user who scheduled the jobs | +| `project` | string | no | The full path of the project where the jobs were scheduled from | +| `root_namespace` | string | no | The root namespace of the project | +| `subscription_plan` | string | no | The subscription plan of the root namespace (GitLab.com only) | +| `caller_id` | string | no | The endpoint or background job that schedule the job (for example: `ProjectsController#create`, `/api/:version/projects/:id`, `PostReceive`) | + +At least one attribute, other than `queue_name`, is required. + +```shell +curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/admin/sidekiq/queues/authorized_projects?user=root +``` + +Example response: + +```json +{ + "completed": true, + "deleted_jobs": 7, + "queue_size": 14 +} +``` |