Class CloudFunction (2.14.0)

publicfinalclass CloudFunctionextendsGeneratedMessageV3implementsCloudFunctionOrBuilder

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

Protobuf type google.cloud.functions.v1.CloudFunction

Inherited Members

Static Fields

AVAILABLE_MEMORY_MB_FIELD_NUMBER

publicstaticfinalintAVAILABLE_MEMORY_MB_FIELD_NUMBER
Field Value
Type Description
int

BUILD_ENVIRONMENT_VARIABLES_FIELD_NUMBER

publicstaticfinalintBUILD_ENVIRONMENT_VARIABLES_FIELD_NUMBER
Field Value
Type Description
int

BUILD_ID_FIELD_NUMBER

publicstaticfinalintBUILD_ID_FIELD_NUMBER
Field Value
Type Description
int

BUILD_NAME_FIELD_NUMBER

publicstaticfinalintBUILD_NAME_FIELD_NUMBER
Field Value
Type Description
int

BUILD_WORKER_POOL_FIELD_NUMBER

publicstaticfinalintBUILD_WORKER_POOL_FIELD_NUMBER
Field Value
Type Description
int

DESCRIPTION_FIELD_NUMBER

publicstaticfinalintDESCRIPTION_FIELD_NUMBER
Field Value
Type Description
int

DOCKER_REGISTRY_FIELD_NUMBER

publicstaticfinalintDOCKER_REGISTRY_FIELD_NUMBER
Field Value
Type Description
int

DOCKER_REPOSITORY_FIELD_NUMBER

publicstaticfinalintDOCKER_REPOSITORY_FIELD_NUMBER
Field Value
Type Description
int

ENTRY_POINT_FIELD_NUMBER

publicstaticfinalintENTRY_POINT_FIELD_NUMBER
Field Value
Type Description
int

ENVIRONMENT_VARIABLES_FIELD_NUMBER

publicstaticfinalintENVIRONMENT_VARIABLES_FIELD_NUMBER
Field Value
Type Description
int

EVENT_TRIGGER_FIELD_NUMBER

publicstaticfinalintEVENT_TRIGGER_FIELD_NUMBER
Field Value
Type Description
int

HTTPS_TRIGGER_FIELD_NUMBER

publicstaticfinalintHTTPS_TRIGGER_FIELD_NUMBER
Field Value
Type Description
int

INGRESS_SETTINGS_FIELD_NUMBER

publicstaticfinalintINGRESS_SETTINGS_FIELD_NUMBER
Field Value
Type Description
int

KMS_KEY_NAME_FIELD_NUMBER

publicstaticfinalintKMS_KEY_NAME_FIELD_NUMBER
Field Value
Type Description
int

LABELS_FIELD_NUMBER

publicstaticfinalintLABELS_FIELD_NUMBER
Field Value
Type Description
int

MAX_INSTANCES_FIELD_NUMBER

publicstaticfinalintMAX_INSTANCES_FIELD_NUMBER
Field Value
Type Description
int

MIN_INSTANCES_FIELD_NUMBER

publicstaticfinalintMIN_INSTANCES_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

publicstaticfinalintNAME_FIELD_NUMBER
Field Value
Type Description
int

NETWORK_FIELD_NUMBER

publicstaticfinalintNETWORK_FIELD_NUMBER
Field Value
Type Description
int

RUNTIME_FIELD_NUMBER

publicstaticfinalintRUNTIME_FIELD_NUMBER
Field Value
Type Description
int

SECRET_ENVIRONMENT_VARIABLES_FIELD_NUMBER

publicstaticfinalintSECRET_ENVIRONMENT_VARIABLES_FIELD_NUMBER
Field Value
Type Description
int

SECRET_VOLUMES_FIELD_NUMBER

publicstaticfinalintSECRET_VOLUMES_FIELD_NUMBER
Field Value
Type Description
int

SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER

publicstaticfinalintSERVICE_ACCOUNT_EMAIL_FIELD_NUMBER
Field Value
Type Description
int

