Class: Google::Apis::NetworkservicesV1::GrpcRouteDestination

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

Overview

The destination to which traffic will be routed.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GrpcRouteDestination

Returns a new instance of GrpcRouteDestination.



878
879
880
# File 'lib/google/apis/networkservices_v1/classes.rb', line 878

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

Instance Attribute Details

#service_nameString

Required. The URL of a destination service to which to route traffic. Must refer to either a BackendService or ServiceDirectoryService. Corresponds to the JSON property serviceName

Returns:

  • (String)


863
864
865
# File 'lib/google/apis/networkservices_v1/classes.rb', line 863

def service_name
  @service_name
end

#weightFixnum

Optional. Specifies the proportion of requests forwarded to the backend referenced by the serviceName field. This is computed as: - weight/Sum(weights in this destination list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports. If only one serviceName is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend. If weights are specified for any one service name, they need to be specified for all of them. If weights are unspecified for all services, then, traffic is distributed in equal proportions to all of them. Corresponds to the JSON property weight

Returns:

  • (Fixnum)


876
877
878
# File 'lib/google/apis/networkservices_v1/classes.rb', line 876

def weight
  @weight
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



883
884
885
886
# File 'lib/google/apis/networkservices_v1/classes.rb', line 883

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