Class CloudFunction (2.54.0)

public final class CloudFunction extends GeneratedMessageV3 implements CloudFunctionOrBuilder

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

Static Fields

AUTOMATIC_UPDATE_POLICY_FIELD_NUMBER

public static final int AUTOMATIC_UPDATE_POLICY_FIELD_NUMBER
Field Value
Type Description
int

AVAILABLE_MEMORY_MB_FIELD_NUMBER

public static final int AVAILABLE_MEMORY_MB_FIELD_NUMBER
Field Value
Type Description
int

BUILD_ENVIRONMENT_VARIABLES_FIELD_NUMBER

public static final int BUILD_ENVIRONMENT_VARIABLES_FIELD_NUMBER
Field Value
Type Description
int

BUILD_ID_FIELD_NUMBER

public static final int BUILD_ID_FIELD_NUMBER
Field Value
Type Description
int

BUILD_NAME_FIELD_NUMBER

public static final int BUILD_NAME_FIELD_NUMBER
Field Value
Type Description
int

BUILD_SERVICE_ACCOUNT_FIELD_NUMBER

public static final int BUILD_SERVICE_ACCOUNT_FIELD_NUMBER
Field Value
Type Description
int

BUILD_WORKER_POOL_FIELD_NUMBER

public static final int BUILD_WORKER_POOL_FIELD_NUMBER
Field Value
Type Description
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
Type Description
int

DOCKER_REGISTRY_FIELD_NUMBER

public static final int DOCKER_REGISTRY_FIELD_NUMBER
Field Value
Type Description
int

DOCKER_REPOSITORY_FIELD_NUMBER

public static final int DOCKER_REPOSITORY_FIELD_NUMBER
Field Value
Type Description
int

ENTRY_POINT_FIELD_NUMBER

public static final int ENTRY_POINT_FIELD_NUMBER
Field Value
Type Description
int

ENVIRONMENT_VARIABLES_FIELD_NUMBER

public static final int ENVIRONMENT_VARIABLES_FIELD_NUMBER
Field Value
Type Description
int

EVENT_TRIGGER_FIELD_NUMBER

public static final int EVENT_TRIGGER_FIELD_NUMBER
Field Value
Type Description
int

HTTPS_TRIGGER_FIELD_NUMBER

public static final int HTTPS_TRIGGER_FIELD_NUMBER
Field Value
Type Description
int

INGRESS_SETTINGS_FIELD_NUMBER

public static final int INGRESS_SETTINGS_FIELD_NUMBER
Field Value
Type Description
int

KMS_KEY_NAME_FIELD_NUMBER

public static final int KMS_KEY_NAME_FIELD_NUMBER
Field Value
Type Description
int

LABELS_FIELD_NUMBER

public static final int LABELS_FIELD_NUMBER
Field Value
Type Description
int

MAX_INSTANCES_FIELD_NUMBER

public static final int MAX_INSTANCES_FIELD_NUMBER
Field Value
Type Description
int

MIN_INSTANCES_FIELD_NUMBER

public static final int MIN_INSTANCES_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

NETWORK_FIELD_NUMBER

public static final int NETWORK_FIELD_NUMBER
Field Value
Type Description
int

ON_DEPLOY_UPDATE_POLICY_FIELD_NUMBER

public static final int ON_DEPLOY_UPDATE_POLICY_FIELD_NUMBER
Field Value
Type Description
int

RUNTIME_FIELD_NUMBER

public static final int RUNTIME_FIELD_NUMBER
Field Value
Type Description
int

SECRET_ENVIRONMENT_VARIABLES_FIELD_NUMBER

public static final int SECRET_ENVIRONMENT_VARIABLES_FIELD_NUMBER
Field Value
Type Description
int

SECRET_VOLUMES_FIELD_NUMBER

public static final int SECRET_VOLUMES_FIELD_NUMBER
Field Value
Type Description
int

SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER

public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER
Field Value
Type Description
int

SOURCE_ARCHIVE_URL_FIELD_NUMBER

public static final int SOURCE_ARCHIVE_URL_FIELD_NUMBER
Field Value
Type Description
int

