Class: AWSCDK::AppMesh::GrpcRouteSpecOptions

Inherits:
RouteSpecOptionsBase
  • Object
show all
Defined in:
app_mesh/grpc_route_spec_options.rb

Overview

Properties specific for a GRPC Based Routes.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(priority: nil, match:, weighted_targets:, retry_policy: nil, timeout: nil) ⇒ GrpcRouteSpecOptions

Returns a new instance of GrpcRouteSpecOptions.

Parameters:



12
13
14
15
16
17
18
19
20
21
22
23
# File 'app_mesh/grpc_route_spec_options.rb', line 12

def initialize(priority: nil, match:, weighted_targets:, retry_policy: nil, timeout: nil)
  @priority = priority
  Jsii::Type.check_type(@priority, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "priority") unless @priority.nil?
  @match = match.is_a?(Hash) ? ::AWSCDK::AppMesh::GrpcRouteMatch.new(**match.transform_keys(&:to_sym)) : match
  Jsii::Type.check_type(@match, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbWVzaC5HcnBjUm91dGVNYXRjaCJ9")), "match")
  @weighted_targets = weighted_targets.is_a?(Array) ? weighted_targets.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::AppMesh::WeightedTarget.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : weighted_targets
  Jsii::Type.check_type(@weighted_targets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBtZXNoLldlaWdodGVkVGFyZ2V0In0sImtpbmQiOiJhcnJheSJ9fQ==")), "weightedTargets")
  @retry_policy = retry_policy.is_a?(Hash) ? ::AWSCDK::AppMesh::GrpcRetryPolicy.new(**retry_policy.transform_keys(&:to_sym)) : retry_policy
  Jsii::Type.check_type(@retry_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbWVzaC5HcnBjUmV0cnlQb2xpY3kifQ==")), "retryPolicy") unless @retry_policy.nil?
  @timeout = timeout.is_a?(Hash) ? ::AWSCDK::AppMesh::GrpcTimeout.new(**timeout.transform_keys(&:to_sym)) : timeout
  Jsii::Type.check_type(@timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbWVzaC5HcnBjVGltZW91dCJ9")), "timeout") unless @timeout.nil?
end

Instance Attribute Details

#matchAWSCDK::AppMesh::GrpcRouteMatch (readonly)

The criterion for determining a request match for this Route.



36
37
38
# File 'app_mesh/grpc_route_spec_options.rb', line 36

def match
  @match
end

#priorityNumeric? (readonly)

Note:

Default: - no particular priority

The priority for the route.

When a Virtual Router has multiple routes, route match is performed in the order of specified value, where 0 is the highest priority, and first matched route is selected.

Returns:

  • (Numeric, nil)


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

def priority
  @priority
end

#retry_policyAWSCDK::AppMesh::GrpcRetryPolicy? (readonly)

Note:

Default: - no retry policy

The retry policy.



45
46
47
# File 'app_mesh/grpc_route_spec_options.rb', line 45

def retry_policy
  @retry_policy
end

#timeoutAWSCDK::AppMesh::GrpcTimeout? (readonly)

Note:

Default: - None

An object that represents a grpc timeout.



50
51
52
# File 'app_mesh/grpc_route_spec_options.rb', line 50

def timeout
  @timeout
end

#weighted_targetsArray<AWSCDK::AppMesh::WeightedTarget> (readonly)

List of targets that traffic is routed to when a request matches the route.



40
41
42
# File 'app_mesh/grpc_route_spec_options.rb', line 40

def weighted_targets
  @weighted_targets
end

Class Method Details

.jsii_propertiesObject



52
53
54
55
56
57
58
59
60
# File 'app_mesh/grpc_route_spec_options.rb', line 52

def self.jsii_properties
  {
    :priority => "priority",
    :match => "match",
    :weighted_targets => "weightedTargets",
    :retry_policy => "retryPolicy",
    :timeout => "timeout",
  }
end

Instance Method Details

#to_jsiiObject



62
63
64
65
66
67
68
69
70
71
72
73
# File 'app_mesh/grpc_route_spec_options.rb', line 62

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "priority" => @priority,
    "match" => @match,
    "weightedTargets" => @weighted_targets,
    "retryPolicy" => @retry_policy,
    "timeout" => @timeout,
  })
  result.compact
end