- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- AssetSource
- AssetContentData
Upload asset by specifing the asset Cloud Storage uri. For video warehouse, it requires users who call this API have read access to the cloud storage file. Once it is uploaded, it can be retrieved by assets.generateRetrievalUrl API which by default, only can retrieve cloud storage files from the same project of the warehouse. To allow retrieval cloud storage files that are in a separate project, it requires to find the vision ai service account (Go to IAM, check checkbox to show "Include Google-provided role grants", search for "Cloud Vision AI Service Agent") and grant the read access of the cloud storage files to that service account.
HTTP request
POST https://visionai.googleapis.com/v1/{name=projects/*/locations/*/corpora/*/assets/*}:upload
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
name |
Required. The resource name of the asset to upload. Format: |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{
"assetSource": {
object ( |
Fields | |
---|---|
assetSource |
The source of the asset. |
Response body
If successful, the response body contains an instance of Operation
.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
Requires the following IAM permission on the name
resource:
visionai.assets.upload
For more information, see the IAM documentation.
AssetSource
The source of the asset.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field
|
|
assetGcsSource |
The source of the asset is from Cloud Storage. |
assetContentData |
The source of the asset is from content bytes. |
AssetContentData
The content of the asset.
JSON representation |
---|
{ "assetContentData": string } |
Fields | |
---|---|
assetContentData |
A base64-encoded string. |