Class: AWSCDK::AppMesh::WeightedTarget

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
app_mesh/weighted_target.rb

Overview

Properties for the Weighted Targets in the route.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(virtual_node:, port: nil, weight: nil) ⇒ WeightedTarget

Returns a new instance of WeightedTarget.

Parameters:

  • virtual_node (AWSCDK::AppMesh::IVirtualNode)

    The VirtualNode the route points to.

  • port (Numeric, nil) (defaults to: nil)

    The port to match from the request.

  • weight (Numeric, nil) (defaults to: nil)

    The weight for the target.



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

#portNumeric? (readonly)

Note:

Default: - do not match on port

The port to match from the request.

Returns:

  • (Numeric, nil)


27
28
29
# File 'app_mesh/weighted_target.rb', line 27

def port
  @port
end

#virtual_nodeAWSCDK::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

#weightNumeric? (readonly)

Note:

Default: 1

The weight for the target.

Returns:

  • (Numeric, nil)


32
33
34
# File 'app_mesh/weighted_target.rb', line 32

def weight
  @weight
end

Class Method Details

.jsii_propertiesObject



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_jsiiObject



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