# Cloud Functions V2 API - Class Google::Cloud::Functions::V2::ServiceConfig (v1.5.1)

1.5.1 (latest) 1.5.0 1.4.0 1.3.1 1.2.0 1.1.0 1.0.2 0.10.0 0.9.0 0.8.1 0.7.0 0.6.2 0.5.0 0.4.1 0.3.0 0.2.0 0.1.0 Reference documentation and code samples for the Cloud Functions V2 API class Google::Cloud::Functions::V2::ServiceConfig.

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

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #all_traffic_on_latest_revision

    def all_traffic_on_latest_revision() -> ::Boolean

**Returns**

- (::Boolean) --- 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.

### #all_traffic_on_latest_revision=

    def all_traffic_on_latest_revision=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- 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.
**Returns**

- (::Boolean) --- 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.

### #available_cpu

    def available_cpu() -> ::String

**Returns**

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

### #available_cpu=

    def available_cpu=(value) -> ::String

**Parameter**

- **value** (::String) --- 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
**Returns**

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

### #available_memory

    def available_memory() -> ::String

**Returns**

- (::String) --- 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.

### #available_memory=

    def available_memory=(value) -> ::String

**Parameter**

- **value** (::String) --- 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.
**Returns**

- (::String) --- 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.

### #binary_authorization_policy

    def binary_authorization_policy() -> ::String

**Returns**

- (::String) --- Optional. The binary authorization policy to be checked when deploying the Cloud Run service.

### #binary_authorization_policy=

    def binary_authorization_policy=(value) -> ::String

**Parameter**

- **value** (::String) --- Optional. The binary authorization policy to be checked when deploying the Cloud Run service.
**Returns**

- (::String) --- Optional. The binary authorization policy to be checked when deploying the Cloud Run service.

### #environment_variables

    def environment_variables() -> ::Google::Protobuf::Map{::String => ::String}

**Returns**

- (::Google::Protobuf::Map{::String =\> ::String}) --- Environment variables that shall be available during function execution.

### #environment_variables=

    def environment_variables=(value) -> ::Google::Protobuf::Map{::String => ::String}

**Parameter**

- **value** (::Google::Protobuf::Map{::String =\> ::String}) --- Environment variables that shall be available during function execution.
**Returns**

- (::Google::Protobuf::Map{::String =\> ::String}) --- Environment variables that shall be available during function execution.

### #ingress_settings

    def ingress_settings() -> ::Google::Cloud::Functions::V2::ServiceConfig::IngressSettings

**Returns**

- ([::Google::Cloud::Functions::V2::ServiceConfig::IngressSettings](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-ServiceConfig-IngressSettings)) --- The ingress settings for the function, controlling what traffic can reach it.

### #ingress_settings=

    def ingress_settings=(value) -> ::Google::Cloud::Functions::V2::ServiceConfig::IngressSettings

**Parameter**

- **value** ([::Google::Cloud::Functions::V2::ServiceConfig::IngressSettings](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-ServiceConfig-IngressSettings)) --- The ingress settings for the function, controlling what traffic can reach it.
**Returns**

- ([::Google::Cloud::Functions::V2::ServiceConfig::IngressSettings](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-ServiceConfig-IngressSettings)) --- The ingress settings for the function, controlling what traffic can reach it.

### #max_instance_count

    def max_instance_count() -> ::Integer

**Returns**

- (::Integer) --- 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.

### #max_instance_count=

    def max_instance_count=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- 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.
**Returns**

- (::Integer) --- 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.

### #max_instance_request_concurrency

    def max_instance_request_concurrency() -> ::Integer

**Returns**

- (::Integer) --- Sets the maximum number of concurrent requests that each instance can receive. Defaults to 1.

### #max_instance_request_concurrency=

    def max_instance_request_concurrency=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Sets the maximum number of concurrent requests that each instance can receive. Defaults to 1.
**Returns**

- (::Integer) --- Sets the maximum number of concurrent requests that each instance can receive. Defaults to 1.

### #min_instance_count

    def min_instance_count() -> ::Integer

**Returns**

- (::Integer) --- 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.

### #min_instance_count=

    def min_instance_count=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- 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.
**Returns**

- (::Integer) --- 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.

### #revision

    def revision() -> ::String

**Returns**

- (::String) --- Output only. The name of service revision.

### #secret_environment_variables

    def secret_environment_variables() -> ::Array<::Google::Cloud::Functions::V2::SecretEnvVar>

**Returns**

