Method: media.upload
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eImports a new version of data for a specified dataset using either a local file or a Google Cloud Storage source.\u003c/p\u003e\n"],["\u003cp\u003eThe request body requires specifying the data source (local file or GCS) and an optional description for the new version.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful import results in a response containing the resource name of the newly created dataset version.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires the \u003ccode\u003ecloud-platform\u003c/code\u003e OAuth scope and the \u003ccode\u003emapsplatformdatasets.datasets.import\u003c/code\u003e IAM permission.\u003c/p\u003e\n"]]],[],null,["# Method: media.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 - [JSON representation](#body.ImportDatasetResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [IAM Permissions](#body.aspect_1)\n\nImports a new version of the data for the dataset.\n\n### HTTP request\n\n- Upload URI, for media upload requests: \n `POST https://mapsplatformdatasets.googleapis.com/upload/v1/{name=projects/*/datasets/*}:import`\n- Metadata URI, for metadata-only requests: \n `POST https://mapsplatformdatasets.googleapis.com/v1/{name=projects/*/datasets/*}:import`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|-----------------------------------------------------------------------------------|\n| `name` | `string` Required. Resource name. Format: projects/{project}/datasets/{datasetId} |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"versionDescription\": string, // Union field `data_source` can be only one of the following: \"localFileSource\": { object (/maps/documentation/datasets/reference/rest/v1/projects.datasets#LocalFileSource) }, \"gcsSource\": { object (/maps/documentation/datasets/reference/rest/v1/projects.datasets#GcsSource) } // End of list of possible types for union field `data_source`. } ``` |\n\n| Fields ||\n|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `versionDescription` | `string` A description of the new data being imported. |\n| Union field `data_source`. Details about the source of the data for the dataset. `data_source` can be only one of the following: ||\n| `localFileSource` | `object (`[LocalFileSource](/maps/documentation/datasets/reference/rest/v1/projects.datasets#LocalFileSource)`)` A local file source for the dataset for a one time import. |\n| `gcsSource` | `object (`[GcsSource](/maps/documentation/datasets/reference/rest/v1/projects.datasets#GcsSource)`)` A Google Cloud Storage file source for the dataset for a one time import. |\n\n### Response body\n\nResponse object of media.upload.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|----------------------------|\n| ``` { \"name\": string } ``` |\n\n| Fields ||\n|--------|------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Required. Resource name of the newly created dataset version. Format: projects/{project}/datasets/{datasetId}@{versionId} |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\n### IAM Permissions\n\nRequires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:\n\n- `mapsplatformdatasets.datasets.import`\n\nFor more information, see the [IAM documentation](https://cloud.google.com/iam/docs)."]]