Class: AWSCDK::AppMesh::HttpRouteSpecOptions

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

Overview

Properties specific for HTTP Based Routes.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of HttpRouteSpecOptions.

Parameters:



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

def initialize(priority: nil, weighted_targets:, match: nil, retry_policy: nil, timeout: nil)
  @priority = priority
  Jsii::Type.check_type(@priority, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "priority") unless @priority.nil?
  @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")
  @match = match.is_a?(Hash) ? ::AWSCDK::AppMesh::HttpRouteMatch.new(**match.transform_keys(&:to_sym)) : match
  Jsii::Type.check_type(@match, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbWVzaC5IdHRwUm91dGVNYXRjaCJ9")), "match") unless @match.nil?
  @retry_policy = retry_policy.is_a?(Hash) ? ::AWSCDK::AppMesh::HttpRetryPolicy.new(**retry_policy.transform_keys(&:to_sym)) : retry_policy
  Jsii::Type.check_type(@retry_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbWVzaC5IdHRwUmV0cnlQb2xpY3kifQ==")), "retryPolicy") unless @retry_policy.nil?
  @timeout = timeout.is_a?(Hash) ? ::AWSCDK::AppMesh::HttpTimeout.new(**timeout.transform_keys(&:to_sym)) : timeout
  Jsii::Type.check_type(@timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwbWVzaC5IdHRwVGltZW91dCJ9")), "timeout") unless @timeout.nil?
end

Instance Attribute Details

#matchAWSCDK::AppMesh::HttpRouteMatch? (readonly)

Note:

Default: - matches on '/'

The criterion for determining a request match for this Route.



41
42
43
# File 'app_mesh/http_route_spec_options.rb', line 41

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/http_route_spec_options.rb', line 32

def priority
  @priority
end

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

Note:

Default: - no retry policy

The retry policy.



46
47
48
# File 'app_mesh/http_route_spec_options.rb', line 46

def retry_policy
  @retry_policy
end

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

Note:

Default: - None

An object that represents a http timeout.



51
52
53
# File 'app_mesh/http_route_spec_options.rb', line 51

def timeout
  @timeout
end

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

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



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

def weighted_targets
  @weighted_targets
end

Class Method Details

.jsii_propertiesObject



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

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

Instance Method Details

#to_jsiiObject



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

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