Class: Google::Apis::ComputeV1::HealthCheck

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

Overview

Represents a health check resource. Google Compute Engine has two health check resources:

  • Regional
  • Global These health check resources can be used for load balancing and for autohealing VMs in a managed instance group (MIG). Load balancing Health check requirements vary depending on the type of load balancer. For details about the type of health check supported for each load balancer and corresponding backend type, see Health checks overview: Load balancer guide. Autohealing in MIGs The health checks that you use for autohealing VMs in a MIG can be either regional or global. For more information, see Set up an application health check and autohealing. For more information, seeHealth checks overview.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ HealthCheck

Returns a new instance of HealthCheck.



15866
15867
15868
# File 'lib/google/apis/compute_v1/classes.rb', line 15866

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

Instance Attribute Details

#check_interval_secFixnum

How often (in seconds) to send a health check. The default value is 5 seconds. Corresponds to the JSON property checkIntervalSec

Returns:

  • (Fixnum)


15731
15732
15733
# File 'lib/google/apis/compute_v1/classes.rb', line 15731

def check_interval_sec
  @check_interval_sec
end

#creation_timestampString

Output only. [Output Only] Creation timestamp in3339 text format. Corresponds to the JSON property creationTimestamp

Returns:

  • (String)


15737
15738
15739
# File 'lib/google/apis/compute_v1/classes.rb', line 15737

def creation_timestamp
  @creation_timestamp
end

#descriptionString

An optional description of this resource. Provide this property when you create the resource. Corresponds to the JSON property description

Returns:

  • (String)


15743
15744
15745
# File 'lib/google/apis/compute_v1/classes.rb', line 15743

def description
  @description
end

#grpc_health_checkGoogle::Apis::ComputeV1::GrpcHealthCheck

Corresponds to the JSON property grpcHealthCheck



15748
15749
15750
# File 'lib/google/apis/compute_v1/classes.rb', line 15748

def grpc_health_check
  @grpc_health_check
end

#grpc_tls_health_checkGoogle::Apis::ComputeV1::GrpctlsHealthCheck

Corresponds to the JSON property grpcTlsHealthCheck



15753
15754
15755
# File 'lib/google/apis/compute_v1/classes.rb', line 15753

def grpc_tls_health_check
  @grpc_tls_health_check
end

#healthy_thresholdFixnum

A so-far unhealthy instance will be marked healthy after this many consecutive successes. The default value is 2. Corresponds to the JSON property healthyThreshold

Returns:

  • (Fixnum)


15759
15760
15761
# File 'lib/google/apis/compute_v1/classes.rb', line 15759

def healthy_threshold
  @healthy_threshold
end

#http2_health_checkGoogle::Apis::ComputeV1::Http2HealthCheck

Corresponds to the JSON property http2HealthCheck



15764
15765
15766
# File 'lib/google/apis/compute_v1/classes.rb', line 15764

def http2_health_check
  @http2_health_check
end

#http_health_checkGoogle::Apis::ComputeV1::HttpHealthCheck

Corresponds to the JSON property httpHealthCheck



15769
15770
15771
# File 'lib/google/apis/compute_v1/classes.rb', line 15769

def http_health_check
  @http_health_check
end

#https_health_checkGoogle::Apis::ComputeV1::HttpsHealthCheck

Corresponds to the JSON property httpsHealthCheck



15774
15775
15776
# File 'lib/google/apis/compute_v1/classes.rb', line 15774

def https_health_check
  @https_health_check
end

#idFixnum

[Output Only] The unique identifier for the resource. This identifier is defined by the server. Corresponds to the JSON property id

Returns:

  • (Fixnum)


15780
15781
15782
# File 'lib/google/apis/compute_v1/classes.rb', line 15780

def id
  @id
end

#kindString

Output only. Type of the resource. Corresponds to the JSON property kind

Returns:

  • (String)


15785
15786
15787
# File 'lib/google/apis/compute_v1/classes.rb', line 15785

def kind
  @kind
end

#log_configGoogle::Apis::ComputeV1::HealthCheckLogConfig

Configuration of logging on a health check. If logging is enabled, logs will be exported to Stackdriver. Corresponds to the JSON property logConfig



15791
15792
15793
# File 'lib/google/apis/compute_v1/classes.rb', line 15791

def log_config
  @log_config
end

#nameString

Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply withRFC1035. For example, a name that is 1-63 characters long, matches the regular expression [a-z]([-a-z0-9]*[a-z0-9])?, and otherwise complies with RFC1035. This regular expression describes a name where the first character is a lowercase letter, and all following characters are a dash, lowercase letter, or digit, except the last character, which isn't a dash. Corresponds to the JSON property name

Returns:

  • (String)


