Method: projects.locations.functions.generateDownloadUrl

Returns a signed URL for downloading deployed function source code. The URL is only valid for a limited period and should be used within minutes after generation. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls

HTTP request

POST https://cloudfunctions.googleapis.com/v1/{name}:generateDownloadUrl

Path parameters

Parameters
name

string

The name of function for which source code Google Cloud Storage signed URL should be generated. It takes the form projects/{project_id}/locations/{location_id}/functions/{function_id}.

Authorization requires the following Google IAM permission on the specified resource name:

  • cloudfunctions.functions.sourceCodeGet

Request body

The request body contains data with the following structure:

JSON representation
{
  "versionId": string,
}
Fields
versionId

string

The optional version of function. If not set, default, current version is used.

Response body

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

Response of functions.generateDownloadUrl method.

JSON representation
{
  "downloadUrl": string,
}
Fields
downloadUrl

string

The generated Google Cloud Storage signed URL that should be used for function source code download.

Authorization

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

Try it!

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Cloud Functions