Method: media.upload

Uploads media for indexing.

The upload endpoint supports direct and resumable upload protocols and is intended for large items that can not be inlined during index requests. To index large content:

  1. Call indexing.datasources.items.upload with the item name to begin an upload session and retrieve the UploadItemRef.
  2. Call media.upload to upload the content, as a streaming request, using the same resource name from the UploadItemRef from step 1.
  3. Call indexing.datasources.items.index to index the item. Populate the ItemContent with the UploadItemRef from step 1.

For additional information, see Create a content connector using the REST API.

Note: This API requires a service account to execute.

HTTP request

  • Upload URI, for media upload requests:
    POST https://cloudsearch.googleapis.com/upload/v1/media/{resourceName=**}
  • Metadata URI, for metadata-only requests:
    POST https://cloudsearch.googleapis.com/v1/media/{resourceName=**}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
resourceName

string

Name of the media that is being downloaded. See ReadRequest.resource_name.

Request body

The request body contains an instance of Media.

Response body

If successful, the response body contains data with the following structure:

Media resource.

JSON representation
{
  "resourceName": string
}
Fields
resourceName

string

Name of the media resource.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud_search.indexing
  • https://www.googleapis.com/auth/cloud_search

For more information, see the Authorization guide.