Class ServiceConfig

  • All Implemented Interfaces:
    ServiceConfigOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class ServiceConfig
    extends com.google.protobuf.GeneratedMessageV3
    implements ServiceConfigOrBuilder
     Describes the Service being deployed.
     Currently Supported : Cloud Run (fully managed).
     
    Protobuf type google.cloud.functions.v2.ServiceConfig
    See Also:
    Serialized Form
    • Field Detail

      • TIMEOUT_SECONDS_FIELD_NUMBER

        public static final int TIMEOUT_SECONDS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • AVAILABLE_MEMORY_FIELD_NUMBER

        public static final int AVAILABLE_MEMORY_FIELD_NUMBER
        See Also:
        Constant Field Values
      • AVAILABLE_CPU_FIELD_NUMBER

        public static final int AVAILABLE_CPU_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ENVIRONMENT_VARIABLES_FIELD_NUMBER

        public static final int ENVIRONMENT_VARIABLES_FIELD_NUMBER
        See Also:
        Constant Field Values
      • MAX_INSTANCE_COUNT_FIELD_NUMBER

        public static final int MAX_INSTANCE_COUNT_FIELD_NUMBER
        See Also:
        Constant Field Values
      • MIN_INSTANCE_COUNT_FIELD_NUMBER

        public static final int MIN_INSTANCE_COUNT_FIELD_NUMBER
        See Also:
        Constant Field Values
      • VPC_CONNECTOR_FIELD_NUMBER

        public static final int VPC_CONNECTOR_FIELD_NUMBER
        See Also:
        Constant Field Values
      • VPC_CONNECTOR_EGRESS_SETTINGS_FIELD_NUMBER

        public static final int VPC_CONNECTOR_EGRESS_SETTINGS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • INGRESS_SETTINGS_FIELD_NUMBER

        public static final int INGRESS_SETTINGS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER

        public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ALL_TRAFFIC_ON_LATEST_REVISION_FIELD_NUMBER

        public static final int ALL_TRAFFIC_ON_LATEST_REVISION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • SECRET_ENVIRONMENT_VARIABLES_FIELD_NUMBER

        public static final int SECRET_ENVIRONMENT_VARIABLES_FIELD_NUMBER
        See Also:
        Constant Field Values
      • SECRET_VOLUMES_FIELD_NUMBER

        public static final int SECRET_VOLUMES_FIELD_NUMBER
        See Also:
        Constant Field Values
      • MAX_INSTANCE_REQUEST_CONCURRENCY_FIELD_NUMBER

        public static final int MAX_INSTANCE_REQUEST_CONCURRENCY_FIELD_NUMBER
        See Also:
        Constant Field Values
      • SECURITY_LEVEL_FIELD_NUMBER

        public static final int SECURITY_LEVEL_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetMapField

        protected com.google.protobuf.MapField internalGetMapField​(int number)
        Overrides:
        internalGetMapField in class com.google.protobuf.GeneratedMessageV3
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • 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) = { ... }
        Specified by:
        getService in interface ServiceConfigOrBuilder
        Returns:
        The service.
      • getServiceBytes

        public com.google.protobuf.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) = { ... }
        Specified by:
        getServiceBytes in interface ServiceConfigOrBuilder
        Returns:
        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;
        Specified by:
        getTimeoutSeconds in interface ServiceConfigOrBuilder
        Returns:
        The timeoutSeconds.
      • 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;
        Specified by:
        getAvailableMemory in interface ServiceConfigOrBuilder
        Returns:
        The availableMemory.
      • getAvailableMemoryBytes

        public com.google.protobuf.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;
        Specified by:
        getAvailableMemoryBytes in interface ServiceConfigOrBuilder
        Returns:
        The bytes for availableMemory.
      • 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;
        Specified by:
        getAvailableCpu in interface ServiceConfigOrBuilder
        Returns:
        The availableCpu.
      • getAvailableCpuBytes

        public com.google.protobuf.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;
        Specified by:
        getAvailableCpuBytes in interface ServiceConfigOrBuilder
        Returns:
        The bytes for availableCpu.
      • containsEnvironmentVariables

        public boolean containsEnvironmentVariables​(String key)
         Environment variables that shall be available during function execution.
         
        map<string, string> environment_variables = 4;
        Specified by:
        containsEnvironmentVariables in interface ServiceConfigOrBuilder
      • 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](https://cloud.google.com/functions/docs/max-instances) Guide for
         more details.
         
        int32 max_instance_count = 5;
        Specified by:
        getMaxInstanceCount in interface ServiceConfigOrBuilder
        Returns:
        The maxInstanceCount.
      • 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;
        Specified by:
        getMinInstanceCount in interface ServiceConfigOrBuilder
        Returns:
        The minInstanceCount.
      • 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) = { ... }
        Specified by:
        getVpcConnector in interface ServiceConfigOrBuilder
        Returns:
        The vpcConnector.
      • getVpcConnectorBytes

        public com.google.protobuf.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) = { ... }
        Specified by:
        getVpcConnectorBytes in interface ServiceConfigOrBuilder
        Returns:
        The bytes for vpcConnector.
      • getVpcConnectorEgressSettingsValue

        public int getVpcConnectorEgressSettingsValue()
         The egress settings for the connector, controlling what traffic is diverted
         through it.
         
        .google.cloud.functions.v2.ServiceConfig.VpcConnectorEgressSettings vpc_connector_egress_settings = 7;
        Specified by:
        getVpcConnectorEgressSettingsValue in interface ServiceConfigOrBuilder
        Returns:
        The enum numeric value on the wire for vpcConnectorEgressSettings.
      • getIngressSettingsValue

        public int getIngressSettingsValue()
         The ingress settings for the function, controlling what traffic can reach
         it.
         
        .google.cloud.functions.v2.ServiceConfig.IngressSettings ingress_settings = 8;
        Specified by:
        getIngressSettingsValue in interface ServiceConfigOrBuilder
        Returns:
        The enum numeric value on the wire for ingressSettings.
      • getUri

        public String getUri()
         Output only. URI of the Service deployed.
         
        string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getUri in interface ServiceConfigOrBuilder
        Returns:
        The uri.
      • getUriBytes

        public com.google.protobuf.ByteString getUriBytes()
         Output only. URI of the Service deployed.
         
        string uri = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getUriBytes in interface ServiceConfigOrBuilder
        Returns:
        The bytes for uri.
      • 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;
        Specified by:
        getServiceAccountEmail in interface ServiceConfigOrBuilder
        Returns:
        The serviceAccountEmail.
      • getServiceAccountEmailBytes

        public com.google.protobuf.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;
        Specified by:
        getServiceAccountEmailBytes in interface ServiceConfigOrBuilder
        Returns:
        The bytes for serviceAccountEmail.
      • 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;
        Specified by:
        getAllTrafficOnLatestRevision in interface ServiceConfigOrBuilder
        Returns:
        The allTrafficOnLatestRevision.
      • getSecretEnvironmentVariablesCount

        public int getSecretEnvironmentVariablesCount()
         Secret environment variables configuration.
         
        repeated .google.cloud.functions.v2.SecretEnvVar secret_environment_variables = 17;
        Specified by:
        getSecretEnvironmentVariablesCount in interface ServiceConfigOrBuilder
      • getSecretVolumesCount

        public int getSecretVolumesCount()
         Secret volumes configuration.
         
        repeated .google.cloud.functions.v2.SecretVolume secret_volumes = 19;
        Specified by:
        getSecretVolumesCount in interface ServiceConfigOrBuilder
      • getRevision

        public String getRevision()
         Output only. The name of service revision.
         
        string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getRevision in interface ServiceConfigOrBuilder
        Returns:
        The revision.
      • getRevisionBytes

        public com.google.protobuf.ByteString getRevisionBytes()
         Output only. The name of service revision.
         
        string revision = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getRevisionBytes in interface ServiceConfigOrBuilder
        Returns:
        The bytes for revision.
      • 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;
        Specified by:
        getMaxInstanceRequestConcurrency in interface ServiceConfigOrBuilder
        Returns:
        The maxInstanceRequestConcurrency.
      • 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.v2.ServiceConfig.SecurityLevel security_level = 21;
        Specified by:
        getSecurityLevelValue in interface ServiceConfigOrBuilder
        Returns:
        The enum numeric value on the wire for securityLevel.
      • 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.v2.ServiceConfig.SecurityLevel security_level = 21;
        Specified by:
        getSecurityLevel in interface ServiceConfigOrBuilder
        Returns:
        The securityLevel.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static ServiceConfig parseFrom​(ByteBuffer data)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ServiceConfig parseFrom​(ByteBuffer data,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ServiceConfig parseFrom​(com.google.protobuf.ByteString data)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ServiceConfig parseFrom​(com.google.protobuf.ByteString data,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ServiceConfig parseFrom​(byte[] data)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ServiceConfig parseFrom​(byte[] data,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ServiceConfig parseFrom​(com.google.protobuf.CodedInputStream input,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                       throws IOException
        Throws:
        IOException
      • newBuilderForType

        public ServiceConfig.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public ServiceConfig.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected ServiceConfig.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static ServiceConfig getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<ServiceConfig> parser()
      • getParserForType

        public com.google.protobuf.Parser<ServiceConfig> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public ServiceConfig getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder