diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 20:02:30 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 20:02:30 +0000 |
commit | 41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch) | |
tree | 9c8d89a8624828992f06d892cd2f43818ff5dcc8 /doc/api/jobs.md | |
parent | 0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff) | |
download | gitlab-ce-41fe97390ceddf945f3d967b8fdb3de4c66b7dea.tar.gz |
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'doc/api/jobs.md')
-rw-r--r-- | doc/api/jobs.md | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/doc/api/jobs.md b/doc/api/jobs.md index 89018548f5f..85cdf7d892a 100644 --- a/doc/api/jobs.md +++ b/doc/api/jobs.md @@ -474,7 +474,7 @@ Example of response } ``` -## Get GitLab Agent by `CI_JOB_TOKEN` **(PREMIUM)** +## Get GitLab agent by `CI_JOB_TOKEN` **(PREMIUM)** > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/324269) in GitLab 13.11. @@ -814,7 +814,7 @@ NOTE: You can't delete archived jobs with the API, but you can [delete job artifacts and logs from jobs completed before a specific date](../administration/job_artifacts.md#delete-job-artifacts-and-logs-from-jobs-completed-before-a-specific-date) -## Play a job +## Run a job Triggers a manual action to start a job. @@ -822,16 +822,38 @@ Triggers a manual action to start a job. POST /projects/:id/jobs/:job_id/play ``` -| Attribute | Type | Required | Description | -|-----------|----------------|------------------------|-------------| -| `id` | integer/string | **{check-circle}** Yes | ID or [URL-encoded path of the project](index.md#namespaced-path-encoding) owned by the authenticated user. | -| `job_id` | integer | **{check-circle}** Yes | ID of a job. | +| Attribute | Type | Required | Description | +|----------------------------|-----------------|------------------------|-------------| +| `id` | integer/string | **{check-circle}** Yes | ID or [URL-encoded path of the project](index.md#namespaced-path-encoding) owned by the authenticated user. | +| `job_id` | integer | **{check-circle}** Yes | ID of a job. | +| `job_variables_attributes` | array of hashes | **{dotted-circle}** No | An array containing the custom variables available to the job. [Introduced in](https://gitlab.com/gitlab-org/gitlab/-/issues/37267) GitLab 14.9. | + +Example request: ```shell -curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/jobs/1/play" +curl --request POST "https://gitlab.example.com/api/v4/projects/1/jobs/1/play + --header "PRIVATE-TOKEN: <your_access_token>" + --data @variables.json ``` -Example of response +`@variables.json` is structured like: + +```json +{ + "job_variables_attributes": [ + { + "key": "TEST_VAR_1", + "value": "test1" + }, + { + "key": "TEST_VAR_2", + "value": "test2" + } + ] +} +``` + +Example response: ```json { |