Package google.cloud.functions.v1

Index

CloudFunctionsService

A service that application uses to manipulate triggers and functions.

CallFunction

rpc CallFunction(CallFunctionRequest) returns (CallFunctionResponse)

Invokes synchronously deployed function. To be used for testing, very limited traffic allowed.

Authorization

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

CreateFunction

rpc CreateFunction(CreateFunctionRequest) returns (Operation)

Creates a new function. If a function with the given name already exists in the specified project, the long running operation will return ALREADY_EXISTS error.

Authorization

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

DeleteFunction

rpc DeleteFunction(DeleteFunctionRequest) returns (Operation)

Deletes a function with the given name from the specified project. If the given function is used by some trigger, the trigger will be updated to remove this function.

Authorization

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

GenerateDownloadUrl

rpc GenerateDownloadUrl(GenerateDownloadUrlRequest) returns (GenerateDownloadUrlResponse)

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

Authorization

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

GenerateUploadUrl

rpc GenerateUploadUrl(GenerateUploadUrlRequest) returns (GenerateUploadUrlResponse)

Returns a signed URL for uploading a function source code. For more information about the signed URL usage see: https://cloud.google.com/storage/docs/access-control/signed-urls Once the function source code upload is complete, the used signed URL should be provided in CreateFunction or UpdateFunction request as a reference to the function source code.

Authorization

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

GetFunction

rpc GetFunction(GetFunctionRequest) returns (CloudFunction)

Returns a function with the given name from the requested project.

Authorization

Requires one of the following OAuth scopes:

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

For more information, see the Auth Guide.

ListFunctions

rpc ListFunctions(ListFunctionsRequest) returns (ListFunctionsResponse)

Returns a list of functions that belong to the requested project.

Authorization

Requires one of the following OAuth scopes:

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

For more information, see the Auth Guide.

UpdateFunction

rpc UpdateFunction(UpdateFunctionRequest) returns (Operation)

Updates existing function.

Authorization

Requires the following OAuth scope:

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

For more information, see the Auth Guide.

CallFunctionRequest

Request for the CallFunction method.

Fields
name

string

The name of the function to be called.

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

  • cloudfunctions.functions.call

data

string

Input to be passed to the function.

CallFunctionResponse

Response of CallFunction method.

Fields
execution_id

string

Execution id of function invocation.

result

string

Result populated for successful execution of synchronous function. Will not be populated if function does not return a result through context.

error

string

Either system or user-function generated error. Set if execution was not successful.

CloudFunction

Describes a Cloud Function that contains user computation executed in response to an event. It encapsulate function and triggers configurations.

Fields
name

string