SOURCE_ARCHIVE_URL_FIELD_NUMBER

publicstaticfinalintSOURCE_ARCHIVE_URL_FIELD_NUMBER
Field Value
Type Description
int

SOURCE_REPOSITORY_FIELD_NUMBER

publicstaticfinalintSOURCE_REPOSITORY_FIELD_NUMBER
Field Value
Type Description
int

SOURCE_TOKEN_FIELD_NUMBER

publicstaticfinalintSOURCE_TOKEN_FIELD_NUMBER
Field Value
Type Description
int

SOURCE_UPLOAD_URL_FIELD_NUMBER

publicstaticfinalintSOURCE_UPLOAD_URL_FIELD_NUMBER
Field Value
Type Description
int

STATUS_FIELD_NUMBER

publicstaticfinalintSTATUS_FIELD_NUMBER
Field Value
Type Description
int

TIMEOUT_FIELD_NUMBER

publicstaticfinalintTIMEOUT_FIELD_NUMBER
Field Value
Type Description
int

UPDATE_TIME_FIELD_NUMBER

publicstaticfinalintUPDATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

VERSION_ID_FIELD_NUMBER

publicstaticfinalintVERSION_ID_FIELD_NUMBER
Field Value
Type Description
int

VPC_CONNECTOR_EGRESS_SETTINGS_FIELD_NUMBER

publicstaticfinalintVPC_CONNECTOR_EGRESS_SETTINGS_FIELD_NUMBER
Field Value
Type Description
int

VPC_CONNECTOR_FIELD_NUMBER

publicstaticfinalintVPC_CONNECTOR_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticCloudFunctiongetDefaultInstance()
Returns
Type Description

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description

newBuilder()

publicstaticCloudFunction.BuildernewBuilder()
Returns
Type Description

newBuilder(CloudFunction prototype)

publicstaticCloudFunction.BuildernewBuilder(CloudFunctionprototype)
Parameter
Name Description
prototype CloudFunction
Returns
Type Description

parseDelimitedFrom(InputStream input)

publicstaticCloudFunctionparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Exceptions
Type Description

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticCloudFunctionparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(byte[] data)

publicstaticCloudFunctionparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
Exceptions
Type Description

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticCloudFunctionparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(ByteString data)

publicstaticCloudFunctionparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
Exceptions
Type Description

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticCloudFunctionparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(CodedInputStream input)

publicstaticCloudFunctionparseFrom(CodedInputStreaminput)
Parameter
Name Description
Returns
Type Description
Exceptions
Type Description

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticCloudFunctionparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(InputStream input)

publicstaticCloudFunctionparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Exceptions
Type Description

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticCloudFunctionparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parseFrom(ByteBuffer data)

publicstaticCloudFunctionparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Exceptions
Type Description

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticCloudFunctionparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Exceptions
Type Description

parser()

publicstaticParser<CloudFunction>parser()
Returns
Type Description

Methods

containsBuildEnvironmentVariables(String key)

publicbooleancontainsBuildEnvironmentVariables(Stringkey)

Build environment variables that shall be available during build time.

map<string, string> build_environment_variables = 28;

Parameter
Name Description
key String
Returns
Type Description

containsEnvironmentVariables(String key)

publicbooleancontainsEnvironmentVariables(Stringkey)

Environment variables that shall be available during function execution.

map<string, string> environment_variables = 17;

Parameter
Name Description
key String
Returns
Type Description

containsLabels(String key)

publicbooleancontainsLabels(Stringkey)

Labels associated with this Cloud Function.

map<string, string> labels = 15;

Parameter
Name Description
key String
Returns
Type Description

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
Overrides

getAvailableMemoryMb()

publicintgetAvailableMemoryMb()

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

int32 available_memory_mb = 10;

Returns
Type Description
int

The availableMemoryMb.

getBuildEnvironmentVariables()

publicMap<String,String>getBuildEnvironmentVariables()
Returns
Type Description

