Class: AWSCDK::AppMesh::WeightedTarget
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::AppMesh::WeightedTarget
- Defined in:
- app_mesh/weighted_target.rb
Overview
Properties for the Weighted Targets in the route.
Instance Attribute Summary collapse
-
#port ⇒ Numeric?
readonly
The port to match from the request.
-
#virtual_node ⇒ AWSCDK::AppMesh::IVirtualNode
readonly
The VirtualNode the route points to.
-
#weight ⇒ Numeric?
readonly
The weight for the target.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(virtual_node:, port: nil, weight: nil) ⇒ WeightedTarget
constructor
A new instance of WeightedTarget.
- #to_jsii ⇒ Object
Constructor Details
#initialize(virtual_node:, port: nil, weight: nil) ⇒ WeightedTarget
Returns a new instance of WeightedTarget.
10 11 12 13 14 15 16 17 |
# File 'app_mesh/weighted_target.rb', line 10 def initialize(virtual_node:, port: nil, weight: nil) @virtual_node = virtual_node Jsii::Type.check_type(@virtual_node, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbWVzaC5JVmlydHVhbE5vZGUifQ==")), "virtualNode") @port = port Jsii::Type.check_type(@port, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "port") unless @port.nil? @weight = weight Jsii::Type.check_type(@weight, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "weight") unless @weight.nil? end |
Instance Attribute Details
#port ⇒ Numeric? (readonly)
Note:
Default: - do not match on port
The port to match from the request.
27 28 29 |
# File 'app_mesh/weighted_target.rb', line 27 def port @port end |
#virtual_node ⇒ AWSCDK::AppMesh::IVirtualNode (readonly)
The VirtualNode the route points to.
22 23 24 |
# File 'app_mesh/weighted_target.rb', line 22 def virtual_node @virtual_node end |
#weight ⇒ Numeric? (readonly)
Note:
Default: 1
The weight for the target.
32 33 34 |
# File 'app_mesh/weighted_target.rb', line 32 def weight @weight end |
Class Method Details
.jsii_properties ⇒ Object
34 35 36 37 38 39 40 |
# File 'app_mesh/weighted_target.rb', line 34 def self.jsii_properties { :virtual_node => "virtualNode", :port => "port", :weight => "weight", } end |
Instance Method Details
#to_jsii ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'app_mesh/weighted_target.rb', line 42 def to_jsii result = {} result.merge!({ "virtualNode" => @virtual_node, "port" => @port, "weight" => @weight, }) result.compact end |