Class: Google::Apis::ComputeAlpha::WeightedBackendService

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

Overview

In contrast to a single BackendService in HttpRouteAction to which all matching traffic is directed to, WeightedBackendService allows traffic to be split across multiple BackendServices. The volume of traffic for each BackendService is proportional to the weight specified in each WeightedBackendService

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ WeightedBackendService

Returns a new instance of WeightedBackendService



32838
32839
32840
# File 'generated/google/apis/compute_alpha/classes.rb', line 32838

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

Instance Attribute Details

#backend_serviceString

The full or partial URL to the default BackendService resource. Before forwarding the request to backendService, the loadbalancer applies any relevant headerActions specified as part of this backendServiceWeight. Corresponds to the JSON property backendService

Returns:

  • (String)


32819
32820
32821
# File 'generated/google/apis/compute_alpha/classes.rb', line 32819

def backend_service
  @backend_service
end

#header_actionGoogle::Apis::ComputeAlpha::HttpHeaderAction

The request and response header transformations that take effect before the request is passed along to the selected backendService. Corresponds to the JSON property headerAction



32825
32826
32827
# File 'generated/google/apis/compute_alpha/classes.rb', line 32825

def header_action
  @header_action
end

#weightFixnum

Specifies the fraction of traffic sent to backendService. The sum of all weights specified in weightedBackendServices within HttpRouteAction must equal 100. The selection of a backend service is determined only for new traffic. Once a user's request has been directed to a backendService, subsequent requests will be sent to the same backendService as determined by the BackendService's session affinity policy. Corresponds to the JSON property weight

Returns:

  • (Fixnum)


32836
32837
32838
# File 'generated/google/apis/compute_alpha/classes.rb', line 32836

def weight
  @weight
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



32843
32844
32845
32846
32847
# File 'generated/google/apis/compute_alpha/classes.rb', line 32843

def update!(**args)
  @backend_service = args[:backend_service] if args.key?(:backend_service)
  @header_action = args[:header_action] if args.key?(:header_action)
  @weight = args[:weight] if args.key?(:weight)
end