Method: projects.locations.sourceUploads.upload

Uploads a source archive to a Google Cloud Storage bucket through Cloud Run. The uploaded source object should be used for Cloud Run resource deployments. User is responsible for managing the lifecycle of the uploaded object. If uploading through the Cloud Run API to Cloud Storage is not desired, you can use the IAM Deny Policy to deny the run.locations.uploadSource permission for all principals.

HTTP request

  • Upload URI, for media upload requests:
    POST https://run.googleapis.com/upload/v2/{parent}:uploadSource
  • Metadata URI, for metadata-only requests:
    POST https://run.googleapis.com/v2/{parent}:uploadSource

Path parameters

Parameters
parent

string

Required. The project and location in which the source archive should be uploaded to, specified in the format projects/*/locations/*. It takes the form projects/{project}/locations/{location}.

Authorization requires the following IAM permission on the specified resource parent:

  • run.locations.uploadSource

Request body

The request body contains data with the following structure:

JSON representation
{

  // Union field target can be only one of the following:
  "service": string
  // End of list of possible types for union field target.
}
Fields
Union field target. The Cloud Run resource the upload source archive will be used for. target can be only one of the following:
service

string

The name of Cloud Run Service upload source archive will be used for.

Response body

If successful, the response body contains an instance of UploadSourceResponse.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.