Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9f01ee5

Browse files
committed
docs(api-docs): update artifact download iterator example
Adapted the example for the new iterator=True argument
1 parentec61e73 commit9f01ee5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎docs/gl_objects/pipelines_and_jobs.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,15 +276,15 @@ You can also directly stream the output into a file, and unzip it afterwards::
276276

277277
Or, you can also use the underlying response iterator directly::
278278

279-
artifact_bytes_iterator = build_or_job.artifacts(streamed=True, action='iterator')
279+
artifact_bytes_iterator = build_or_job.artifacts(iterator=True)
280280

281281
This can be used with frameworks that expect an iterator (such as FastAPI/Starlette's
282282
``StreamingResponse``) to forward a download from GitLab without having to download
283283
the entire content server-side first::
284284

285285
@app.get("/download_artifact")
286286
def download_artifact():
287-
artifact_bytes_iterator = build_or_job.artifacts(streamed=True, action='iterator')
287+
artifact_bytes_iterator = build_or_job.artifacts(iterator=True)
288288
return StreamingResponse(artifact_bytes_iterator, media_type="application/zip")
289289

290290
Delete all artifacts of a project that can be deleted::

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp