Class ServiceConfig (2.44.0)

public final class ServiceConfig extends GeneratedMessageV3 implements ServiceConfigOrBuilder

Describes the Service being deployed. Currently Supported : Cloud Run (fully managed).

Protobuf type google.cloud.functions.v2beta.ServiceConfig

Static Fields

ALL_TRAFFIC_ON_LATEST_REVISION_FIELD_NUMBER

public static final int ALL_TRAFFIC_ON_LATEST_REVISION_FIELD_NUMBER
Field Value
Type Description
int

AVAILABLE_CPU_FIELD_NUMBER

public static final int AVAILABLE_CPU_FIELD_NUMBER
Field Value
Type Description
int

AVAILABLE_MEMORY_FIELD_NUMBER

public static final int AVAILABLE_MEMORY_FIELD_NUMBER
Field Value
Type Description
int

ENVIRONMENT_VARIABLES_FIELD_NUMBER

public static final int ENVIRONMENT_VARIABLES_FIELD_NUMBER
Field Value
Type Description
int

INGRESS_SETTINGS_FIELD_NUMBER

public static final int INGRESS_SETTINGS_FIELD_NUMBER
Field Value
Type Description
int

MAX_INSTANCE_COUNT_FIELD_NUMBER

public static final int MAX_INSTANCE_COUNT_FIELD_NUMBER
Field Value
Type Description
int

MAX_INSTANCE_REQUEST_CONCURRENCY_FIELD_NUMBER

public static final int MAX_INSTANCE_REQUEST_CONCURRENCY_FIELD_NUMBER
Field Value
Type Description
int

MIN_INSTANCE_COUNT_FIELD_NUMBER

public static final int MIN_INSTANCE_COUNT_FIELD_NUMBER
Field Value
Type Description
int

REVISION_FIELD_NUMBER

public static final int REVISION_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

SECURITY_LEVEL_FIELD_NUMBER

public static final int SECURITY_LEVEL_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

SERVICE_FIELD_NUMBER

public static final int SERVICE_FIELD_NUMBER
Field Value
Type Description
int

TIMEOUT_SECONDS_FIELD_NUMBER

public static final int TIMEOUT_SECONDS_FIELD_NUMBER
Field Value
Type Description
int

URI_FIELD_NUMBER

public static final int URI_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 ServiceConfig getDefaultInstance()
Returns
Type Description
ServiceConfig

getDescriptor()

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

newBuilder()

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

newBuilder(ServiceConfig prototype)

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

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

containsEnvironmentVariables(String key)

public boolean containsEnvironmentVariables(String key)

Environment variables that shall be available during function execution.

map<string, string> environment_variables = 4;

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

getAllTrafficOnLatestRevision()

public boolean getAllTrafficOnLatestRevision()

Whether 100% of traffic is routed to the latest revision. On CreateFunction and UpdateFunction, when set to true, the revision being deployed will serve 100% of traffic, ignoring any traffic split settings, if any. On GetFunction, true will be returned if the latest revision is serving 100% of traffic.

bool all_traffic_on_latest_revision = 16;

Returns
Type Description
boolean

The allTrafficOnLatestRevision.

getAvailableCpu()

public String getAvailableCpu()

[Preview] The number of CPUs used in a single container instance. Default value is calculated from available memory. Supports the same values as Cloud Run, see https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements Example: "1" indicates 1 vCPU

string available_cpu = 22;

Returns
Type Description
String

The availableCpu.

getAvailableCpuBytes()

public ByteString getAvailableCpuBytes()

[Preview] The number of CPUs used in a single container instance. Default value is calculated from available memory. Supports the same values as Cloud Run, see https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements Example: "1" indicates 1 vCPU

string available_cpu = 22;

Returns
Type Description
ByteString

The bytes for availableCpu.

getAvailableMemory()

public String getAvailableMemory()

The amount of memory available for a function. Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is supplied the value is interpreted as bytes. See https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go a full description.

string available_memory = 13;

Returns
Type Description
String