getBuildEnvironmentVariablesCount()

publicintgetBuildEnvironmentVariablesCount()

Build environment variables that shall be available during build time.

map<string, string> build_environment_variables = 28;

Returns
Type Description
int

getBuildEnvironmentVariablesMap()

publicMap<String,String>getBuildEnvironmentVariablesMap()

Build environment variables that shall be available during build time.

map<string, string> build_environment_variables = 28;

Returns
Type Description

getBuildEnvironmentVariablesOrDefault(String key, String defaultValue)

publicStringgetBuildEnvironmentVariablesOrDefault(Stringkey,StringdefaultValue)

Build environment variables that shall be available during build time.

map<string, string> build_environment_variables = 28;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description

getBuildEnvironmentVariablesOrThrow(String key)

publicStringgetBuildEnvironmentVariablesOrThrow(Stringkey)

Build environment variables that shall be available during build time.

map<string, string> build_environment_variables = 28;

Parameter
Name Description
key String
Returns
Type Description

getBuildId()

publicStringgetBuildId()

Output only. The Cloud Build ID of the latest successful deployment of the function.

string build_id = 27 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The buildId.

getBuildIdBytes()

publicByteStringgetBuildIdBytes()

Output only. The Cloud Build ID of the latest successful deployment of the function.

string build_id = 27 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for buildId.

getBuildName()

publicStringgetBuildName()

Output only. The Cloud Build Name of the function deployment. projects/<project-number>/locations/<region>/builds/<build-id>.

string build_name = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The buildName.

getBuildNameBytes()

publicByteStringgetBuildNameBytes()

Output only. The Cloud Build Name of the function deployment. projects/<project-number>/locations/<region>/builds/<build-id>.

string build_name = 33 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for buildName.

getBuildWorkerPool()

publicStringgetBuildWorkerPool()

