- Resource: CloudFunction
- SourceRepository
- HTTPSTrigger
- EventTrigger
- FailurePolicy
- Retry
- CloudFunctionStatus
- Methods
Resource: CloudFunction
Describes a Cloud Function that contains user computation executed in response to an event. It encapsulate function and triggers configurations.
JSON representation | |
---|---|
{ "name": string, "status": enum ( |
Fields | ||
---|---|---|
name |
A user-defined name of the function. Function names must be unique globally and match pattern |
|
status |
Output only. Status of the function deployment. |
|
latestOperation |
Output only. Name of the most recent operation modifying the function. If the function status is |
|
entryPoint |
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 |
|
runtime |
The runtime in which to run the function. Required when deploying a new function, optional when updating an existing function. For a complete list of possible choices, see the |
|
timeout |
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. A duration in seconds with up to nine fractional digits, terminated by ' |
|
availableMemoryMb |
The amount of memory in MB available for a function. Defaults to 256MB. |
|
serviceAccount |
The email of the function's service account. If empty, defaults to |
|
updateTime |
Output only. The last update timestamp of a Cloud Function. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: |
|
versionId |
Output only. The version identifier of the Cloud Function. Each deployment attempt results in a new version of a function being created. |
|
labels |
Labels associated with this Cloud Function. An object containing a list of |
|
environmentVariables |
Environment variables that shall be available during function execution. An object containing a list of |
|
maxInstances |
The limit on the maximum number of function instances that may coexist at a given time. |
|
network |
The VPC Network that this cloud function can connect to. It can be either the fully-qualified URI, or the short name of the network resource. If the short network name is used, the network must belong to the same project. Otherwise, it must belong to a project within the same organization. The format of this field is either This field is mutually exclusive with See the VPC documentation for more information on connecting Cloud projects. |
|
vpcConnector |
The VPC Network Connector that this cloud function can connect to. It can be either the fully-qualified URI, or the short name of the network connector resource. The format of this field is This field is mutually exclusive with See the VPC documentation for more information on connecting Cloud projects. |
|
Union field source_code . The location of the function source code. source_code can be only one of the following: |
||
sourceArchiveUrl |
The Google Cloud Storage URL, starting with gs://, pointing to the zip archive which contains the function. |
|
sourceRepository |
The hosted repository where the function is defined. |
|
sourceRepositoryUrl |
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: You may omit |
|
sourceUploadUrl |
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: |
||
httpsTrigger |
An HTTPS endpoint type of source that can be triggered via URL. |
|
eventTrigger |
A source that fires events in response to a condition in another service. |
SourceRepository
Describes the location of the function source in a remote repository.
JSON representation | |
---|---|
{ "repositoryUrl": string, "sourcePath": string, "deployedRevision": string, // Union field |
Fields | ||
---|---|---|
repositoryUrl |
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. |
|
sourcePath |
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. |
|
deployedRevision |
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 |
The name of the branch from which the function should be fetched. |
|
tag |
The name of the tag that captures the state of the repository from which the function should be fetched. |
|
revision |
The id of the revision that captures the state of the repository from which the function should be fetched. |
HTTPSTrigger
Describes HTTPSTrigger, could be used to connect web hooks to function.
JSON representation | |
---|---|
{ "url": string } |
Fields | |
---|---|
url |
Output only. The deployed url for the function. |
EventTrigger
Describes EventTrigger, used to request events be sent from another service.
JSON representation | |
---|---|
{
"eventType": string,
"resource": string,
"service": string,
"failurePolicy": {
object ( |
Fields | |
---|---|
eventType |
Handle an object changing in Google Cloud Storage: Handle a write to the Firebase Realtime Database: |
resource |
Which instance of the source's service should send events. E.g. for Pub/Sub this would be a Pub/Sub topic at |
service |
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, |
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).
JSON representation | |
---|---|
{
"retry": {
object ( |
Fields | |
---|---|
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.
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. |
Methods |
|
---|---|
|
Synchronously invokes a deployed Cloud Function. |
|
Creates a new function. |
|
Deletes a function with the given name from the specified project. |
|
Returns a signed URL for downloading deployed function source code. |
|
Returns a signed URL for uploading a function source code. |
|
Returns a function with the given name from the requested project. |
|
Returns a list of functions that belong to the requested project. |
|
Updates existing function. |