Skip to main content

Create/upload a temporary BLOB

Motivation

Creates a temporary BLOB with the uploaded binary data

Functional design

  • POST /api/v2/apps/{owner}/{app}/workspaces/{wsid}/tblobs Creates a temporary BLOB with the uploaded binary data. The SUUID of the BLOB is returned in the response and can be used to read the BLOB until it expires.

Headers

KeyValue
AuthorizationBearer {PrincipalToken}
Content-TypeBLOB content type
Blob-NameBLOB name, optional
TTLBLOB TTL in seconds, optional. Default is "1d" (other values not supported yet)

Parameters

ParameterTypeDescription
ownerstringname of a user who owns the application
appstringname of an application
wsidint64the ID of workspace

Body

BLOB data.

Result

CodeDescriptionBody
201Createdblob SUUID, see example below
400Bad Requesterror object
401Unauthorizederror object
403Forbiddenerror object
413Payload Too Largeerror object
415Unsupported Media Typeerror object
429Too Many Requestserror object
500Internal Server Errorerror object
503Service Unavailableerror object

Example response 201:

{
"blobSUUID": "cMyxY-HEQHmPnU0JG_UedQ",
}

Perimssions

  • Execution of this function is granted to role sys.BLOBUploader which is by default granted to sys.WorkspaceOwner.

Technical design

Components

  • pkg/router
    • ~cmp.routerTBlobsCreatePathHandler~covrd1✅: Create temporary BLOB path handler
  • pkg/sys/it
    • ~it.TestTBlobsCreate~covrd2✅: integration test for creating temporary BLOBs

Footnotes

  1. [~server.apiv2.tblobs/cmp.routerTBlobsCreatePathHandler~impl] pkg/router/impl_apiv2.go:142:impl

  2. [~server.apiv2.tblobs/it.TestTBlobsCreate~impl] pkg/sys/it/impl_blob_test.go:287:impl