Package google.cloud.functions.v1beta2

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 Scopes

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 Scopes

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 Scopes

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 Scopes

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.

When uploading source code to the generated signed URL, please follow these restrictions:

  • Source file type should be a zip file.
  • Source file size should not exceed 100MB limit.

When making a HTTP PUT request, these two headers need to be specified:

  • content-type: application/zip
  • x-google-content-length-range: 0,104857600
Authorization Scopes

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 Scopes

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 Scopes

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 Scopes

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/*

status

CloudFunctionStatus

Output only. Status of the function deployment.

latest_operation

string

Output only. Name of the most recent operation modifying the function. If the function status is DEPLOYING or DELETING, then it points to the active operation.

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

string

Output only. The service account of the function.

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

The hosted repository where the function is defined.

source_repository_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.

source_upload_url

string

The Google Cloud Storage signed URL used for source uploading, generated by [google.cloud.functions.v1beta2.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
STATUS_UNSPECIFIED Status not specified.
READY Successfully deployed.
FAILED Not deployed correctly - behavior is undefined. The item should be updated or deleted to move it out of this state.
DEPLOYING Creation or update in progress.
DELETING Deletion in progress.

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

event_type names contain the service that is sending an event and the kind of event that was fired. Must be of the form providers/*/eventTypes/* e.g. Directly handle a Message published to Google Cloud Pub/Sub providers/cloud.pubsub/eventTypes/topic.publish.

Handle an object changing in Google Cloud Storage: providers/cloud.storage/eventTypes/object.change

Handle a write to the Firebase Realtime Database: providers/google.firebase.database/eventTypes/ref.write

resource

string

Which instance of the source's service should send events. E.g. for Pub/Sub this would be a Pub/Sub topic at projects/*/topics/*. For Google Cloud Storage this would be a bucket at projects/*/buckets/*. For any source that only supports one instance per-project, this should be the name of the project (projects/*)

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.

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 GenerateUploadUrl 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 GenerateUploadUrl 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
location

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 location:

  • 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.v1beta2.ListFunctionsRequest to get more functions.

OperationMetadataV1Beta2

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.

update_time

Timestamp

The last update timestamp of the operation.

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 the location of the function source in a remote repository.

Fields
repository_url

string

URL to the hosted repository where the function is defined. Only paths in https://source.developers.google.com domain are supported. The path should contain the name of the repository.

source_path

string

The path within the repository where the function is defined. The path should point to the directory where Cloud Functions files are located. Use "/" if the function is defined directly in the root directory of a repository.

deployed_revision

string

Output only. The id of the revision that was resolved at the moment of function creation or update. For example when a user deployed from a branch, it will be the revision id of the latest change on this branch at that time. If user deployed from revision then this value will be always equal to the revision specified by the user.

Union field version. The version of a function. Defaults to the latest version of the master branch. version can be only one of the following:
branch

string

The name of the branch from which the function should be fetched.

tag

string

The name of the tag that captures the state of the repository from which the function should be fetched.

revision

string

The id of the revision that captures the state of the repository from which the function should be fetched.

UpdateFunctionRequest

Request for the UpdateFunction method.

Fields
name

string

The name of the function to be updated.

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

  • cloudfunctions.functions.update

function

CloudFunction

New version of the function.

Send feedback about...

Cloud Functions