The availableMemory.

getAvailableMemoryBytes()

public ByteString getAvailableMemoryBytes()

The amount of memory available for a function. Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is supplied the value is interpreted as bytes. See https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go a full description.

string available_memory = 13;

Returns
Type Description
ByteString

The bytes for availableMemory.

getDefaultInstanceForType()

public ServiceConfig getDefaultInstanceForType()
Returns
Type Description
ServiceConfig

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 = 4;

Returns
Type Description
int

getEnvironmentVariablesMap()

public Map<String,String> getEnvironmentVariablesMap()

Environment variables that shall be available during function execution.

map<string, string> environment_variables = 4;

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 = 4;

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 = 4;

Parameter
Name Description
key String
Returns
Type Description
String

getIngressSettings()

public ServiceConfig.IngressSettings getIngressSettings()

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

.google.cloud.functions.v2beta.ServiceConfig.IngressSettings ingress_settings = 8;

Returns
Type Description
ServiceConfig.IngressSettings

The ingressSettings.

getIngressSettingsValue()

public int getIngressSettingsValue()

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

.google.cloud.functions.v2beta.ServiceConfig.IngressSettings ingress_settings = 8;

Returns
Type Description
int

The enum numeric value on the wire for ingressSettings.

getMaxInstanceCount()

public int getMaxInstanceCount()

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_instance_count = 5;

Returns
Type Description
int

The maxInstanceCount.

getMaxInstanceRequestConcurrency()

public int getMaxInstanceRequestConcurrency()

[Preview] Sets the maximum number of concurrent requests that each instance can receive. Defaults to 1.

int32 max_instance_request_concurrency = 20;

Returns
Type Description
int

The maxInstanceRequestConcurrency.

getMinInstanceCount()

public int getMinInstanceCount()

The limit on the minimum number of function instances that may coexist at a given time.

Function instances are kept in idle state for a short period after they finished executing the request to reduce cold start time for subsequent requests. Setting a minimum instance count will ensure that the given number of instances are kept running in idle state always. This can help with cold start times when jump in incoming request count occurs after the idle instance would have been stopped in the default case.

int32 min_instance_count = 12;

Returns
Type Description
int

The minInstanceCount.

getParserForType()

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

getRevision()

public String getRevision()

Output only. The name of service revision.

string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The revision.

getRevisionBytes()

public ByteString getRevisionBytes()

Output only. The name of service revision.

string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for revision.

getSecretEnvironmentVariables(int index)

public SecretEnvVar getSecretEnvironmentVariables(int index)

Secret environment variables configuration.

repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17;

Parameter
Name Description
index int
Returns
Type Description
SecretEnvVar

getSecretEnvironmentVariablesCount()

public int getSecretEnvironmentVariablesCount()

Secret environment variables configuration.

repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17;

Returns
Type Description
int

getSecretEnvironmentVariablesList()

public List<SecretEnvVar> getSecretEnvironmentVariablesList()

Secret environment variables configuration.

repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17;

Returns
Type Description
List<SecretEnvVar>

getSecretEnvironmentVariablesOrBuilder(int index)

public SecretEnvVarOrBuilder getSecretEnvironmentVariablesOrBuilder(int index)

Secret environment variables configuration.

repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17;

Parameter
Name Description
index int
Returns
Type Description
SecretEnvVarOrBuilder

getSecretEnvironmentVariablesOrBuilderList()

public List<? extends SecretEnvVarOrBuilder> getSecretEnvironmentVariablesOrBuilderList()

Secret environment variables configuration.

repeated .google.cloud.functions.v2beta.SecretEnvVar secret_environment_variables = 17;

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

getSecretVolumes(int index)

public SecretVolume getSecretVolumes(int index)

Secret volumes configuration.

repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19;

Parameter
Name Description
index int
Returns
Type Description
SecretVolume

getSecretVolumesCount()

public int getSecretVolumesCount()

Secret volumes configuration.

repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19;

Returns
Type Description
int

getSecretVolumesList()