- (::Array\<[::Google::Cloud::Functions::V2::SecretEnvVar](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-SecretEnvVar)\>) --- Secret environment variables configuration.

### #secret_environment_variables=

    def secret_environment_variables=(value) -> ::Array<::Google::Cloud::Functions::V2::SecretEnvVar>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Functions::V2::SecretEnvVar](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-SecretEnvVar)\>) --- Secret environment variables configuration.
**Returns**

- (::Array\<[::Google::Cloud::Functions::V2::SecretEnvVar](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-SecretEnvVar)\>) --- Secret environment variables configuration.

### #secret_volumes

    def secret_volumes() -> ::Array<::Google::Cloud::Functions::V2::SecretVolume>

**Returns**

- (::Array\<[::Google::Cloud::Functions::V2::SecretVolume](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-SecretVolume)\>) --- Secret volumes configuration.

### #secret_volumes=

    def secret_volumes=(value) -> ::Array<::Google::Cloud::Functions::V2::SecretVolume>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Functions::V2::SecretVolume](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-SecretVolume)\>) --- Secret volumes configuration.
**Returns**

- (::Array\<[::Google::Cloud::Functions::V2::SecretVolume](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-SecretVolume)\>) --- Secret volumes configuration.

### #security_level

    def security_level() -> ::Google::Cloud::Functions::V2::ServiceConfig::SecurityLevel

**Returns**

- ([::Google::Cloud::Functions::V2::ServiceConfig::SecurityLevel](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-ServiceConfig-SecurityLevel)) --- 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.

### #security_level=

    def security_level=(value) -> ::Google::Cloud::Functions::V2::ServiceConfig::SecurityLevel

**Parameter**

- **value** ([::Google::Cloud::Functions::V2::ServiceConfig::SecurityLevel](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-ServiceConfig-SecurityLevel)) --- 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.
**Returns**

- ([::Google::Cloud::Functions::V2::ServiceConfig::SecurityLevel](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-ServiceConfig-SecurityLevel)) --- 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.

### #service

    def service() -> ::String

**Returns**

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

### #service_account_email

    def service_account_email() -> ::String

**Returns**

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

### #service_account_email=

    def service_account_email=(value) -> ::String

**Parameter**

- **value** (::String) --- The email of the service's service account. If empty, defaults to `{project_number}-compute@developer.gserviceaccount.com`.
**Returns**

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

### #timeout_seconds

    def timeout_seconds() -> ::Integer

**Returns**

- (::Integer) --- 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.

### #timeout_seconds=

    def timeout_seconds=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- 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.
**Returns**

- (::Integer) --- 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.

### #uri

    def uri() -> ::String

**Returns**

- (::String) --- Output only. URI of the Service deployed.

### #vpc_connector

    def vpc_connector() -> ::String

**Returns**

- (::String) --- The Serverless VPC Access connector that this cloud function can connect to. The format of this field is `projects/*/locations/*/connectors/*`.

### #vpc_connector=

    def vpc_connector=(value) -> ::String

**Parameter**

- **value** (::String) --- The Serverless VPC Access connector that this cloud function can connect to. The format of this field is `projects/*/locations/*/connectors/*`.
**Returns**

- (::String) --- The Serverless VPC Access connector that this cloud function can connect to. The format of this field is `projects/*/locations/*/connectors/*`.

### #vpc_connector_egress_settings

    def vpc_connector_egress_settings() -> ::Google::Cloud::Functions::V2::ServiceConfig::VpcConnectorEgressSettings

**Returns**

- ([::Google::Cloud::Functions::V2::ServiceConfig::VpcConnectorEgressSettings](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-ServiceConfig-VpcConnectorEgressSettings)) --- The egress settings for the connector, controlling what traffic is diverted through it.

### #vpc_connector_egress_settings=

    def vpc_connector_egress_settings=(value) -> ::Google::Cloud::Functions::V2::ServiceConfig::VpcConnectorEgressSettings

**Parameter**

- **value** ([::Google::Cloud::Functions::V2::ServiceConfig::VpcConnectorEgressSettings](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-ServiceConfig-VpcConnectorEgressSettings)) --- The egress settings for the connector, controlling what traffic is diverted through it.
**Returns**

- ([::Google::Cloud::Functions::V2::ServiceConfig::VpcConnectorEgressSettings](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-functions-v2/latest/Google-Cloud-Functions-V2-ServiceConfig-VpcConnectorEgressSettings)) --- The egress settings for the connector, controlling what traffic is diverted through it.