A user-defined name of the function. Function names must be unique globally and match pattern projects/*/locations/*/functions/*

description

string

User-provided description of a function.

status

CloudFunctionStatus

Output only. Status of the function deployment.

entry_point

string

The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix, if not specified. For backward compatibility, if function with given name is not found, then the system will try to use function named "function". For Node.js this is name of a function exported by the module specified in source_location.

timeout

Duration

The function execution timeout. Execution is considered failed and can be terminated if the function is not completed at the end of the timeout period. Defaults to 60 seconds.

available_memory_mb

int32

The amount of memory in MB available for a function. Defaults to 256MB.

service_account_email

string

Output only. The email of the function's service account.

update_time

Timestamp

Output only. The last update timestamp of a Cloud Function.

version_id

int64

Output only. The version identifier of the Cloud Function. Each deployment attempt results in a new version of a function being created.

labels

map<string, string>

Labels associated with this Cloud Function.

Union field source_code. The location of the function source code. source_code can be only one of the following:
source_archive_url

string

The Google Cloud Storage URL, starting with gs://, pointing to the zip archive which contains the function.

source_repository

SourceRepository

Beta Feature

The source repository where a function is hosted.

source_upload_url

string

The Google Cloud Storage signed URL used for source uploading, generated by [google.cloud.functions.v1.GenerateUploadUrl][]

Union field trigger. An event that triggers the function. trigger can be only one of the following:
https_trigger

HttpsTrigger

An HTTPS endpoint type of source that can be triggered via URL.

event_trigger

EventTrigger

A source that fires events in response to a condition in another service.

CloudFunctionStatus

Describes the current stage of a deployment.

Enums
CLOUD_FUNCTION_STATUS_UNSPECIFIED Not specified. Invalid state.
ACTIVE Function has been succesfully deployed and is serving.
OFFLINE Function deployment failed and the function isn’t serving.
DEPLOY_IN_PROGRESS Function is being created or updated.
DELETE_IN_PROGRESS Function is being deleted.
UNKNOWN Function deployment failed and the function serving state is undefined. The function should be updated or deleted to move it out of this state.

CreateFunctionRequest

Request for the CreateFunction method.

Fields
location

string

The project and location in which the function should be created, specified in the format projects/*/locations/*

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

  • cloudfunctions.functions.create

function

CloudFunction

Function to be created.

DeleteFunctionRequest

Request for the DeleteFunction method.

Fields
name

string

The name of the function which should be deleted.

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

  • cloudfunctions.functions.delete

EventTrigger

Describes EventTrigger, used to request events be sent from another service.

Fields
event_type

string

Required. The type of event to observe. For example: google.storage.object.finalized and google.firebase.analytics.event.log.

Event type consists of three parts: 1. namespace: The domain name of the organization in reverse-domain notation (e.g. acme.net appears as net.acme) and any orginization specific subdivisions. If the organization's top-level domain is com, the top-level domain is ommited (e.g. google.com appears as google). For example, google.storage and google.firebase.analytics. 2. resource type: The type of resource on which event ocurs. For example, the Google Cloud Storage API includes the type object. 3. action: The action that generates the event. For example, actions for a Google Cloud Storage Object include 'finalize' and 'delete'. These parts are lower case and joined by '.'.

resource

string

Required. The resource(s) from which to observe events, for example, projects/_/buckets/myBucket.

Not all syntactically correct values are accepted by all services. For example:

  1. The authorization model must support it. Google Cloud Functions only allows EventTriggers to be deployed that observe resources in the same project as the CloudFunction.
  2. The resource type must match the pattern expected for an event_type. For example, an EventTrigger that has an event_type of "google.pubsub.topic.publish" should have a resource that matches Google Cloud Pub/Sub topics.

Additionally, some services may support short names when creating an EventTrigger. These will always be returned in the normalized "long" format.

See each service's documentation for supported formats.

service

string

The hostname of the service that should be observed.

If no string is provided, the default service implementing the API will be used. For example, storage.googleapis.com is the default for all event types in the 'google.storage` namespace.

failure_policy

FailurePolicy

Specifies policy for failed executions.

FailurePolicy

Describes the policy in case of function's execution failure. If empty, then defaults to ignoring failures (i.e. not retrying them).

Fields
retry

Retry

If specified, then the function will be retried in case of a failure.

Retry

Describes the retry policy in case of function's execution failure. A function execution will be retried on any failure. A failed execution will be retried up to 7 days with an exponential backoff (capped at 10 seconds). Retried execution is charged as any other execution.

GenerateDownloadUrlRequest

Request of GenerateDownloadUrl method.

Fields
name

string

The name of function for which source code Google Cloud Storage signed URL should be generated.

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

  • cloudfunctions.functions.sourceCodeGet

version_id

uint64

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

GenerateDownloadUrlResponse

Response of GenerateDownloadUrl method.

Fields
download_url

string

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

GenerateUploadUrlRequest

Request of GenerateSourceUploadUrl method.

Fields
parent

string

The project and location in which the Google Cloud Storage signed URL should be generated, specified in the format `projects/*/locations/*

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

  • cloudfunctions.functions.sourceCodeSet

GenerateUploadUrlResponse

Response of GenerateSourceUploadUrl method.

Fields
upload_url

string

The generated Google Cloud Storage signed URL that should be used for a function source code upload. The uploaded file should be a zip archive which contains a function.

GetFunctionRequest

Request for the GetFunction method.

Fields
name

string

The name of the function which details should be obtained.

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

  • cloudfunctions.functions.get

HttpsTrigger

Describes HttpsTrigger, could be used to connect web hooks to function.

Fields
url

string

Output only. The deployed url for the function.

ListFunctionsRequest

Request for the ListFunctions method.

Fields
parent

string

The project and location from which the function should be listed, specified in the format projects/*/locations/* If you want to list functions in all locations, use "-" in place of a location.

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

  • cloudfunctions.functions.list

page_size

int32

Maximum number of functions to return per call.

page_token

string

The value returned by the last ListFunctionsResponse; indicates that this is a continuation of a prior ListFunctions call, and that the system should return the next page of data.

ListFunctionsResponse

Response for the ListFunctions method.

Fields
functions[]

CloudFunction

The functions that match the request.

next_page_token

string

If not empty, indicates that there may be more functions that match the request; this value should be passed in a new google.cloud.functions.v1.ListFunctionsRequest to get more functions.

OperationMetadataV1

Metadata describing an Operation

Fields
target

string

Target of the operation - for example projects/project-1/locations/region-1/functions/function-1

type

OperationType

Type of operation.

request

Any

The original request that started the operation.

version_id

int64

Version id of the function created or updated by an API call. This field is only pupulated for Create and Update operations.

OperationType

A type of an operation.

Enums
OPERATION_UNSPECIFIED Unknown operation type.
CREATE_FUNCTION Triggered by CreateFunction call
UPDATE_FUNCTION Triggered by UpdateFunction call
DELETE_FUNCTION Triggered by DeleteFunction call.

SourceRepository

Describes SourceRepository, used to represent parameters related to source repository where a function is hosted.

Fields
url

string

The URL pointing to the hosted repository where the function is defined. There are supported Cloud Source Repository URLs in the following formats:

To refer to a specific commit: https://source.developers.google.com/projects/*/repos/*/revisions/*/paths/* To refer to a moveable alias (branch): https://source.developers.google.com/projects/*/repos/*/moveable-aliases/*/paths/* In particular, to refer to HEAD use master moveable alias. To refer to a specific fixed alias (tag): https://source.developers.google.com/projects/*/repos/*/fixed-aliases/*/paths/*

You may omit paths/* if you want to use the main directory.

deployed_url

string

Output only. The URL pointing to the hosted repository where the function were defined at the time of deployment. It always points to a specific commit in the format described above.

UpdateFunctionRequest

Request for the UpdateFunction method.

Fields
function

CloudFunction

New version of the function.

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

  • cloudfunctions.functions.update

update_mask

FieldMask

Required list of fields to be updated in this request.

Monitor your resources on the go

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

Send feedback about...

Cloud Functions