Class: Google::Apis::CloudfunctionsV2alpha::ServiceConfig

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/cloudfunctions_v2alpha/classes.rb,
lib/google/apis/cloudfunctions_v2alpha/representations.rb,
lib/google/apis/cloudfunctions_v2alpha/representations.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ServiceConfig

Returns a new instance of ServiceConfig.



1490
1491
1492
# File 'lib/google/apis/cloudfunctions_v2alpha/classes.rb', line 1490

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#all_traffic_on_latest_revisionBoolean Also known as: all_traffic_on_latest_revision?

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. Corresponds to the JSON property allTrafficOnLatestRevision

Returns:

  • (Boolean)


1401
1402
1403
# File 'lib/google/apis/cloudfunctions_v2alpha/classes.rb', line 1401

def all_traffic_on_latest_revision
  @all_traffic_on_latest_revision
end

#available_memoryString

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. Corresponds to the JSON property availableMemory

Returns:

  • (String)


1410
1411
1412
# File 'lib/google/apis/cloudfunctions_v2alpha/classes.rb', line 1410

def available_memory
  @available_memory
end

#environment_variablesHash<String,String>

Environment variables that shall be available during function execution. Corresponds to the JSON property environmentVariables

Returns:

  • (Hash<String,String>)


1415
1416
1417
# File 'lib/google/apis/cloudfunctions_v2alpha/classes.rb', line 1415

def environment_variables
  @environment_variables
end

#ingress_settingsString

The ingress settings for the function, controlling what traffic can reach it. Corresponds to the JSON property ingressSettings

Returns:

  • (String)


1420
1421
1422
# File 'lib/google/apis/cloudfunctions_v2alpha/classes.rb', line 1420

def ingress_settings
  @ingress_settings
end

#max_instance_countFixnum

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. Corresponds to the JSON property maxInstanceCount

Returns:

  • (Fixnum)


1431
1432
1433
# File 'lib/google/apis/cloudfunctions_v2alpha/classes.rb', line 1431

def max_instance_count
  @max_instance_count
end

#min_instance_countFixnum

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. Corresponds to the JSON property minInstanceCount

Returns:

  • (Fixnum)


1442
1443
1444
# File 'lib/google/apis/cloudfunctions_v2alpha/classes.rb', line 1442

def min_instance_count
  @min_instance_count
end

#revisionString

Output only. The name of service revision. Corresponds to the JSON property revision

Returns:

  • (String)


1447
1448
1449
# File 'lib/google/apis/cloudfunctions_v2alpha/classes.rb', line 1447

def revision
  @revision
end

#secret_environment_variablesArray<Google::Apis::CloudfunctionsV2alpha::SecretEnvVar>

Secret environment variables configuration. Corresponds to the JSON property secretEnvironmentVariables



1452
1453
1454
# File 'lib/google/apis/cloudfunctions_v2alpha/classes.rb', line 1452

def secret_environment_variables
  @secret_environment_variables
end

#serviceString

Output only. Name of the service associated with a Function. The format of this field is projects/project/locations/region/services/service` Corresponds to the JSON propertyservice`

Returns:

  • (String)


1458
1459
1460
# File 'lib/google/apis/cloudfunctions_v2alpha/classes.rb', line 1458

def service
  @service
end

#service_account_emailString

The email of the service's service account. If empty, defaults to ` project_number-compute@developer.gserviceaccount.com. Corresponds to the JSON propertyserviceAccountEmail`

Returns:

  • (String)


1464
1465
1466
# File 'lib/google/apis/cloudfunctions_v2alpha/classes.rb', line 1464

def 
  @service_account_email
end

#timeout_secondsFixnum

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. Corresponds to the JSON property timeoutSeconds

Returns:

  • (Fixnum)


1471
1472
1473
# File 'lib/google/apis/cloudfunctions_v2alpha/classes.rb', line 1471

def timeout_seconds
  @timeout_seconds
end

#uriString

Output only. URI of the Service deployed. Corresponds to the JSON property uri

Returns:

  • (String)


1476
1477
1478
# File 'lib/google/apis/cloudfunctions_v2alpha/classes.rb', line 1476

def uri
  @uri
end

#vpc_connectorString

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

Returns:

  • (String)


1482
1483
1484
# File 'lib/google/apis/cloudfunctions_v2alpha/classes.rb', line 1482

def vpc_connector
  @vpc_connector
end

#vpc_connector_egress_settingsString

The egress settings for the connector, controlling what traffic is diverted through it. Corresponds to the JSON property vpcConnectorEgressSettings

Returns:

  • (String)


1488
1489
1490
# File 'lib/google/apis/cloudfunctions_v2alpha/classes.rb', line 1488

def vpc_connector_egress_settings
  @vpc_connector_egress_settings
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
# File 'lib/google/apis/cloudfunctions_v2alpha/classes.rb', line 1495

def update!(**args)
  @all_traffic_on_latest_revision = args[:all_traffic_on_latest_revision] if args.key?(:all_traffic_on_latest_revision)
  @available_memory = args[:available_memory] if args.key?(:available_memory)
  @environment_variables = args[:environment_variables] if args.key?(:environment_variables)
  @ingress_settings = args[:ingress_settings] if args.key?(:ingress_settings)
  @max_instance_count = args[:max_instance_count] if args.key?(:max_instance_count)
  @min_instance_count = args[:min_instance_count] if args.key?(:min_instance_count)
  @revision = args[:revision] if args.key?(:revision)
  @secret_environment_variables = args[:secret_environment_variables] if args.key?(:secret_environment_variables)
  @service = args[:service] if args.key?(:service)
  @service_account_email = args[:service_account_email] if args.key?(:service_account_email)
  @timeout_seconds = args[:timeout_seconds] if args.key?(:timeout_seconds)
  @uri = args[:uri] if args.key?(:uri)
  @vpc_connector = args[:vpc_connector] if args.key?(:vpc_connector)
  @vpc_connector_egress_settings = args[:vpc_connector_egress_settings] if args.key?(:vpc_connector_egress_settings)
end