SOURCE_REPOSITORY_FIELD_NUMBER

public static final int SOURCE_REPOSITORY_FIELD_NUMBER
Field Value
Type Description
int

SOURCE_TOKEN_FIELD_NUMBER

public static final int SOURCE_TOKEN_FIELD_NUMBER
Field Value
Type Description
int

SOURCE_UPLOAD_URL_FIELD_NUMBER

public static final int SOURCE_UPLOAD_URL_FIELD_NUMBER
Field Value
Type Description
int

STATUS_FIELD_NUMBER

public static final int STATUS_FIELD_NUMBER
Field Value
Type Description
int

TIMEOUT_FIELD_NUMBER

public static final int TIMEOUT_FIELD_NUMBER
Field Value
Type Description
int

UPDATE_TIME_FIELD_NUMBER

public static final int UPDATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

VERSION_ID_FIELD_NUMBER

public static final int VERSION_ID_FIELD_NUMBER
Field Value
Type Description
int

VPC_CONNECTOR_EGRESS_SETTINGS_FIELD_NUMBER

public static final int VPC_CONNECTOR_EGRESS_SETTINGS_FIELD_NUMBER
Field Value
Type Description
int

VPC_CONNECTOR_FIELD_NUMBER

public static final int VPC_CONNECTOR_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static CloudFunction getDefaultInstance()
Returns
Type Description
CloudFunction

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static CloudFunction.Builder newBuilder()
Returns
Type Description
CloudFunction.Builder

newBuilder(CloudFunction prototype)

public static CloudFunction.Builder newBuilder(CloudFunction prototype)
Parameter
Name Description
prototype CloudFunction
Returns
Type Description
CloudFunction.Builder

parseDelimitedFrom(InputStream input)

public static CloudFunction parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CloudFunction
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CloudFunction parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudFunction
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static CloudFunction parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
CloudFunction
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static CloudFunction parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudFunction
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static CloudFunction parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
CloudFunction
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static CloudFunction parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudFunction
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static CloudFunction parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
CloudFunction
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static CloudFunction parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudFunction
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static CloudFunction parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CloudFunction
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CloudFunction parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudFunction
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static CloudFunction parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
CloudFunction
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static CloudFunction parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudFunction
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<CloudFunction> parser()
Returns
Type Description
Parser<CloudFunction>

Methods

containsBuildEnvironmentVariables(String key)

public boolean containsBuildEnvironmentVariables(String key)

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
boolean

containsEnvironmentVariables(String key)

public boolean containsEnvironmentVariables(String key)

Environment variables that shall be available during function execution.

map<string, string> environment_variables = 17;

Parameter
Name Description
key String
Returns
Type Description
boolean

containsLabels(String key)

public boolean containsLabels(String key)

Labels associated with this Cloud Function.

map<string, string> labels = 15;

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getAutomaticUpdatePolicy()

public CloudFunction.AutomaticUpdatePolicy getAutomaticUpdatePolicy()

.google.cloud.functions.v1.CloudFunction.AutomaticUpdatePolicy automatic_update_policy = 40;

Returns
Type Description
CloudFunction.AutomaticUpdatePolicy

The automaticUpdatePolicy.

getAutomaticUpdatePolicyOrBuilder()

public CloudFunction.AutomaticUpdatePolicyOrBuilder getAutomaticUpdatePolicyOrBuilder()

.google.cloud.functions.v1.CloudFunction.AutomaticUpdatePolicy automatic_update_policy = 40;

Returns
Type Description
CloudFunction.AutomaticUpdatePolicyOrBuilder

getAvailableMemoryMb()

public int getAvailableMemoryMb()

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() (deprecated)

public Map<String,String> getBuildEnvironmentVariables()
Returns
Type Description
Map<String,String>

getBuildEnvironmentVariablesCount()

public int getBuildEnvironmentVariablesCount()

Build environment variables that shall be available during build time.

map<string, string> build_environment_variables = 28;

Returns
Type Description
int

getBuildEnvironmentVariablesMap()

public Map<String,String> getBuildEnvironmentVariablesMap()

Build environment variables that shall be available during build time.

