메인 콘텐츠로 건너뛰기
POST
Get a scoped upload URL for private content

인증

Authorization
string
header
필수

A workspace-scoped Cloud JWT. A missing or invalid token is 401 UNAUTHORIZED in the Error body.

본문

application/json
kind
enum<string>
필수
사용 가능한 옵션:
node_zip,
model
filename
string
필수
sizeBytes
integer<int64>
필수

Size of the file in bytes. A node_zip can be at most 2 GiB (2147483648 bytes), the most a build installs; a larger one answers 400.

sha256
string
필수
blake3
string

Optional BLAKE3 digest of the same bytes, 64 hex characters. Sealed into the release manifest beside sha256, so a deploy can verify the staged file with whichever hash it holds.

reuse
boolean
기본값:false

True lets the answer be a blob the workspace already holds for these exact bytes, with deduplicated: true and no uploadUrl; a client that sends it must branch on deduplicated. Absent or false, the answer is always a fresh upload (one uploadUrl, or parts when parts is true), whatever the workspace holds, which is what a client written before this field expects and how a client replaces a held blob whose stored bytes are wrong.

parts
boolean
기본값:false

True asks for the upload in pieces: the answer carries parts, one link per piece, and no uploadUrl. sizeBytes is split into at most 32 pieces of at least 64 MiB each (one piece below 128 MiB), and may be at most 128 GiB (137438953472 bytes); a larger one answers 400. Re-use applies first, as without it: a deduplicated answer has no pieces. Absent or false, the answer is one uploadUrl, as before this field.

응답

Created

blobId
string
필수

Random, workspace-scoped id referenced from the definition.

deduplicated
boolean
필수

True when the request said reuse: true and this workspace already held these exact bytes (same kind, filename, sha256, size and blake3): blobId names the blob it already has, uploadUrl and expiresAt are absent, and the client must transfer nothing. False on every fresh mint, and always false for a request that did not ask to reuse. A fresh mint carries uploadUrl and expiresAt, or parts in their place when the request said parts: true. Branch on this rather than on uploadUrl being absent. A presigned PUT is signed create-only, so replaying an old one against content that already exists fails rather than harmlessly re-uploading.

uploadUrl
string

Presigned PUT; size-locked and no-overwrite. The PUT must send the header x-goog-if-generation-match: 0. The link is signed with that header, so a PUT without it is refused. Present unless deduplicated is true, which only a request with reuse: true can get, or the request said parts: true.

expiresAt
string<date-time>

When uploadUrl stops being accepted. Absent with it.

parts
object[]

Present only when the request said parts: true and the answer is not deduplicated: one link per piece, in order. PUT each piece's bytes to its link with the header x-goog-if-generation-match: 0, then call POST /v1/blobs/{id}/complete.