Upload aset dengan menentukan URI Cloud Storage aset. Untuk video warehouse, pengguna yang memanggil API ini harus memiliki akses baca ke file cloud storage. Setelah diupload, file tersebut dapat diambil oleh assets.generateRetrievalUrl API yang secara default hanya dapat mengambil file cloud storage dari project warehouse yang sama. Untuk mengizinkan pengambilan file cloud storage yang berada dalam project terpisah, Anda harus menemukan akun layanan Cloud Vision AI (Buka IAM, centang kotak untuk menampilkan "Sertakan pemberian peran yang disediakan Google", telusuri "Cloud Vision AI Service Agent") dan berikan akses baca file cloud storage ke akun layanan tersebut.
Permintaan HTTP
POST https://visionai.googleapis.com/v1/{name=projects/*/locations/*/corpora/*/assets/*}:upload
Untuk mengetahui informasi selengkapnya, lihat dokumentasi IAM.
AssetSource
Sumber aset.
Representasi JSON
{// Union field source_form can be only one of the following:"assetGcsSource": {object (AssetGcsSource)},"assetContentData": {object (AssetContentData)}// End of list of possible types for union field source_form.}
Kolom
Kolom union source_form.
source_form hanya dapat berupa salah satu dari hal berikut:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-03-04 UTC."],[],[],null,["# Method: projects.locations.corpora.assets.upload\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [IAM Permissions](#body.aspect_1)\n- [AssetSource](#AssetSource)\n - [JSON representation](#AssetSource.SCHEMA_REPRESENTATION)\n- [AssetContentData](#AssetContentData)\n - [JSON representation](#AssetContentData.SCHEMA_REPRESENTATION)\n\nUpload 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.\n\n### HTTP request\n\n`POST https://visionai.googleapis.com/v1/{name=projects/*/locations/*/corpora/*/assets/*}:upload`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/vision-ai/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/).\n\n### IAM Permissions\n\nRequires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:\n\n- `visionai.assets.upload`\n\nFor more information, see the [IAM documentation](https://cloud.google.com/iam/docs).\n\nAssetSource\n-----------\n\nThe source of the asset.\n\nAssetContentData\n----------------\n\nThe content of the asset."]]