Class: Google::Apis::ComputeV1::TargetPool

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 Target Pool resource. Target pools are used for network TCP/UDP load balancing. A target pool references member instances, an associated legacy HttpHealthCheck resource, and, optionally, a backup target pool. For more information, read Using target pools.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ TargetPool

Returns a new instance of TargetPool.



37578
37579
37580
# File 'lib/google/apis/compute_v1/classes.rb', line 37578

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

Instance Attribute Details

#backup_poolString

The server-defined URL for the resource. This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its failoverRatio field is properly set to a value between [0, 1]. backupPool and failoverRatio together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below failoverRatio, traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio and backupPool are not set, or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. Corresponds to the JSON property backupPool

Returns:

  • (String)


37496
37497
37498
# File 'lib/google/apis/compute_v1/classes.rb', line 37496

def backup_pool
  @backup_pool
end

#creation_timestampString

[Output Only] Creation timestamp in RFC3339 text format. Corresponds to the JSON property creationTimestamp

Returns:

  • (String)


37501
37502
37503
# File 'lib/google/apis/compute_v1/classes.rb', line 37501

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)


37507
37508
37509
# File 'lib/google/apis/compute_v1/classes.rb', line 37507

def description
  @description
end

#failover_ratioFloat

This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1]. If set, backupPool must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio is not set or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy. Corresponds to the JSON property failoverRatio

Returns:

  • (Float)


37522
37523
37524
# File 'lib/google/apis/compute_v1/classes.rb', line 37522

def failover_ratio
  @failover_ratio
end

#health_checksArray<String>

The URL of the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if the health checks pass. Only legacy HttpHealthChecks are supported. Only one health check may be specified. Corresponds to the JSON property healthChecks

Returns:

  • (Array<String>)


37529
37530
37531
# File 'lib/google/apis/compute_v1/classes.rb', line 37529

def health_checks
  @health_checks
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)


37535
37536
37537
# File 'lib/google/apis/compute_v1/classes.rb', line 37535

def id
  @id
end

#instancesArray<String>

A list of resource URLs to the virtual machine instances serving this pool. They must live in zones contained in the same region as this pool. Corresponds to the JSON property instances

Returns:

  • (Array<String>)


37541
37542
37543
# File 'lib/google/apis/compute_v1/classes.rb', line 37541

def instances
  @instances
end

#kindString

[Output Only] Type of the resource. Always compute#targetPool for target pools. Corresponds to the JSON property kind

Returns:

  • (String)


37546
37547
37548
# File 'lib/google/apis/compute_v1/classes.rb', line 37546

def kind
  @kind
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 with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a- z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. Corresponds to the JSON property name

Returns:

  • (String)


37556
37557
37558
# File 'lib/google/apis/compute_v1/classes.rb', line 37556

def name
  @name
end

#regionString

[Output Only] URL of the region where the target pool resides. Corresponds to the JSON property region

Returns:

  • (String)


37561
37562
37563
# File 'lib/google/apis/compute_v1/classes.rb', line 37561

def region
  @region
end

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

Returns:

  • (String)


37566
37567
37568
# File 'lib/google/apis/compute_v1/classes.rb', line 37566

def self_link
  @self_link
end

#session_affinityString

Session affinity option, must be one of the following values: NONE: Connections from the same client IP may go to any instance in the pool. CLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy. CLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains healthy. Corresponds to the JSON property sessionAffinity

Returns:

  • (String)


37576
37577
37578
# File 'lib/google/apis/compute_v1/classes.rb', line 37576

def session_affinity
  @session_affinity
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



37583
37584
37585
37586
37587
37588
37589
37590
37591
37592
37593
37594
37595
37596
# File 'lib/google/apis/compute_v1/classes.rb', line 37583

def update!(**args)
  @backup_pool = args[:backup_pool] if args.key?(:backup_pool)
  @creation_timestamp = args[:creation_timestamp] if args.key?(:creation_timestamp)
  @description = args[:description] if args.key?(:description)
  @failover_ratio = args[:failover_ratio] if args.key?(:failover_ratio)
  @health_checks = args[:health_checks] if args.key?(:health_checks)
  @id = args[:id] if args.key?(:id)
  @instances = args[:instances] if args.key?(:instances)
  @kind = args[:kind] if args.key?(:kind)
  @name = args[:name] if args.key?(:name)
  @region = args[:region] if args.key?(:region)
  @self_link = args[:self_link] if args.key?(:self_link)
  @session_affinity = args[:session_affinity] if args.key?(:session_affinity)
end