public List<SecretVolume> getSecretVolumesList()

Secret volumes configuration.

repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19;

Returns
Type Description
List<SecretVolume>

getSecretVolumesOrBuilder(int index)

public SecretVolumeOrBuilder getSecretVolumesOrBuilder(int index)

Secret volumes configuration.

repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19;

Parameter
Name Description
index int
Returns
Type Description
SecretVolumeOrBuilder

getSecretVolumesOrBuilderList()

public List<? extends SecretVolumeOrBuilder> getSecretVolumesOrBuilderList()

Secret volumes configuration.

repeated .google.cloud.functions.v2beta.SecretVolume secret_volumes = 19;

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

getSecurityLevel()

public ServiceConfig.SecurityLevel getSecurityLevel()

Security level configure whether the function only accepts https. This configuration is only applicable to 1st Gen functions with Http trigger. By default https is optional for 1st Gen functions; 2nd Gen functions are https ONLY.

.google.cloud.functions.v2beta.ServiceConfig.SecurityLevel security_level = 21;

Returns
Type Description
ServiceConfig.SecurityLevel

The securityLevel.

getSecurityLevelValue()

public int getSecurityLevelValue()

Security level configure whether the function only accepts https. This configuration is only applicable to 1st Gen functions with Http trigger. By default https is optional for 1st Gen functions; 2nd Gen functions are https ONLY.

.google.cloud.functions.v2beta.ServiceConfig.SecurityLevel security_level = 21;

Returns
Type Description
int

The enum numeric value on the wire for securityLevel.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getService()

public String getService()

Output only. Name of the service associated with a Function. The format of this field is projects/{project}/locations/{region}/services/{service}

string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Returns
Type Description
String

The service.

getServiceAccountEmail()

public String getServiceAccountEmail()

The email of the service's service account. If empty, defaults to {project_number}-compute@developer.gserviceaccount.com.

string service_account_email = 10;

Returns
Type Description
String

The serviceAccountEmail.

getServiceAccountEmailBytes()

public ByteString getServiceAccountEmailBytes()

The email of the service's service account. If empty, defaults to {project_number}-compute@developer.gserviceaccount.com.

string service_account_email = 10;

Returns
Type Description
ByteString

The bytes for serviceAccountEmail.

getServiceBytes()

public ByteString getServiceBytes()

Output only. Name of the service associated with a Function. The format of this field is projects/{project}/locations/{region}/services/{service}

string service = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for service.

getTimeoutSeconds()

public int getTimeoutSeconds()

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.

int32 timeout_seconds = 2;

Returns
Type Description
int

The timeoutSeconds.

getUri()

public String getUri()

Output only. URI of the Service deployed.

string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The uri.

getUriBytes()

public ByteString getUriBytes()

Output only. URI of the Service deployed.

string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for uri.

getVpcConnector()

public String getVpcConnector()

The Serverless VPC Access connector that this cloud function can connect to. The format of this field is projects/*/locations/*/connectors/*.

string vpc_connector = 6 [(.google.api.resource_reference) = { ... }

Returns
Type Description
String

The vpcConnector.

getVpcConnectorBytes()

public ByteString getVpcConnectorBytes()

The Serverless VPC Access connector that this cloud function can connect to. The format of this field is projects/*/locations/*/connectors/*.

string vpc_connector = 6 [(.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for vpcConnector.

getVpcConnectorEgressSettings()

public ServiceConfig.VpcConnectorEgressSettings getVpcConnectorEgressSettings()

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

.google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7;

Returns
Type Description
ServiceConfig.VpcConnectorEgressSettings

The vpcConnectorEgressSettings.

getVpcConnectorEgressSettingsValue()

public int getVpcConnectorEgressSettingsValue()

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

.google.cloud.functions.v2beta.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7;

Returns
Type Description
int

The enum numeric value on the wire for vpcConnectorEgressSettings.

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 ServiceConfig.Builder newBuilderForType()
Returns
Type Description
ServiceConfig.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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