Name of the Cloud Build Custom Worker Pool that should be used to build the function. The format of this field is projects/{project}/locations/{region}/workerPools/{workerPool} where {project} and {region} are the project id and region respectively where the worker pool is defined and {workerPool} is the short name of the worker pool. If the project id is not the same as the function, then the Cloud Functions Service Agent (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be granted the role Cloud Build Custom Workers Builder (roles/cloudbuild.customworkers.builder) in the project.

string build_worker_pool = 26;

Returns
Type Description
String

The buildWorkerPool.

getBuildWorkerPoolBytes()

publicByteStringgetBuildWorkerPoolBytes()

Name of the Cloud Build Custom Worker Pool that should be used to build the function. The format of this field is projects/{project}/locations/{region}/workerPools/{workerPool} where {project} and {region} are the project id and region respectively where the worker pool is defined and {workerPool} is the short name of the worker pool. If the project id is not the same as the function, then the Cloud Functions Service Agent (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be granted the role Cloud Build Custom Workers Builder (roles/cloudbuild.customworkers.builder) in the project.

string build_worker_pool = 26;

Returns
Type Description
ByteString

The bytes for buildWorkerPool.

getDefaultInstanceForType()

publicCloudFunctiongetDefaultInstanceForType()
Returns
Type Description

getDescription()

publicStringgetDescription()

User-provided description of a function.

string description = 2;

Returns
Type Description
String

The description.

getDescriptionBytes()

publicByteStringgetDescriptionBytes()

User-provided description of a function.

string description = 2;

Returns
Type Description
ByteString

The bytes for description.

getDockerRegistry()

publicCloudFunction.DockerRegistrygetDockerRegistry()

Docker Registry to use for this deployment. If docker_repository field is specified, this field will be automatically set as ARTIFACT_REGISTRY. If unspecified, it currently defaults to CONTAINER_REGISTRY. This field may be overridden by the backend for eligible deployments.

.google.cloud.functions.v1.CloudFunction.DockerRegistry docker_registry = 35;

Returns
Type Description
CloudFunction.DockerRegistry

The dockerRegistry.

getDockerRegistryValue()

publicintgetDockerRegistryValue()

Docker Registry to use for this deployment. If docker_repository field is specified, this field will be automatically set as ARTIFACT_REGISTRY. If unspecified, it currently defaults to CONTAINER_REGISTRY. This field may be overridden by the backend for eligible deployments.

.google.cloud.functions.v1.CloudFunction.DockerRegistry docker_registry = 35;

Returns
Type Description
int

The enum numeric value on the wire for dockerRegistry.

getDockerRepository()

publicStringgetDockerRepository()

User managed repository created in Artifact Registry optionally with a customer managed encryption key. If specified, deployments will use Artifact Registry. If unspecified and the deployment is eligible to use Artifact Registry, GCF will create and use a repository named 'gcf-artifacts' for every deployed region. This is the repository to which the function docker image will be pushed after it is built by Cloud Build. It must match the pattern projects/{project}/locations/{location}/repositories/{repository}. Cross-project repositories are not supported. Cross-location repositories are not supported. Repository format must be 'DOCKER'.

string docker_repository = 34 [(.google.api.resource_reference) = { ... }

Returns
Type Description
String

The dockerRepository.

getDockerRepositoryBytes()

publicByteStringgetDockerRepositoryBytes()

User managed repository created in Artifact Registry optionally with a customer managed encryption key. If specified, deployments will use Artifact Registry. If unspecified and the deployment is eligible to use Artifact Registry, GCF will create and use a repository named 'gcf-artifacts' for every deployed region. This is the repository to which the function docker image will be pushed after it is built by Cloud Build. It must match the pattern projects/{project}/locations/{location}/repositories/{repository}. Cross-project repositories are not supported. Cross-location repositories are not supported. Repository format must be 'DOCKER'.

string docker_repository = 34 [(.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for dockerRepository.

getEntryPoint()

publicStringgetEntryPoint()

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.

string entry_point = 8;

Returns
Type Description
String

The entryPoint.

getEntryPointBytes()

publicByteStringgetEntryPointBytes()

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.

string entry_point = 8;

Returns
Type Description
ByteString

The bytes for entryPoint.

getEnvironmentVariables()

publicMap<String,String>getEnvironmentVariables()
Returns
Type Description

getEnvironmentVariablesCount()

publicintgetEnvironmentVariablesCount()

Environment variables that shall be available during function execution.

map<string, string> environment_variables = 17;

Returns
Type Description
int

getEnvironmentVariablesMap()

publicMap<String,String>getEnvironmentVariablesMap()

Environment variables that shall be available during function execution.

map<string, string> environment_variables = 17;

Returns
Type Description

getEnvironmentVariablesOrDefault(String key, String defaultValue)

publicStringgetEnvironmentVariablesOrDefault(Stringkey,StringdefaultValue)

Environment variables that shall be available during function execution.

map<string, string> environment_variables = 17;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description

getEnvironmentVariablesOrThrow(String key)

publicStringgetEnvironmentVariablesOrThrow(Stringkey)

Environment variables that shall be available during function execution.

map<string, string> environment_variables = 17;

Parameter
Name Description
key String
Returns
Type Description

getEventTrigger()

publicEventTriggergetEventTrigger()

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

.google.cloud.functions.v1.EventTrigger event_trigger = 6;

Returns
Type Description
EventTrigger

The eventTrigger.

getEventTriggerOrBuilder()

publicEventTriggerOrBuildergetEventTriggerOrBuilder()

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

.google.cloud.functions.v1.EventTrigger event_trigger = 6;

Returns
Type Description

getHttpsTrigger()

publicHttpsTriggergetHttpsTrigger()

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

.google.cloud.functions.v1.HttpsTrigger https_trigger = 5;

Returns
Type Description
HttpsTrigger

The httpsTrigger.

getHttpsTriggerOrBuilder()

publicHttpsTriggerOrBuildergetHttpsTriggerOrBuilder()

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

.google.cloud.functions.v1.HttpsTrigger https_trigger = 5;

Returns
Type Description

getIngressSettings()

publicCloudFunction.IngressSettingsgetIngressSettings()

The ingress settings for the function, controlling what traffic can reach it.

.google.cloud.functions.v1.CloudFunction.IngressSettings ingress_settings = 24;

Returns
Type Description
CloudFunction.IngressSettings

The ingressSettings.

getIngressSettingsValue()

publicintgetIngressSettingsValue()

The ingress settings for the function, controlling what traffic can reach it.

.google.cloud.functions.v1.CloudFunction.IngressSettings ingress_settings = 24;

Returns
Type Description
int

The enum numeric value on the wire for ingressSettings.

getKmsKeyName()

publicStringgetKmsKeyName()

Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources. It must match the pattern projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}. If specified, you must also provide an artifact registry repository using the docker_repository field that was created with the same KMS crypto key. The following service accounts need to be granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the Key/KeyRing/Project/Organization (least access preferred).

  1. Google Cloud Functions service account (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) - Required to protect the function's image.
  2. Google Storage service account (service-{project_number}@gs-project-accounts.iam.gserviceaccount.com) - Required to protect the function's source code. If this service account does not exist, deploying a function without a KMS key or retrieving the service agent name provisions it. For more information, see https://cloud.google.com/storage/docs/projects#service-agents and https://cloud.google.com/storage/docs/getting-service-agent#gsutil. Google Cloud Functions delegates access to service agents to protect function resources in internal projects that are not accessible by the end user.

string kms_key_name = 25 [(.google.api.resource_reference) = { ... }

Returns
Type Description
String

The kmsKeyName.

getKmsKeyNameBytes()

publicByteStringgetKmsKeyNameBytes()

Resource name of a KMS crypto key (managed by the user) used to encrypt/decrypt function resources. It must match the pattern projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}. If specified, you must also provide an artifact registry repository using the docker_repository field that was created with the same KMS crypto key. The following service accounts need to be granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the Key/KeyRing/Project/Organization (least access preferred).

  1. Google Cloud Functions service account (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) - Required to protect the function's image.
  2. Google Storage service account (service-{project_number}@gs-project-accounts.iam.gserviceaccount.com) - Required to protect the function's source code. If this service account does not exist, deploying a function without a KMS key or retrieving the service agent name provisions it. For more information, see https://cloud.google.com/storage/docs/projects#service-agents and https://cloud.google.com/storage/docs/getting-service-agent#gsutil. Google Cloud Functions delegates access to service agents to protect function resources in internal projects that are not accessible by the end user.

string kms_key_name = 25 [(.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for kmsKeyName.

getLabels()

publicMap<String,String>getLabels()

Use #getLabelsMap() instead.

Returns
Type Description

getLabelsCount()

publicintgetLabelsCount()

Labels associated with this Cloud Function.

map<string, string> labels = 15;

Returns
Type Description
int

getLabelsMap()

publicMap<String,String>getLabelsMap()

Labels associated with this Cloud Function.

map<string, string> labels = 15;

Returns
Type Description

getLabelsOrDefault(String key, String defaultValue)

publicStringgetLabelsOrDefault(Stringkey,StringdefaultValue)

Labels associated with this Cloud Function.

map<string, string> labels = 15;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description

getLabelsOrThrow(String key)

publicStringgetLabelsOrThrow(Stringkey)

Labels associated with this Cloud Function.

map<string, string> labels = 15;

Parameter
Name Description
key String
Returns
Type Description

getMaxInstances()

publicintgetMaxInstances()

The limit on the maximum number of function instances that may coexist at a given time. In some cases, such as rapid traffic surges, Cloud Functions may, for a short period of time, create more instances than the specified max instances limit. If your function cannot tolerate this temporary behavior, you may want to factor in a safety margin and set a lower max instances value than your function can tolerate. See the Max Instances Guide for more details.

int32 max_instances = 20;

Returns
Type Description
int

The maxInstances.

getMinInstances()

publicintgetMinInstances()

A lower bound for the number function instances that may coexist at a given time.

int32 min_instances = 32;

Returns
Type Description
int

The minInstances.

getName()

publicStringgetName()

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

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

publicByteStringgetNameBytes()

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

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getNetwork()

publicStringgetNetwork()

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 projects/{project}/global/networks/{network} or {network}, where {project} is a project id where the network is defined, and {network} is the short name of the network. This field is mutually exclusive with vpc_connector and will be replaced by it. See the VPC documentation for more information on connecting Cloud projects.

string network = 18;

Returns
Type Description
String

The network.

getNetworkBytes()

publicByteStringgetNetworkBytes()

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 projects/{project}/global/networks/{network} or {network}, where {project} is a project id where the network is defined, and {network} is the short name of the network. This field is mutually exclusive with vpc_connector and will be replaced by it. See the VPC documentation for more information on connecting Cloud projects.

string network = 18;

Returns
Type Description
ByteString

The bytes for network.

getParserForType()

publicParser<CloudFunction>getParserForType()
Returns
Type Description
Overrides

getRuntime()

publicStringgetRuntime()

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 gcloud command reference.

string runtime = 19;

Returns
Type Description
String

The runtime.

getRuntimeBytes()

publicByteStringgetRuntimeBytes()

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 gcloud command reference.

string runtime = 19;

Returns
Type Description
ByteString

The bytes for runtime.

getSecretEnvironmentVariables(int index)

publicSecretEnvVargetSecretEnvironmentVariables(intindex)

Secret environment variables configuration.

repeated .google.cloud.functions.v1.SecretEnvVar secret_environment_variables = 29;

Parameter
Name Description
index int
Returns
Type Description

getSecretEnvironmentVariablesCount()

publicintgetSecretEnvironmentVariablesCount()

Secret environment variables configuration.

repeated .google.cloud.functions.v1.SecretEnvVar secret_environment_variables = 29;

Returns
Type Description
int

getSecretEnvironmentVariablesList()

publicList<SecretEnvVar>getSecretEnvironmentVariablesList()

Secret environment variables configuration.

repeated .google.cloud.functions.v1.SecretEnvVar secret_environment_variables = 29;

Returns
Type Description

getSecretEnvironmentVariablesOrBuilder(int index)

publicSecretEnvVarOrBuildergetSecretEnvironmentVariablesOrBuilder(intindex)

Secret environment variables configuration.

repeated .google.cloud.functions.v1.SecretEnvVar secret_environment_variables = 29;

Parameter
Name Description
index int
Returns
Type Description

getSecretEnvironmentVariablesOrBuilderList()

publicList<?extendsSecretEnvVarOrBuilder>getSecretEnvironmentVariablesOrBuilderList()

Secret environment variables configuration.

repeated .google.cloud.functions.v1.SecretEnvVar secret_environment_variables = 29;

Returns
Type Description
List<? extends com.google.cloud.functions.v1.SecretEnvVarOrBuilder>

getSecretVolumes(int index)

publicSecretVolumegetSecretVolumes(intindex)

Secret volumes configuration.

repeated .google.cloud.functions.v1.SecretVolume secret_volumes = 30;

Parameter
Name Description
index int
Returns
Type Description

getSecretVolumesCount()

publicintgetSecretVolumesCount()

Secret volumes configuration.

repeated .google.cloud.functions.v1.SecretVolume secret_volumes = 30;

Returns
Type Description
int

getSecretVolumesList()

publicList<SecretVolume>getSecretVolumesList()

Secret volumes configuration.

repeated .google.cloud.functions.v1.SecretVolume secret_volumes = 30;

Returns
Type Description

getSecretVolumesOrBuilder(int index)

publicSecretVolumeOrBuildergetSecretVolumesOrBuilder(intindex)

Secret volumes configuration.

repeated .google.cloud.functions.v1.SecretVolume secret_volumes = 30;

Parameter
Name Description
index int
Returns
Type Description

getSecretVolumesOrBuilderList()

publicList<?extendsSecretVolumeOrBuilder>getSecretVolumesOrBuilderList()

Secret volumes configuration.

repeated .google.cloud.functions.v1.SecretVolume secret_volumes = 30;

Returns
Type Description
List<? extends com.google.cloud.functions.v1.SecretVolumeOrBuilder>

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

getServiceAccountEmail()

publicStringgetServiceAccountEmail()

The email of the function's service account. If empty, defaults to {project_id}@appspot.gserviceaccount.com.

string service_account_email = 11;

Returns
Type Description
String

The serviceAccountEmail.

getServiceAccountEmailBytes()

publicByteStringgetServiceAccountEmailBytes()

The email of the function's service account. If empty, defaults to {project_id}@appspot.gserviceaccount.com.

string service_account_email = 11;

Returns
Type Description
ByteString

The bytes for serviceAccountEmail.

getSourceArchiveUrl()

publicStringgetSourceArchiveUrl()

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

string source_archive_url = 3;

Returns
Type Description
String

The sourceArchiveUrl.

getSourceArchiveUrlBytes()

publicByteStringgetSourceArchiveUrlBytes()

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

string source_archive_url = 3;

Returns
Type Description
ByteString

The bytes for sourceArchiveUrl.

getSourceCodeCase()

publicCloudFunction.SourceCodeCasegetSourceCodeCase()
Returns
Type Description

getSourceRepository()

publicSourceRepositorygetSourceRepository()

Beta Feature The source repository where a function is hosted.

.google.cloud.functions.v1.SourceRepository source_repository = 4;

Returns
Type Description
SourceRepository

The sourceRepository.

getSourceRepositoryOrBuilder()

publicSourceRepositoryOrBuildergetSourceRepositoryOrBuilder()

Beta Feature The source repository where a function is hosted.

.google.cloud.functions.v1.SourceRepository source_repository = 4;

Returns
Type Description

getSourceToken()

publicStringgetSourceToken()

Input only. An identifier for Firebase function sources. Disclaimer: This field is only supported for Firebase function deployments.

string source_token = 31 [(.google.api.field_behavior) = INPUT_ONLY];

Returns
Type Description
String

The sourceToken.

getSourceTokenBytes()

publicByteStringgetSourceTokenBytes()

Input only. An identifier for Firebase function sources. Disclaimer: This field is only supported for Firebase function deployments.

string source_token = 31 [(.google.api.field_behavior) = INPUT_ONLY];

Returns
Type Description
ByteString

The bytes for sourceToken.

getSourceUploadUrl()

publicStringgetSourceUploadUrl()

The Google Cloud Storage signed URL used for source uploading, generated by calling [google.cloud.functions.v1.GenerateUploadUrl]. The signature is validated on write methods (Create, Update) The signature is stripped from the Function object on read methods (Get, List)

string source_upload_url = 16;

Returns
Type Description
String

The sourceUploadUrl.

getSourceUploadUrlBytes()

publicByteStringgetSourceUploadUrlBytes()

The Google Cloud Storage signed URL used for source uploading, generated by calling [google.cloud.functions.v1.GenerateUploadUrl]. The signature is validated on write methods (Create, Update) The signature is stripped from the Function object on read methods (Get, List)

string source_upload_url = 16;

Returns
Type Description
ByteString

The bytes for sourceUploadUrl.

getStatus()

publicCloudFunctionStatusgetStatus()

Output only. Status of the function deployment.

.google.cloud.functions.v1.CloudFunctionStatus status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
CloudFunctionStatus

The status.

getStatusValue()

publicintgetStatusValue()

Output only. Status of the function deployment.

.google.cloud.functions.v1.CloudFunctionStatus status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The enum numeric value on the wire for status.

getTimeout()

publicDurationgetTimeout()

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.

.google.protobuf.Duration timeout = 9;

Returns
Type Description
Duration

The timeout.

getTimeoutOrBuilder()

publicDurationOrBuildergetTimeoutOrBuilder()

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.

.google.protobuf.Duration timeout = 9;

Returns
Type Description

getTriggerCase()

publicCloudFunction.TriggerCasegetTriggerCase()
Returns
Type Description

getUnknownFields()

publicfinalUnknownFieldSetgetUnknownFields()
Returns
Type Description
Overrides

getUpdateTime()

publicTimestampgetUpdateTime()

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

.google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The updateTime.

getUpdateTimeOrBuilder()

publicTimestampOrBuildergetUpdateTimeOrBuilder()

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

.google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description

getVersionId()

publiclonggetVersionId()

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

int64 version_id = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
long

The versionId.

getVpcConnector()

publicStringgetVpcConnector()

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 projects/*/locations/*/connectors/* This field is mutually exclusive with network field and will eventually replace it. See the VPC documentation for more information on connecting Cloud projects.

string vpc_connector = 22;

Returns
Type Description
String

The vpcConnector.

getVpcConnectorBytes()

publicByteStringgetVpcConnectorBytes()

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 projects/*/locations/*/connectors/* This field is mutually exclusive with network field and will eventually replace it. See the VPC documentation for more information on connecting Cloud projects.

string vpc_connector = 22;

Returns
Type Description
ByteString

The bytes for vpcConnector.

getVpcConnectorEgressSettings()

publicCloudFunction.VpcConnectorEgressSettingsgetVpcConnectorEgressSettings()

The egress settings for the connector, controlling what traffic is diverted through it.

.google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings vpc_connector_egress_settings = 23;

Returns
Type Description
CloudFunction.VpcConnectorEgressSettings

The vpcConnectorEgressSettings.

getVpcConnectorEgressSettingsValue()

publicintgetVpcConnectorEgressSettingsValue()

The egress settings for the connector, controlling what traffic is diverted through it.

.google.cloud.functions.v1.CloudFunction.VpcConnectorEgressSettings vpc_connector_egress_settings = 23;

Returns
Type Description
int

The enum numeric value on the wire for vpcConnectorEgressSettings.

hasEventTrigger()

publicbooleanhasEventTrigger()

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

.google.cloud.functions.v1.EventTrigger event_trigger = 6;

Returns
Type Description
boolean

Whether the eventTrigger field is set.

hasHttpsTrigger()

publicbooleanhasHttpsTrigger()

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

.google.cloud.functions.v1.HttpsTrigger https_trigger = 5;

Returns
Type Description
boolean

Whether the httpsTrigger field is set.

hasSourceArchiveUrl()

publicbooleanhasSourceArchiveUrl()

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

string source_archive_url = 3;

Returns
Type Description
boolean

Whether the sourceArchiveUrl field is set.

hasSourceRepository()

publicbooleanhasSourceRepository()

Beta Feature The source repository where a function is hosted.

.google.cloud.functions.v1.SourceRepository source_repository = 4;

Returns
Type Description
boolean

Whether the sourceRepository field is set.

hasSourceUploadUrl()

publicbooleanhasSourceUploadUrl()

The Google Cloud Storage signed URL used for source uploading, generated by calling [google.cloud.functions.v1.GenerateUploadUrl]. The signature is validated on write methods (Create, Update) The signature is stripped from the Function object on read methods (Get, List)

string source_upload_url = 16;

Returns
Type Description
boolean

Whether the sourceUploadUrl field is set.

hasTimeout()

publicbooleanhasTimeout()

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.

.google.protobuf.Duration timeout = 9;

Returns
Type Description
boolean

Whether the timeout field is set.

hasUpdateTime()

publicbooleanhasUpdateTime()

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

.google.protobuf.Timestamp update_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the updateTime field is set.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
Overrides

internalGetMapField(int number)

protectedMapFieldinternalGetMapField(intnumber)
Parameter
Name Description
number int
Returns
Type Description
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
Overrides

newBuilderForType()

publicCloudFunction.BuildernewBuilderForType()
Returns
Type Description

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedCloudFunction.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
Returns
Type Description
Overrides

toBuilder()

publicCloudFunction.BuildertoBuilder()
Returns
Type Description

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
Overrides Exceptions
Type Description

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.