map<string, string> build_environment_variables = 28;

Returns
Type Description
Map<String,String>

getBuildEnvironmentVariablesOrDefault(String key, String defaultValue)

public String getBuildEnvironmentVariablesOrDefault(String key, String defaultValue)

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
String

getBuildEnvironmentVariablesOrThrow(String key)

public String getBuildEnvironmentVariablesOrThrow(String key)

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
String

getBuildId()

public String getBuildId()

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()

public ByteString getBuildIdBytes()

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()

public String getBuildName()

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()

public ByteString getBuildNameBytes()

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.

getBuildServiceAccount()

public String getBuildServiceAccount()

A service account the user provides for use with Cloud Build. The format of this field is projects/{projectId}/serviceAccounts/{serviceAccountEmail}.

string build_service_account = 43;

Returns
Type Description
String

The buildServiceAccount.

getBuildServiceAccountBytes()

public ByteString getBuildServiceAccountBytes()

A service account the user provides for use with Cloud Build. The format of this field is projects/{projectId}/serviceAccounts/{serviceAccountEmail}.

string build_service_account = 43;

Returns
Type Description
ByteString

The bytes for buildServiceAccount.

getBuildWorkerPool()

public String getBuildWorkerPool()

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()

public ByteString getBuildWorkerPoolBytes()

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()

public CloudFunction getDefaultInstanceForType()
Returns
Type Description
CloudFunction

getDescription()

public String getDescription()

User-provided description of a function.

string description = 2;

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

User-provided description of a function.

string description = 2;

Returns
Type Description
ByteString

The bytes for description.

getDockerRegistry()

public CloudFunction.DockerRegistry getDockerRegistry()

Docker Registry to use for this deployment.

If unspecified, it defaults to ARTIFACT_REGISTRY. If docker_repository field is specified, this field should either be left unspecified or set to ARTIFACT_REGISTRY.

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

Returns
Type Description
CloudFunction.DockerRegistry

The dockerRegistry.

getDockerRegistryValue()

public int getDockerRegistryValue()

Docker Registry to use for this deployment.

If unspecified, it defaults to ARTIFACT_REGISTRY. If docker_repository field is specified, this field should either be left unspecified or set to ARTIFACT_REGISTRY.

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

Returns
Type Description
int

The enum numeric value on the wire for dockerRegistry.

getDockerRepository()

public String getDockerRepository()

User-managed repository created in Artifact Registry to which the function's Docker image will be pushed after it is built by Cloud Build. May optionally be encrypted with a customer-managed encryption key (CMEK). If unspecified and docker_registry is not explicitly set to CONTAINER_REGISTRY, GCF will create and use a default Artifact Registry repository named 'gcf-artifacts' in the region.

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()

public ByteString getDockerRepositoryBytes()

User-managed repository created in Artifact Registry to which the function's Docker image will be pushed after it is built by Cloud Build. May optionally be encrypted with a customer-managed encryption key (CMEK). If unspecified and docker_registry is not explicitly set to CONTAINER_REGISTRY, GCF will create and use a default Artifact Registry repository named 'gcf-artifacts' in the region.

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()

public String getEntryPoint()

The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix (ID of the function), if not specified.

string entry_point = 8;

Returns
Type Description
String

The entryPoint.

getEntryPointBytes()

public ByteString getEntryPointBytes()

The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix (ID of the function), if not specified.

string entry_point = 8;

Returns
Type Description
ByteString

The bytes for entryPoint.

getEnvironmentVariables() (deprecated)

public Map<String,String> getEnvironmentVariables()
Returns
Type Description
Map<String,String>

getEnvironmentVariablesCount()

public int getEnvironmentVariablesCount()

Environment variables that shall be available during function execution.

map<string, string> environment_variables = 17;

Returns
Type Description
int

getEnvironmentVariablesMap()

public Map<String,String> getEnvironmentVariablesMap()

Environment variables that shall be available during function execution.

map<string, string> environment_variables = 17;

Returns
Type Description
Map<String,String>

getEnvironmentVariablesOrDefault(String key, String defaultValue)

