create_route
(**kwargs)¶Creates a route that is associated with a virtual router.
You can route several different protocols and define a retry policy for a route. Traffic can be routed to one or more virtual nodes.
For more information about routes, see Routes.
See also: AWS API Documentation
Request Syntax
response = client.create_route(
clientToken='string',
meshName='string',
meshOwner='string',
routeName='string',
spec={
'grpcRoute': {
'action': {
'weightedTargets': [
{
'port': 123,
'virtualNode': 'string',
'weight': 123
},
]
},
'match': {
'metadata': [
{
'invert': True|False,
'match': {
'exact': 'string',
'prefix': 'string',
'range': {
'end': 123,
'start': 123
},
'regex': 'string',
'suffix': 'string'
},
'name': 'string'
},
],
'methodName': 'string',
'port': 123,
'serviceName': 'string'
},
'retryPolicy': {
'grpcRetryEvents': [
'cancelled'|'deadline-exceeded'|'internal'|'resource-exhausted'|'unavailable',
],
'httpRetryEvents': [
'string',
],
'maxRetries': 123,
'perRetryTimeout': {
'unit': 's'|'ms',
'value': 123
},
'tcpRetryEvents': [
'connection-error',
]
},
'timeout': {
'idle': {
'unit': 's'|'ms',
'value': 123
},
'perRequest': {
'unit': 's'|'ms',
'value': 123
}
}
},
'http2Route': {
'action': {
'weightedTargets': [
{
'port': 123,
'virtualNode': 'string',
'weight': 123
},
]
},
'match': {
'headers': [
{
'invert': True|False,
'match': {
'exact': 'string',
'prefix': 'string',
'range': {
'end': 123,
'start': 123
},
'regex': 'string',
'suffix': 'string'
},
'name': 'string'
},
],
'method': 'GET'|'HEAD'|'POST'|'PUT'|'DELETE'|'CONNECT'|'OPTIONS'|'TRACE'|'PATCH',
'path': {
'exact': 'string',
'regex': 'string'
},
'port': 123,
'prefix': 'string',
'queryParameters': [
{
'match': {
'exact': 'string'
},
'name': 'string'
},
],
'scheme': 'http'|'https'
},
'retryPolicy': {
'httpRetryEvents': [
'string',
],
'maxRetries': 123,
'perRetryTimeout': {
'unit': 's'|'ms',
'value': 123
},
'tcpRetryEvents': [
'connection-error',
]
},
'timeout': {
'idle': {
'unit': 's'|'ms',
'value': 123
},
'perRequest': {
'unit': 's'|'ms',
'value': 123
}
}
},
'httpRoute': {
'action': {
'weightedTargets': [
{
'port': 123,
'virtualNode': 'string',
'weight': 123
},
]
},
'match': {
'headers': [
{
'invert': True|False,
'match': {
'exact': 'string',
'prefix': 'string',
'range': {
'end': 123,
'start': 123
},
'regex': 'string',
'suffix': 'string'
},
'name': 'string'
},
],
'method': 'GET'|'HEAD'|'POST'|'PUT'|'DELETE'|'CONNECT'|'OPTIONS'|'TRACE'|'PATCH',
'path': {
'exact': 'string',
'regex': 'string'
},
'port': 123,
'prefix': 'string',
'queryParameters': [
{
'match': {
'exact': 'string'
},
'name': 'string'
},
],
'scheme': 'http'|'https'
},
'retryPolicy': {
'httpRetryEvents': [
'string',
],
'maxRetries': 123,
'perRetryTimeout': {
'unit': 's'|'ms',
'value': 123
},
'tcpRetryEvents': [
'connection-error',
]
},
'timeout': {
'idle': {
'unit': 's'|'ms',
'value': 123
},
'perRequest': {
'unit': 's'|'ms',
'value': 123
}
}
},
'priority': 123,
'tcpRoute': {
'action': {
'weightedTargets': [
{
'port': 123,
'virtualNode': 'string',
'weight': 123
},
]
},
'match': {
'port': 123
},
'timeout': {
'idle': {
'unit': 's'|'ms',
'value': 123
}
}
}
},
tags=[
{
'key': 'string',
'value': 'string'
},
],
virtualRouterName='string'
)
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.
This field is autopopulated if not provided.
[REQUIRED]
The name of the service mesh to create the route in.
[REQUIRED]
The name to use for the route.
[REQUIRED]
The route specification to apply.
An object that represents the specification of a gRPC route.
An object that represents the action to take if a match is determined.
An object that represents the targets that traffic is routed to when a request matches the route.
An object that represents a target and its relative weight. Traffic is distributed across targets according to their relative weight. For example, a weighted target with a relative weight of 50 receives five times as much traffic as one with a relative weight of 10. The total weight for all targets combined must be less than or equal to 100.
The targeted port of the weighted object.
The virtual node to associate with the weighted target.
The relative weight of the weighted target.
An object that represents the criteria for determining a request match.
An object that represents the data to match from the request.
An object that represents the match metadata for the route.
Specify True
to match anything except the match criteria. The default value is False
.
An object that represents the data to match from the request.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set: exact
, prefix
, range
, regex
, suffix
.
The value sent by the client must match the specified value exactly.
The value sent by the client must begin with the specified characters.
An object that represents the range of values to match on.
The end of the range.
The start of the range.
The value sent by the client must include the specified characters.
The value sent by the client must end with the specified characters.
The name of the route.
The method name to match from the request. If you specify a name, you must also specify a serviceName
.
The port number to match on.
The fully qualified domain name for the service to match from the request.
An object that represents a retry policy.
Specify at least one of the valid values.
Specify at least one of the following values.
The maximum number of retry attempts.
The timeout for each retry attempt.
A unit of time.
A number of time units.
Specify a valid value. The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.
An object that represents types of timeouts.
An object that represents an idle timeout. An idle timeout bounds the amount of time that a connection may be idle. The default value is none.
A unit of time.
A number of time units.
An object that represents a per request timeout. The default value is 15 seconds. If you set a higher timeout, then make sure that the higher value is set for each App Mesh resource in a conversation. For example, if a virtual node backend uses a virtual router provider to route to another virtual node, then the timeout should be greater than 15 seconds for the source and destination virtual node and the route.
A unit of time.
A number of time units.
An object that represents the specification of an HTTP/2 route.
An object that represents the action to take if a match is determined.
An object that represents the targets that traffic is routed to when a request matches the route.
An object that represents a target and its relative weight. Traffic is distributed across targets according to their relative weight. For example, a weighted target with a relative weight of 50 receives five times as much traffic as one with a relative weight of 10. The total weight for all targets combined must be less than or equal to 100.
The targeted port of the weighted object.
The virtual node to associate with the weighted target.
The relative weight of the weighted target.
An object that represents the criteria for determining a request match.
The client request headers to match on.
An object that represents the HTTP header in the request.
Specify True
to match anything except the match criteria. The default value is False
.
The HeaderMatchMethod
object.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set: exact
, prefix
, range
, regex
, suffix
.
The value sent by the client must match the specified value exactly.
The value sent by the client must begin with the specified characters.
An object that represents the range of values to match on.
The end of the range.
The start of the range.
The value sent by the client must include the specified characters.
The value sent by the client must end with the specified characters.
A name for the HTTP header in the client request that will be matched on.
The client request method to match on. Specify only one.
The client request path to match on.
The exact path to match on.
The regex used to match the path.
The port number to match on.
Specifies the path to match requests with. This parameter must always start with /
, which by itself matches all requests to the virtual service name. You can also match for path-based routing of requests. For example, if your virtual service name is my-service.local
and you want the route to match requests to my-service.local/metrics
, your prefix should be /metrics
.
The client request query parameters to match on.
An object that represents the query parameter in the request.
The query parameter to match on.
The exact query parameter to match on.
A name for the query parameter that will be matched on.
The client request scheme to match on. Specify only one. Applicable only for HTTP2 routes.
An object that represents a retry policy.
Specify at least one of the following values.
The maximum number of retry attempts.
The timeout for each retry attempt.
A unit of time.
A number of time units.
Specify a valid value. The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.
An object that represents types of timeouts.
An object that represents an idle timeout. An idle timeout bounds the amount of time that a connection may be idle. The default value is none.
A unit of time.
A number of time units.
An object that represents a per request timeout. The default value is 15 seconds. If you set a higher timeout, then make sure that the higher value is set for each App Mesh resource in a conversation. For example, if a virtual node backend uses a virtual router provider to route to another virtual node, then the timeout should be greater than 15 seconds for the source and destination virtual node and the route.
A unit of time.
A number of time units.
An object that represents the specification of an HTTP route.
An object that represents the action to take if a match is determined.
An object that represents the targets that traffic is routed to when a request matches the route.
An object that represents a target and its relative weight. Traffic is distributed across targets according to their relative weight. For example, a weighted target with a relative weight of 50 receives five times as much traffic as one with a relative weight of 10. The total weight for all targets combined must be less than or equal to 100.
The targeted port of the weighted object.
The virtual node to associate with the weighted target.
The relative weight of the weighted target.
An object that represents the criteria for determining a request match.
The client request headers to match on.
An object that represents the HTTP header in the request.
Specify True
to match anything except the match criteria. The default value is False
.
The HeaderMatchMethod
object.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set: exact
, prefix
, range
, regex
, suffix
.
The value sent by the client must match the specified value exactly.
The value sent by the client must begin with the specified characters.
An object that represents the range of values to match on.
The end of the range.
The start of the range.
The value sent by the client must include the specified characters.
The value sent by the client must end with the specified characters.
A name for the HTTP header in the client request that will be matched on.
The client request method to match on. Specify only one.
The client request path to match on.
The exact path to match on.
The regex used to match the path.
The port number to match on.
Specifies the path to match requests with. This parameter must always start with /
, which by itself matches all requests to the virtual service name. You can also match for path-based routing of requests. For example, if your virtual service name is my-service.local
and you want the route to match requests to my-service.local/metrics
, your prefix should be /metrics
.
The client request query parameters to match on.
An object that represents the query parameter in the request.
The query parameter to match on.
The exact query parameter to match on.
A name for the query parameter that will be matched on.
The client request scheme to match on. Specify only one. Applicable only for HTTP2 routes.
An object that represents a retry policy.
Specify at least one of the following values.
The maximum number of retry attempts.
The timeout for each retry attempt.
A unit of time.
A number of time units.
Specify a valid value. The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.
An object that represents types of timeouts.
An object that represents an idle timeout. An idle timeout bounds the amount of time that a connection may be idle. The default value is none.
A unit of time.
A number of time units.
An object that represents a per request timeout. The default value is 15 seconds. If you set a higher timeout, then make sure that the higher value is set for each App Mesh resource in a conversation. For example, if a virtual node backend uses a virtual router provider to route to another virtual node, then the timeout should be greater than 15 seconds for the source and destination virtual node and the route.
A unit of time.
A number of time units.
The priority for the route. Routes are matched based on the specified value, where 0 is the highest priority.
An object that represents the specification of a TCP route.
The action to take if a match is determined.
An object that represents the targets that traffic is routed to when a request matches the route.
An object that represents a target and its relative weight. Traffic is distributed across targets according to their relative weight. For example, a weighted target with a relative weight of 50 receives five times as much traffic as one with a relative weight of 10. The total weight for all targets combined must be less than or equal to 100.
The targeted port of the weighted object.
The virtual node to associate with the weighted target.
The relative weight of the weighted target.
An object that represents the criteria for determining a request match.
The port number to match on.
An object that represents types of timeouts.
An object that represents an idle timeout. An idle timeout bounds the amount of time that a connection may be idle. The default value is none.
A unit of time.
A number of time units.
Optional metadata that you can apply to the route to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
Optional metadata that you apply to a resource to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.
One part of a key-value pair that make up a tag. A key
is a general label that acts like a category for more specific tag values.
The optional part of a key-value pair that make up a tag. A value
acts as a descriptor within a tag category (key).
[REQUIRED]
The name of the virtual router in which to create the route. If the virtual router is in a shared mesh, then you must be the owner of the virtual router resource.
dict
Response Syntax
{
'route': {
'meshName': 'string',
'metadata': {
'arn': 'string',
'createdAt': datetime(2015, 1, 1),
'lastUpdatedAt': datetime(2015, 1, 1),
'meshOwner': 'string',
'resourceOwner': 'string',
'uid': 'string',
'version': 123
},
'routeName': 'string',
'spec': {
'grpcRoute': {
'action': {
'weightedTargets': [
{
'port': 123,
'virtualNode': 'string',
'weight': 123
},
]
},
'match': {
'metadata': [
{
'invert': True|False,
'match': {
'exact': 'string',
'prefix': 'string',
'range': {
'end': 123,
'start': 123
},
'regex': 'string',
'suffix': 'string'
},
'name': 'string'
},
],
'methodName': 'string',
'port': 123,
'serviceName': 'string'
},
'retryPolicy': {
'grpcRetryEvents': [
'cancelled'|'deadline-exceeded'|'internal'|'resource-exhausted'|'unavailable',
],
'httpRetryEvents': [
'string',
],
'maxRetries': 123,
'perRetryTimeout': {
'unit': 's'|'ms',
'value': 123
},
'tcpRetryEvents': [
'connection-error',
]
},
'timeout': {
'idle': {
'unit': 's'|'ms',
'value': 123
},
'perRequest': {
'unit': 's'|'ms',
'value': 123
}
}
},
'http2Route': {
'action': {
'weightedTargets': [
{
'port': 123,
'virtualNode': 'string',
'weight': 123
},
]
},
'match': {
'headers': [
{
'invert': True|False,
'match': {
'exact': 'string',
'prefix': 'string',
'range': {
'end': 123,
'start': 123
},
'regex': 'string',
'suffix': 'string'
},
'name': 'string'
},
],
'method': 'GET'|'HEAD'|'POST'|'PUT'|'DELETE'|'CONNECT'|'OPTIONS'|'TRACE'|'PATCH',
'path': {
'exact': 'string',
'regex': 'string'
},
'port': 123,
'prefix': 'string',
'queryParameters': [
{
'match': {
'exact': 'string'
},
'name': 'string'
},
],
'scheme': 'http'|'https'
},
'retryPolicy': {
'httpRetryEvents': [
'string',
],
'maxRetries': 123,
'perRetryTimeout': {
'unit': 's'|'ms',
'value': 123
},
'tcpRetryEvents': [
'connection-error',
]
},
'timeout': {
'idle': {
'unit': 's'|'ms',
'value': 123
},
'perRequest': {
'unit': 's'|'ms',
'value': 123
}
}
},
'httpRoute': {
'action': {
'weightedTargets': [
{
'port': 123,
'virtualNode': 'string',
'weight': 123
},
]
},
'match': {
'headers': [
{
'invert': True|False,
'match': {
'exact': 'string',
'prefix': 'string',
'range': {
'end': 123,
'start': 123
},
'regex': 'string',
'suffix': 'string'
},
'name': 'string'
},
],
'method': 'GET'|'HEAD'|'POST'|'PUT'|'DELETE'|'CONNECT'|'OPTIONS'|'TRACE'|'PATCH',
'path': {
'exact': 'string',
'regex': 'string'
},
'port': 123,
'prefix': 'string',
'queryParameters': [
{
'match': {
'exact': 'string'
},
'name': 'string'
},
],
'scheme': 'http'|'https'
},
'retryPolicy': {
'httpRetryEvents': [
'string',
],
'maxRetries': 123,
'perRetryTimeout': {
'unit': 's'|'ms',
'value': 123
},
'tcpRetryEvents': [
'connection-error',
]
},
'timeout': {
'idle': {
'unit': 's'|'ms',
'value': 123
},
'perRequest': {
'unit': 's'|'ms',
'value': 123
}
}
},
'priority': 123,
'tcpRoute': {
'action': {
'weightedTargets': [
{
'port': 123,
'virtualNode': 'string',
'weight': 123
},
]
},
'match': {
'port': 123
},
'timeout': {
'idle': {
'unit': 's'|'ms',
'value': 123
}
}
}
},
'status': {
'status': 'ACTIVE'|'INACTIVE'|'DELETED'
},
'virtualRouterName': 'string'
}
}
Response Structure
(dict) --
route (dict) --
The full description of your mesh following the create call.
meshName (string) --
The name of the service mesh that the route resides in.
metadata (dict) --
The associated metadata for the route.
arn (string) --
The full Amazon Resource Name (ARN) for the resource.
createdAt (datetime) --
The Unix epoch timestamp in seconds for when the resource was created.
lastUpdatedAt (datetime) --
The Unix epoch timestamp in seconds for when the resource was last updated.
meshOwner (string) --
The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it's the ID of the account that shared the mesh with your account. For more information about mesh sharing, see Working with shared meshes.
resourceOwner (string) --
The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it's the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see Working with shared meshes.
uid (string) --
The unique identifier for the resource.
version (integer) --
The version of the resource. Resources are created at version 1, and this version is incremented each time that they're updated.
routeName (string) --
The name of the route.
spec (dict) --
The specifications of the route.
grpcRoute (dict) --
An object that represents the specification of a gRPC route.
action (dict) --
An object that represents the action to take if a match is determined.
weightedTargets (list) --
An object that represents the targets that traffic is routed to when a request matches the route.
(dict) --
An object that represents a target and its relative weight. Traffic is distributed across targets according to their relative weight. For example, a weighted target with a relative weight of 50 receives five times as much traffic as one with a relative weight of 10. The total weight for all targets combined must be less than or equal to 100.
port (integer) --
The targeted port of the weighted object.
virtualNode (string) --
The virtual node to associate with the weighted target.
weight (integer) --
The relative weight of the weighted target.
match (dict) --
An object that represents the criteria for determining a request match.
metadata (list) --
An object that represents the data to match from the request.
(dict) --
An object that represents the match metadata for the route.
invert (boolean) --
Specify True
to match anything except the match criteria. The default value is False
.
match (dict) --
An object that represents the data to match from the request.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: exact
, prefix
, range
, regex
, suffix
. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER
as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER
is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
exact (string) --
The value sent by the client must match the specified value exactly.
prefix (string) --
The value sent by the client must begin with the specified characters.
range (dict) --
An object that represents the range of values to match on.
end (integer) --
The end of the range.
start (integer) --
The start of the range.
regex (string) --
The value sent by the client must include the specified characters.
suffix (string) --
The value sent by the client must end with the specified characters.
name (string) --
The name of the route.
methodName (string) --
The method name to match from the request. If you specify a name, you must also specify a serviceName
.
port (integer) --
The port number to match on.
serviceName (string) --
The fully qualified domain name for the service to match from the request.
retryPolicy (dict) --
An object that represents a retry policy.
grpcRetryEvents (list) --
Specify at least one of the valid values.
httpRetryEvents (list) --
Specify at least one of the following values.
maxRetries (integer) --
The maximum number of retry attempts.
perRetryTimeout (dict) --
The timeout for each retry attempt.
unit (string) --
A unit of time.
value (integer) --
A number of time units.
tcpRetryEvents (list) --
Specify a valid value. The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.
timeout (dict) --
An object that represents types of timeouts.
idle (dict) --
An object that represents an idle timeout. An idle timeout bounds the amount of time that a connection may be idle. The default value is none.
unit (string) --
A unit of time.
value (integer) --
A number of time units.
perRequest (dict) --
An object that represents a per request timeout. The default value is 15 seconds. If you set a higher timeout, then make sure that the higher value is set for each App Mesh resource in a conversation. For example, if a virtual node backend uses a virtual router provider to route to another virtual node, then the timeout should be greater than 15 seconds for the source and destination virtual node and the route.
unit (string) --
A unit of time.
value (integer) --
A number of time units.
http2Route (dict) --
An object that represents the specification of an HTTP/2 route.
action (dict) --
An object that represents the action to take if a match is determined.
weightedTargets (list) --
An object that represents the targets that traffic is routed to when a request matches the route.
(dict) --
An object that represents a target and its relative weight. Traffic is distributed across targets according to their relative weight. For example, a weighted target with a relative weight of 50 receives five times as much traffic as one with a relative weight of 10. The total weight for all targets combined must be less than or equal to 100.
port (integer) --
The targeted port of the weighted object.
virtualNode (string) --
The virtual node to associate with the weighted target.
weight (integer) --
The relative weight of the weighted target.
match (dict) --
An object that represents the criteria for determining a request match.
headers (list) --
The client request headers to match on.
(dict) --
An object that represents the HTTP header in the request.
invert (boolean) --
Specify True
to match anything except the match criteria. The default value is False
.
match (dict) --
The HeaderMatchMethod
object.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: exact
, prefix
, range
, regex
, suffix
. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER
as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER
is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
exact (string) --
The value sent by the client must match the specified value exactly.
prefix (string) --
The value sent by the client must begin with the specified characters.
range (dict) --
An object that represents the range of values to match on.
end (integer) --
The end of the range.
start (integer) --
The start of the range.
regex (string) --
The value sent by the client must include the specified characters.
suffix (string) --
The value sent by the client must end with the specified characters.
name (string) --
A name for the HTTP header in the client request that will be matched on.
method (string) --
The client request method to match on. Specify only one.
path (dict) --
The client request path to match on.
exact (string) --
The exact path to match on.
regex (string) --
The regex used to match the path.
port (integer) --
The port number to match on.
prefix (string) --
Specifies the path to match requests with. This parameter must always start with /
, which by itself matches all requests to the virtual service name. You can also match for path-based routing of requests. For example, if your virtual service name is my-service.local
and you want the route to match requests to my-service.local/metrics
, your prefix should be /metrics
.
queryParameters (list) --
The client request query parameters to match on.
(dict) --
An object that represents the query parameter in the request.
match (dict) --
The query parameter to match on.
exact (string) --
The exact query parameter to match on.
name (string) --
A name for the query parameter that will be matched on.
scheme (string) --
The client request scheme to match on. Specify only one. Applicable only for HTTP2 routes.
retryPolicy (dict) --
An object that represents a retry policy.
httpRetryEvents (list) --
Specify at least one of the following values.
maxRetries (integer) --
The maximum number of retry attempts.
perRetryTimeout (dict) --
The timeout for each retry attempt.
unit (string) --
A unit of time.
value (integer) --
A number of time units.
tcpRetryEvents (list) --
Specify a valid value. The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.
timeout (dict) --
An object that represents types of timeouts.
idle (dict) --
An object that represents an idle timeout. An idle timeout bounds the amount of time that a connection may be idle. The default value is none.
unit (string) --
A unit of time.
value (integer) --
A number of time units.
perRequest (dict) --
An object that represents a per request timeout. The default value is 15 seconds. If you set a higher timeout, then make sure that the higher value is set for each App Mesh resource in a conversation. For example, if a virtual node backend uses a virtual router provider to route to another virtual node, then the timeout should be greater than 15 seconds for the source and destination virtual node and the route.
unit (string) --
A unit of time.
value (integer) --
A number of time units.
httpRoute (dict) --
An object that represents the specification of an HTTP route.
action (dict) --
An object that represents the action to take if a match is determined.
weightedTargets (list) --
An object that represents the targets that traffic is routed to when a request matches the route.
(dict) --
An object that represents a target and its relative weight. Traffic is distributed across targets according to their relative weight. For example, a weighted target with a relative weight of 50 receives five times as much traffic as one with a relative weight of 10. The total weight for all targets combined must be less than or equal to 100.
port (integer) --
The targeted port of the weighted object.
virtualNode (string) --
The virtual node to associate with the weighted target.
weight (integer) --
The relative weight of the weighted target.
match (dict) --
An object that represents the criteria for determining a request match.
headers (list) --
The client request headers to match on.
(dict) --
An object that represents the HTTP header in the request.
invert (boolean) --
Specify True
to match anything except the match criteria. The default value is False
.
match (dict) --
The HeaderMatchMethod
object.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: exact
, prefix
, range
, regex
, suffix
. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER
as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER
is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
exact (string) --
The value sent by the client must match the specified value exactly.
prefix (string) --
The value sent by the client must begin with the specified characters.
range (dict) --
An object that represents the range of values to match on.
end (integer) --
The end of the range.
start (integer) --
The start of the range.
regex (string) --
The value sent by the client must include the specified characters.
suffix (string) --
The value sent by the client must end with the specified characters.
name (string) --
A name for the HTTP header in the client request that will be matched on.
method (string) --
The client request method to match on. Specify only one.
path (dict) --
The client request path to match on.
exact (string) --
The exact path to match on.
regex (string) --
The regex used to match the path.
port (integer) --
The port number to match on.
prefix (string) --
Specifies the path to match requests with. This parameter must always start with /
, which by itself matches all requests to the virtual service name. You can also match for path-based routing of requests. For example, if your virtual service name is my-service.local
and you want the route to match requests to my-service.local/metrics
, your prefix should be /metrics
.
queryParameters (list) --
The client request query parameters to match on.
(dict) --
An object that represents the query parameter in the request.
match (dict) --
The query parameter to match on.
exact (string) --
The exact query parameter to match on.
name (string) --
A name for the query parameter that will be matched on.
scheme (string) --
The client request scheme to match on. Specify only one. Applicable only for HTTP2 routes.
retryPolicy (dict) --
An object that represents a retry policy.
httpRetryEvents (list) --
Specify at least one of the following values.
maxRetries (integer) --
The maximum number of retry attempts.
perRetryTimeout (dict) --
The timeout for each retry attempt.
unit (string) --
A unit of time.
value (integer) --
A number of time units.
tcpRetryEvents (list) --
Specify a valid value. The event occurs before any processing of a request has started and is encountered when the upstream is temporarily or permanently unavailable.
timeout (dict) --
An object that represents types of timeouts.
idle (dict) --
An object that represents an idle timeout. An idle timeout bounds the amount of time that a connection may be idle. The default value is none.
unit (string) --
A unit of time.
value (integer) --
A number of time units.
perRequest (dict) --
An object that represents a per request timeout. The default value is 15 seconds. If you set a higher timeout, then make sure that the higher value is set for each App Mesh resource in a conversation. For example, if a virtual node backend uses a virtual router provider to route to another virtual node, then the timeout should be greater than 15 seconds for the source and destination virtual node and the route.
unit (string) --
A unit of time.
value (integer) --
A number of time units.
priority (integer) --
The priority for the route. Routes are matched based on the specified value, where 0 is the highest priority.
tcpRoute (dict) --
An object that represents the specification of a TCP route.
action (dict) --
The action to take if a match is determined.
weightedTargets (list) --
An object that represents the targets that traffic is routed to when a request matches the route.
(dict) --
An object that represents a target and its relative weight. Traffic is distributed across targets according to their relative weight. For example, a weighted target with a relative weight of 50 receives five times as much traffic as one with a relative weight of 10. The total weight for all targets combined must be less than or equal to 100.
port (integer) --
The targeted port of the weighted object.
virtualNode (string) --
The virtual node to associate with the weighted target.
weight (integer) --
The relative weight of the weighted target.
match (dict) --
An object that represents the criteria for determining a request match.
port (integer) --
The port number to match on.
timeout (dict) --
An object that represents types of timeouts.
idle (dict) --
An object that represents an idle timeout. An idle timeout bounds the amount of time that a connection may be idle. The default value is none.
unit (string) --
A unit of time.
value (integer) --
A number of time units.
status (dict) --
The status of the route.
status (string) --
The current status for the route.
virtualRouterName (string) --
The virtual router that the route is associated with.
Exceptions
AppMesh.Client.exceptions.NotFoundException
AppMesh.Client.exceptions.BadRequestException
AppMesh.Client.exceptions.ConflictException
AppMesh.Client.exceptions.TooManyRequestsException
AppMesh.Client.exceptions.ForbiddenException
AppMesh.Client.exceptions.ServiceUnavailableException
AppMesh.Client.exceptions.InternalServerErrorException
AppMesh.Client.exceptions.LimitExceededException