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}/tblobsCreates 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
| Key | Value |
|---|---|
| Authorization | Bearer {PrincipalToken} |
| Content-Type | BLOB content type |
| Blob-Name | BLOB name, optional |
| TTL | BLOB TTL in seconds, optional. Default is "1d" (other values not supported yet) |
Parameters
| Parameter | Type | Description |
|---|---|---|
| owner | string | name of a user who owns the application |
| app | string | name of an application |
| wsid | int64 | the ID of workspace |
Body
BLOB data.
Result
| Code | Description | Body |
|---|---|---|
| 201 | Created | blob SUUID, see example below |
| 400 | Bad Request | error object |
| 401 | Unauthorized | error object |
| 403 | Forbidden | error object |
| 413 | Payload Too Large | error object |
| 415 | Unsupported Media Type | error object |
| 429 | Too Many Requests | error object |
| 500 | Internal Server Error | error object |
| 503 | Service Unavailable | error object |
Example response 201:
{
"blobSUUID": "cMyxY-HEQHmPnU0JG_UedQ",
}
Perimssions
- Execution of this function is granted to role
sys.BLOBUploaderwhich is by default granted tosys.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