public String getEnvironmentVariablesOrDefault(String key, String defaultValue)

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
String

getEnvironmentVariablesOrThrow(String key)

public String getEnvironmentVariablesOrThrow(String key)

Environment variables that shall be available during function execution.

map<string, string> environment_variables = 17;

Parameter
Name Description
key String
Returns
Type Description
String

getEventTrigger()

public EventTrigger getEventTrigger()

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()

public EventTriggerOrBuilder getEventTriggerOrBuilder()

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

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

Returns
Type Description
EventTriggerOrBuilder

getHttpsTrigger()

public HttpsTrigger getHttpsTrigger()

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()

public HttpsTriggerOrBuilder getHttpsTriggerOrBuilder()

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

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

Returns
Type Description
HttpsTriggerOrBuilder

getIngressSettings()

public CloudFunction.IngressSettings getIngressSettings()

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()

public int getIngressSettingsValue()

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()

public String getKmsKeyName()

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()

public ByteString getKmsKeyNameBytes()

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() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
Type Description
Map<String,String>

getLabelsCount()

public int getLabelsCount()

Labels associated with this Cloud Function.

map<string, string> labels = 15;

Returns
Type Description
int

getLabelsMap()

public Map<String,String> getLabelsMap()

Labels associated with this Cloud Function.

map<string, string> labels = 15;

Returns
Type Description
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

Labels associated with this Cloud Function.

map<string, string> labels = 15;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

Labels associated with this Cloud Function.

map<string, string> labels = 15;

Parameter
Name Description
key String
Returns
Type Description
String

getMaxInstances()

public int getMaxInstances()

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()

public int getMinInstances()

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()

public String getName()

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()

public ByteString getNameBytes()

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() (deprecated)

public String getNetwork()

Deprecated. google.cloud.functions.v1.CloudFunction.network is deprecated. See google/cloud/functions/v1/functions.proto;l=355

Deprecated: use vpc_connector

string network = 18 [deprecated = true];

Returns
Type Description
String

The network.

getNetworkBytes() (deprecated)

public ByteString getNetworkBytes()

Deprecated. google.cloud.functions.v1.CloudFunction.network is deprecated. See google/cloud/functions/v1/functions.proto;l=355

Deprecated: use vpc_connector

string network = 18 [deprecated = true];

Returns
Type Description
ByteString

The bytes for network.

getOnDeployUpdatePolicy()

public CloudFunction.OnDeployUpdatePolicy getOnDeployUpdatePolicy()

.google.cloud.functions.v1.CloudFunction.OnDeployUpdatePolicy on_deploy_update_policy = 41;

Returns
Type Description
CloudFunction.OnDeployUpdatePolicy

The onDeployUpdatePolicy.

getOnDeployUpdatePolicyOrBuilder()

public CloudFunction.OnDeployUpdatePolicyOrBuilder getOnDeployUpdatePolicyOrBuilder()

.google.cloud.functions.v1.CloudFunction.OnDeployUpdatePolicy on_deploy_update_policy = 41;

Returns
Type Description
CloudFunction.OnDeployUpdatePolicyOrBuilder

getParserForType()

public Parser<CloudFunction> getParserForType()
Returns
Type Description
Parser<CloudFunction>
Overrides

getRuntime()

public String getRuntime()

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()

public ByteString getRuntimeBytes()

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.

getRuntimeUpdatePolicyCase()

public CloudFunction.RuntimeUpdatePolicyCase getRuntimeUpdatePolicyCase()
Returns
Type Description
CloudFunction.RuntimeUpdatePolicyCase

getSecretEnvironmentVariables(int index)

public SecretEnvVar getSecretEnvironmentVariables(int index)

Secret environment variables configuration.

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

Parameter
Name Description
index int
Returns
Type Description
SecretEnvVar

getSecretEnvironmentVariablesCount()

public int getSecretEnvironmentVariablesCount()

Secret environment variables configuration.

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

Returns
Type Description
int

getSecretEnvironmentVariablesList()

public List<SecretEnvVar> getSecretEnvironmentVariablesList()

Secret environment variables configuration.

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

Returns
Type Description
List<SecretEnvVar>