15802
15803
15804
# File 'lib/google/apis/compute_v1/classes.rb', line 15802

def name
  @name
end

#regionString

Output only. [Output Only] Region where the health check resides. Not applicable to global health checks. Corresponds to the JSON property region

Returns:

  • (String)


15809
15810
15811
# File 'lib/google/apis/compute_v1/classes.rb', line 15809

def region
  @region
end

[Output Only] Server-defined URL for the resource. Corresponds to the JSON property selfLink

Returns:

  • (String)


15814
15815
15816
# File 'lib/google/apis/compute_v1/classes.rb', line 15814

def self_link
  @self_link
end

#source_regionsArray<String>

The list of cloud regions from which health checks are performed. If any regions are specified, then exactly 3 regions should be specified. The region names must be valid names of Google Cloud regions. This can only be set for global health check. If this list is non-empty, then there are restrictions on what other health check fields are supported and what other resources can use this health check:

  • SSL, HTTP2, and GRPC protocols are not supported.
  • The TCP request field is not supported.
  • The proxyHeader field for HTTP, HTTPS, and TCP is not supported.
  • The checkIntervalSec field must be at least 30.
  • The health check cannot be used with BackendService nor with managed instance group auto-healing. Corresponds to the JSON property sourceRegions

Returns:

  • (Array<String>)


15833
15834
15835
# File 'lib/google/apis/compute_v1/classes.rb', line 15833

def source_regions
  @source_regions
end

#ssl_health_checkGoogle::Apis::ComputeV1::SslHealthCheck

Corresponds to the JSON property sslHealthCheck



15838
15839
15840
# File 'lib/google/apis/compute_v1/classes.rb', line 15838

def ssl_health_check
  @ssl_health_check
end

#tcp_health_checkGoogle::Apis::ComputeV1::TcpHealthCheck

Corresponds to the JSON property tcpHealthCheck



15843
15844
15845
# File 'lib/google/apis/compute_v1/classes.rb', line 15843

def tcp_health_check
  @tcp_health_check
end

#timeout_secFixnum

How long (in seconds) to wait before claiming failure. The default value is 5 seconds. It is invalid for timeoutSec to have greater value than checkIntervalSec. Corresponds to the JSON property timeoutSec

Returns:

  • (Fixnum)


15850
15851
15852
# File 'lib/google/apis/compute_v1/classes.rb', line 15850

def timeout_sec
  @timeout_sec
end

#typeString

Specifies the type of the healthCheck, either TCP,SSL, HTTP, HTTPS,HTTP2 or GRPC. Exactly one of the protocol-specific health check fields must be specified, which must matchtype field. Corresponds to the JSON property type

Returns:

  • (String)


15858
15859
15860
# File 'lib/google/apis/compute_v1/classes.rb', line 15858

def type
  @type
end

#unhealthy_thresholdFixnum

A so-far healthy instance will be marked unhealthy after this many consecutive failures. The default value is 2. Corresponds to the JSON property unhealthyThreshold

Returns:

  • (Fixnum)


15864
15865
15866
# File 'lib/google/apis/compute_v1/classes.rb', line 15864

def unhealthy_threshold
  @unhealthy_threshold
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
# File 'lib/google/apis/compute_v1/classes.rb', line 15871

def update!(**args)
  @check_interval_sec = args[:check_interval_sec] if args.key?(:check_interval_sec)
  @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp)
  @description = args[:description] if args.key?(:description)
  @grpc_health_check = args[:grpc_health_check] if args.key?(:grpc_health_check)
  @grpc_tls_health_check = args[:grpc_tls_health_check] if args.key?(:grpc_tls_health_check)
  @healthy_threshold = args[:healthy_threshold] if args.key?(:healthy_threshold)
  @http2_health_check = args[:http2_health_check] if args.key?(:http2_health_check)
  @http_health_check = args[:http_health_check] if args.key?(:http_health_check)
  @https_health_check = args[:https_health_check] if args.key?(:https_health_check)
  @id = args[:id] if args.key?(:id)
  @kind = args[:kind] if args.key?(:kind)
  @log_config = args[:log_config] if args.key?(:log_config)
  @name = args[:name] if args.key?(:name)
  @region = args[:region] if args.key?(:region)
  @self_link = args[:self_link] if args.key?(:self_link)
  @source_regions = args[:source_regions] if args.key?(:source_regions)
  @ssl_health_check = args[:ssl_health_check] if args.key?(:ssl_health_check)
  @tcp_health_check = args[:tcp_health_check] if args.key?(:tcp_health_check)
  @timeout_sec = args[:timeout_sec] if args.key?(:timeout_sec)
  @type = args[:type] if args.key?(:type)
  @unhealthy_threshold = args[:unhealthy_threshold] if args.key?(:unhealthy_threshold)
end