diff options
author | Steve Azzopardi <steveazz@outlook.com> | 2018-12-04 11:50:01 +0100 |
---|---|---|
committer | Steve Azzopardi <steveazz@outlook.com> | 2018-12-07 15:33:30 +0100 |
commit | 401f65c43aa12aa712daa8ddfb00a4fb731541c8 (patch) | |
tree | a47285f34754b7339225a1baf9db2caa0ea7b7bf /doc | |
parent | 62d971129da99936a3cdc04f3740d26f16a0c7a6 (diff) | |
download | gitlab-ce-401f65c43aa12aa712daa8ddfb00a4fb731541c8.tar.gz |
Add endpoint to download single artifact by ref
Add a new endpoint
`projects/:id/jobs/artifacts/:ref_name/raw/*artifact_path?job=name`
which is the close the web URL for consistency sake. This endpoint can
be used to download a single file from artifacts for the specified ref
and job.
closes https://gitlab.com/gitlab-org/gitlab-ce/issues/54626
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/jobs.md | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/doc/api/jobs.md b/doc/api/jobs.md index aa290ff4cf8..589c48ee08d 100644 --- a/doc/api/jobs.md +++ b/doc/api/jobs.md @@ -404,7 +404,7 @@ Example response: [ce-5347]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5347 -## Download a single artifact file +## Download a single artifact file by job ID > Introduced in GitLab 10.0 @@ -438,6 +438,41 @@ Example response: | 400 | Invalid path provided | | 404 | Build not found or no file/artifacts | +## Download a single artifact file from specific tag or branch + +> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/23538) in GitLab 11.5. + +Download a single artifact file from a specific tag or branch from within the +job's artifacts archive. The file is extracted from the archive and streamed to +the client. + +``` +GET /projects/:id/jobs/artifacts/:ref_name/raw/*artifact_path?job=name +``` + +Parameters: + +| Attribute | Type | Required | Description | +|-----------------|----------------|----------|------------------------------------------------------------------------------------------------------------------| +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user. | +| `ref_name` | string | yes | Branch or tag name in repository. HEAD or SHA references are not supported. | +| `artifact_path` | string | yes | Path to a file inside the artifacts archive. | +| `job` | string | yes | The name of the job. | + +Example request: + +```sh +curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v4/projects/1/jobs/artifacts/master/raw/some/release/file.pdf?job=pdf" +``` + +Possible response status codes: + +| Status | Description | +|-----------|--------------------------------------| +| 200 | Sends a single artifact file | +| 400 | Invalid path provided | +| 404 | Build not found or no file/artifacts | + ## Get a trace file Get a trace of a specific job of a project |