getSecretEnvironmentVariablesOrBuilder(int index)

public SecretEnvVarOrBuilder getSecretEnvironmentVariablesOrBuilder(int index)

Secret environment variables configuration.

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

Parameter
Name Description
index int
Returns
Type Description
SecretEnvVarOrBuilder

getSecretEnvironmentVariablesOrBuilderList()

public List<? extends SecretEnvVarOrBuilder> 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)

public SecretVolume getSecretVolumes(int index)

Secret volumes configuration.

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

Parameter
Name Description
index int
Returns
Type Description
SecretVolume

getSecretVolumesCount()

public int getSecretVolumesCount()

Secret volumes configuration.

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

Returns
Type Description
int

getSecretVolumesList()

public List<SecretVolume> getSecretVolumesList()

Secret volumes configuration.

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

Returns
Type Description
List<SecretVolume>

getSecretVolumesOrBuilder(int index)

public SecretVolumeOrBuilder getSecretVolumesOrBuilder(int index)

Secret volumes configuration.

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

Parameter
Name Description
index int
Returns
Type Description
SecretVolumeOrBuilder

getSecretVolumesOrBuilderList()

public List<? extends SecretVolumeOrBuilder> 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()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getServiceAccountEmail()

public String getServiceAccountEmail()

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()

public ByteString getServiceAccountEmailBytes()

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()

public String getSourceArchiveUrl()

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()

public ByteString getSourceArchiveUrlBytes()

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()

public CloudFunction.SourceCodeCase getSourceCodeCase()
Returns
Type Description
CloudFunction.SourceCodeCase

getSourceRepository()

public SourceRepository getSourceRepository()

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()

public SourceRepositoryOrBuilder getSourceRepositoryOrBuilder()

Beta Feature

The source repository where a function is hosted.

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

Returns
Type Description
SourceRepositoryOrBuilder

getSourceToken()

public String getSourceToken()

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()

public ByteString getSourceTokenBytes()

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()

public String getSourceUploadUrl()

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()

public ByteString getSourceUploadUrlBytes()

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()

public CloudFunctionStatus getStatus()

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()

public int getStatusValue()

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()

public Duration getTimeout()

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()

public DurationOrBuilder getTimeoutOrBuilder()

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
DurationOrBuilder

getTriggerCase()

public CloudFunction.TriggerCase getTriggerCase()
Returns
Type Description
CloudFunction.TriggerCase

getUpdateTime()

public Timestamp getUpdateTime()

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()

public TimestampOrBuilder getUpdateTimeOrBuilder()

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
TimestampOrBuilder

getVersionId()

public long getVersionId()

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()

public String getVpcConnector()

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()

public ByteString getVpcConnectorBytes()

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()

public CloudFunction.VpcConnectorEgressSettings getVpcConnectorEgressSettings()

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()

public int getVpcConnectorEgressSettingsValue()

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.

hasAutomaticUpdatePolicy()

public boolean hasAutomaticUpdatePolicy()

.google.cloud.functions.v1.CloudFunction.AutomaticUpdatePolicy automatic_update_policy = 40;

Returns
Type Description
boolean

Whether the automaticUpdatePolicy field is set.

hasEventTrigger()

public boolean hasEventTrigger()

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()

public boolean hasHttpsTrigger()

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.

hasOnDeployUpdatePolicy()

public boolean hasOnDeployUpdatePolicy()

.google.cloud.functions.v1.CloudFunction.OnDeployUpdatePolicy on_deploy_update_policy = 41;

Returns
Type Description
boolean

Whether the onDeployUpdatePolicy field is set.

hasSourceArchiveUrl()

public boolean hasSourceArchiveUrl()

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()

public boolean hasSourceRepository()

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()

public boolean hasSourceUploadUrl()

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()

public boolean hasTimeout()

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()

public boolean hasUpdateTime()

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()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public CloudFunction.Builder newBuilderForType()
Returns
Type Description
CloudFunction.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected CloudFunction.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
CloudFunction.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public CloudFunction.Builder toBuilder()
Returns
Type Description
CloudFunction.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException