2019/09/09 - AWS App Mesh - 4 updated api methods
Changes Update appmesh client to latest version
{'spec': {'httpRoute': {'retryPolicy': {'httpRetryEvents': ['string'],
                                        'maxRetries': 'long',
                                        'perRetryTimeout': {'unit': 'ms | s',
                                                            'value': 'long'},
                                        'tcpRetryEvents': ['connection-error']}}}}
        Response {'route': {'spec': {'httpRoute': {'retryPolicy': {'httpRetryEvents': ['string'],
                                                  'maxRetries': 'long',
                                                  'perRetryTimeout': {'unit': 'ms '
                                                                              '| '
                                                                              's',
                                                                      'value': 'long'},
                                                  'tcpRetryEvents': ['connection-error']}}}}}
      Creates a route that is associated with a virtual router.
my-service.local and you want the route to match requests to my-service.local/metrics, your prefix should be
/metrics.
If your route matches a request, you can distribute traffic to one or more target virtual nodes with relative weighting.
See also: AWS API Documentation
Request Syntax
client.create_route(
    clientToken='string',
    meshName='string',
    routeName='string',
    spec={
        'httpRoute': {
            'action': {
                'weightedTargets': [
                    {
                        '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': 'CONNECT'|'DELETE'|'GET'|'HEAD'|'OPTIONS'|'PATCH'|'POST'|'PUT'|'TRACE',
                'prefix': 'string',
                'scheme': 'http'|'https'
            },
            'retryPolicy': {
                'httpRetryEvents': [
                    'string',
                ],
                'maxRetries': 123,
                'perRetryTimeout': {
                    'unit': 'ms'|'s',
                    'value': 123
                },
                'tcpRetryEvents': [
                    'connection-error',
                ]
            }
        },
        'priority': 123,
        'tcpRoute': {
            'action': {
                'weightedTargets': [
                    {
                        'virtualNode': 'string',
                        'weight': 123
                    },
                ]
            }
        }
    },
    tags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ],
    virtualRouterName='string'
)
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.
string
[REQUIRED]
The name of the service mesh to create the route in.
string
[REQUIRED]
The name to use for the route.
dict
[REQUIRED]
The route specification to apply.
httpRoute (dict) --
The HTTP routing information for the route.
action (dict) -- [REQUIRED]
The action to take if a match is determined.
weightedTargets (list) -- [REQUIRED]
The targets that traffic is routed to when a request matches the route. You can specify one or more targets and their relative weights to distribute traffic with.
(dict) --
An object representing 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.
virtualNode (string) -- [REQUIRED]
The virtual node to associate with the weighted target.
weight (integer) -- [REQUIRED]
The relative weight of the weighted target.
match (dict) -- [REQUIRED]
The criteria for determining an HTTP request match.
headers (list) --
The client request headers to match on.
(dict) --
An object representing the HTTP header in the request.
invert (boolean) --
Specify True to match the opposite of the HeaderMatchMethod method and value. The default value is False.
match (dict) --
The HeaderMatchMethod object.
exact (string) --
The header value sent by the client must match the specified value exactly.
prefix (string) --
The header value sent by the client must begin with the specified characters.
range (dict) --
The object that specifies the range of numbers that the header value sent by the client must be included in.
end (integer) -- [REQUIRED]
The end of the range.
start (integer) -- [REQUIRED]
The start of the range.
regex (string) --
The header value sent by the client must include the specified characters.
suffix (string) --
The header value sent by the client must end with the specified characters.
name (string) -- [REQUIRED]
A name for the HTTP header in the client request that will be matched on.
method (string) --
The client request header method to match on.
prefix (string) -- [REQUIRED]
/, 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.
scheme (string) --
The client request header scheme to match on.
retryPolicy (dict) --
An object that represents a retry policy.
httpRetryEvents (list) --
Specify at least one of the following values.
server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511
gateway-error – HTTP status codes 502, 503, and 504
client-error – HTTP status code 409
stream-error – Retry on refused stream
(string) --
maxRetries (integer) -- [REQUIRED]
The maximum number of retry attempts. If no value is specified, the default is 1.
perRetryTimeout (dict) -- [REQUIRED]
An object that represents the retry duration.
unit (string) --
The unit of time between retry attempts.
value (integer) --
The duration of time between retry attempts.
tcpRetryEvents (list) --
Specify a valid value.
(string) --
priority (integer) --
The priority for the route. Routes are matched based on the specified value, where 0 is the highest priority.
tcpRoute (dict) --
The TCP routing information for the route.
action (dict) -- [REQUIRED]
The action to take if a match is determined.
weightedTargets (list) -- [REQUIRED]
The targets that traffic is routed to when a request matches the route. You can specify one or more targets and their relative weights to distribute traffic with.
(dict) --
An object representing 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.
virtualNode (string) -- [REQUIRED]
The virtual node to associate with the weighted target.
weight (integer) -- [REQUIRED]
The relative weight of the weighted target.
list
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.
(dict) --
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.
key (string) -- [REQUIRED]
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.
value (string) --
The optional part of a key-value pair that make up a tag. A value acts as a descriptor within a tag category (key).
string
[REQUIRED]
The name of the virtual router in which to create the route.
dict
Response Syntax
{
    'route': {
        'meshName': 'string',
        'metadata': {
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'lastUpdatedAt': datetime(2015, 1, 1),
            'uid': 'string',
            'version': 123
        },
        'routeName': 'string',
        'spec': {
            'httpRoute': {
                'action': {
                    'weightedTargets': [
                        {
                            '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': 'CONNECT'|'DELETE'|'GET'|'HEAD'|'OPTIONS'|'PATCH'|'POST'|'PUT'|'TRACE',
                    'prefix': 'string',
                    'scheme': 'http'|'https'
                },
                'retryPolicy': {
                    'httpRetryEvents': [
                        'string',
                    ],
                    'maxRetries': 123,
                    'perRetryTimeout': {
                        'unit': 'ms'|'s',
                        'value': 123
                    },
                    'tcpRetryEvents': [
                        'connection-error',
                    ]
                }
            },
            'priority': 123,
            'tcpRoute': {
                'action': {
                    'weightedTargets': [
                        {
                            'virtualNode': 'string',
                            'weight': 123
                        },
                    ]
                }
            }
        },
        'status': {
            'status': 'ACTIVE'|'DELETED'|'INACTIVE'
        },
        '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.
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.
httpRoute (dict) --
The HTTP routing information for the route.
action (dict) --
The action to take if a match is determined.
weightedTargets (list) --
The targets that traffic is routed to when a request matches the route. You can specify one or more targets and their relative weights to distribute traffic with.
(dict) --
An object representing 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.
virtualNode (string) --
The virtual node to associate with the weighted target.
weight (integer) --
The relative weight of the weighted target.
match (dict) --
The criteria for determining an HTTP request match.
headers (list) --
The client request headers to match on.
(dict) --
An object representing the HTTP header in the request.
invert (boolean) --
Specify True to match the opposite of the HeaderMatchMethod method and value. The default value is False.
match (dict) --
The HeaderMatchMethod object.
exact (string) --
The header value sent by the client must match the specified value exactly.
prefix (string) --
The header value sent by the client must begin with the specified characters.
range (dict) --
The object that specifies the range of numbers that the header value sent by the client must be included in.
end (integer) --
The end of the range.
start (integer) --
The start of the range.
regex (string) --
The header value sent by the client must include the specified characters.
suffix (string) --
The header 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 header method 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.
scheme (string) --
The client request header scheme to match on.
retryPolicy (dict) --
An object that represents a retry policy.
httpRetryEvents (list) --
Specify at least one of the following values.
server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511
gateway-error – HTTP status codes 502, 503, and 504
client-error – HTTP status code 409
stream-error – Retry on refused stream
(string) --
maxRetries (integer) --
The maximum number of retry attempts. If no value is specified, the default is 1.
perRetryTimeout (dict) --
An object that represents the retry duration.
unit (string) --
The unit of time between retry attempts.
value (integer) --
The duration of time between retry attempts.
tcpRetryEvents (list) --
Specify a valid value.
(string) --
priority (integer) --
The priority for the route. Routes are matched based on the specified value, where 0 is the highest priority.
tcpRoute (dict) --
The TCP routing information for the route.
action (dict) --
The action to take if a match is determined.
weightedTargets (list) --
The targets that traffic is routed to when a request matches the route. You can specify one or more targets and their relative weights to distribute traffic with.
(dict) --
An object representing 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.
virtualNode (string) --
The virtual node to associate with the weighted target.
weight (integer) --
The relative weight of the weighted target.
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.
{'route': {'spec': {'httpRoute': {'retryPolicy': {'httpRetryEvents': ['string'],
                                                  'maxRetries': 'long',
                                                  'perRetryTimeout': {'unit': 'ms '
                                                                              '| '
                                                                              's',
                                                                      'value': 'long'},
                                                  'tcpRetryEvents': ['connection-error']}}}}}
      Deletes an existing route.
See also: AWS API Documentation
Request Syntax
client.delete_route(
    meshName='string',
    routeName='string',
    virtualRouterName='string'
)
string
[REQUIRED]
The name of the service mesh to delete the route in.
string
[REQUIRED]
The name of the route to delete.
string
[REQUIRED]
The name of the virtual router to delete the route in.
dict
Response Syntax
{
    'route': {
        'meshName': 'string',
        'metadata': {
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'lastUpdatedAt': datetime(2015, 1, 1),
            'uid': 'string',
            'version': 123
        },
        'routeName': 'string',
        'spec': {
            'httpRoute': {
                'action': {
                    'weightedTargets': [
                        {
                            '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': 'CONNECT'|'DELETE'|'GET'|'HEAD'|'OPTIONS'|'PATCH'|'POST'|'PUT'|'TRACE',
                    'prefix': 'string',
                    'scheme': 'http'|'https'
                },
                'retryPolicy': {
                    'httpRetryEvents': [
                        'string',
                    ],
                    'maxRetries': 123,
                    'perRetryTimeout': {
                        'unit': 'ms'|'s',
                        'value': 123
                    },
                    'tcpRetryEvents': [
                        'connection-error',
                    ]
                }
            },
            'priority': 123,
            'tcpRoute': {
                'action': {
                    'weightedTargets': [
                        {
                            'virtualNode': 'string',
                            'weight': 123
                        },
                    ]
                }
            }
        },
        'status': {
            'status': 'ACTIVE'|'DELETED'|'INACTIVE'
        },
        'virtualRouterName': 'string'
    }
}
Response Structure
(dict) --
route (dict) --
The route that was deleted.
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.
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.
httpRoute (dict) --
The HTTP routing information for the route.
action (dict) --
The action to take if a match is determined.
weightedTargets (list) --
The targets that traffic is routed to when a request matches the route. You can specify one or more targets and their relative weights to distribute traffic with.
(dict) --
An object representing 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.
virtualNode (string) --
The virtual node to associate with the weighted target.
weight (integer) --
The relative weight of the weighted target.
match (dict) --
The criteria for determining an HTTP request match.
headers (list) --
The client request headers to match on.
(dict) --
An object representing the HTTP header in the request.
invert (boolean) --
Specify True to match the opposite of the HeaderMatchMethod method and value. The default value is False.
match (dict) --
The HeaderMatchMethod object.
exact (string) --
The header value sent by the client must match the specified value exactly.
prefix (string) --
The header value sent by the client must begin with the specified characters.
range (dict) --
The object that specifies the range of numbers that the header value sent by the client must be included in.
end (integer) --
The end of the range.
start (integer) --
The start of the range.
regex (string) --
The header value sent by the client must include the specified characters.
suffix (string) --
The header 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 header method 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.
scheme (string) --
The client request header scheme to match on.
retryPolicy (dict) --
An object that represents a retry policy.
httpRetryEvents (list) --
Specify at least one of the following values.
server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511
gateway-error – HTTP status codes 502, 503, and 504
client-error – HTTP status code 409
stream-error – Retry on refused stream
(string) --
maxRetries (integer) --
The maximum number of retry attempts. If no value is specified, the default is 1.
perRetryTimeout (dict) --
An object that represents the retry duration.
unit (string) --
The unit of time between retry attempts.
value (integer) --
The duration of time between retry attempts.
tcpRetryEvents (list) --
Specify a valid value.
(string) --
priority (integer) --
The priority for the route. Routes are matched based on the specified value, where 0 is the highest priority.
tcpRoute (dict) --
The TCP routing information for the route.
action (dict) --
The action to take if a match is determined.
weightedTargets (list) --
The targets that traffic is routed to when a request matches the route. You can specify one or more targets and their relative weights to distribute traffic with.
(dict) --
An object representing 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.
virtualNode (string) --
The virtual node to associate with the weighted target.
weight (integer) --
The relative weight of the weighted target.
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.
{'route': {'spec': {'httpRoute': {'retryPolicy': {'httpRetryEvents': ['string'],
                                                  'maxRetries': 'long',
                                                  'perRetryTimeout': {'unit': 'ms '
                                                                              '| '
                                                                              's',
                                                                      'value': 'long'},
                                                  'tcpRetryEvents': ['connection-error']}}}}}
      Describes an existing route.
See also: AWS API Documentation
Request Syntax
client.describe_route(
    meshName='string',
    routeName='string',
    virtualRouterName='string'
)
string
[REQUIRED]
The name of the service mesh that the route resides in.
string
[REQUIRED]
The name of the route to describe.
string
[REQUIRED]
The name of the virtual router that the route is associated with.
dict
Response Syntax
{
    'route': {
        'meshName': 'string',
        'metadata': {
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'lastUpdatedAt': datetime(2015, 1, 1),
            'uid': 'string',
            'version': 123
        },
        'routeName': 'string',
        'spec': {
            'httpRoute': {
                'action': {
                    'weightedTargets': [
                        {
                            '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': 'CONNECT'|'DELETE'|'GET'|'HEAD'|'OPTIONS'|'PATCH'|'POST'|'PUT'|'TRACE',
                    'prefix': 'string',
                    'scheme': 'http'|'https'
                },
                'retryPolicy': {
                    'httpRetryEvents': [
                        'string',
                    ],
                    'maxRetries': 123,
                    'perRetryTimeout': {
                        'unit': 'ms'|'s',
                        'value': 123
                    },
                    'tcpRetryEvents': [
                        'connection-error',
                    ]
                }
            },
            'priority': 123,
            'tcpRoute': {
                'action': {
                    'weightedTargets': [
                        {
                            'virtualNode': 'string',
                            'weight': 123
                        },
                    ]
                }
            }
        },
        'status': {
            'status': 'ACTIVE'|'DELETED'|'INACTIVE'
        },
        'virtualRouterName': 'string'
    }
}
Response Structure
(dict) --
route (dict) --
The full description of your route.
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.
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.
httpRoute (dict) --
The HTTP routing information for the route.
action (dict) --
The action to take if a match is determined.
weightedTargets (list) --
The targets that traffic is routed to when a request matches the route. You can specify one or more targets and their relative weights to distribute traffic with.
(dict) --
An object representing 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.
virtualNode (string) --
The virtual node to associate with the weighted target.
weight (integer) --
The relative weight of the weighted target.
match (dict) --
The criteria for determining an HTTP request match.
headers (list) --
The client request headers to match on.
(dict) --
An object representing the HTTP header in the request.
invert (boolean) --
Specify True to match the opposite of the HeaderMatchMethod method and value. The default value is False.
match (dict) --
The HeaderMatchMethod object.
exact (string) --
The header value sent by the client must match the specified value exactly.
prefix (string) --
The header value sent by the client must begin with the specified characters.
range (dict) --
The object that specifies the range of numbers that the header value sent by the client must be included in.
end (integer) --
The end of the range.
start (integer) --
The start of the range.
regex (string) --
The header value sent by the client must include the specified characters.
suffix (string) --
The header 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 header method 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.
scheme (string) --
The client request header scheme to match on.
retryPolicy (dict) --
An object that represents a retry policy.
httpRetryEvents (list) --
Specify at least one of the following values.
server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511
gateway-error – HTTP status codes 502, 503, and 504
client-error – HTTP status code 409
stream-error – Retry on refused stream
(string) --
maxRetries (integer) --
The maximum number of retry attempts. If no value is specified, the default is 1.
perRetryTimeout (dict) --
An object that represents the retry duration.
unit (string) --
The unit of time between retry attempts.
value (integer) --
The duration of time between retry attempts.
tcpRetryEvents (list) --
Specify a valid value.
(string) --
priority (integer) --
The priority for the route. Routes are matched based on the specified value, where 0 is the highest priority.
tcpRoute (dict) --
The TCP routing information for the route.
action (dict) --
The action to take if a match is determined.
weightedTargets (list) --
The targets that traffic is routed to when a request matches the route. You can specify one or more targets and their relative weights to distribute traffic with.
(dict) --
An object representing 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.
virtualNode (string) --
The virtual node to associate with the weighted target.
weight (integer) --
The relative weight of the weighted target.
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.
{'spec': {'httpRoute': {'retryPolicy': {'httpRetryEvents': ['string'],
                                        'maxRetries': 'long',
                                        'perRetryTimeout': {'unit': 'ms | s',
                                                            'value': 'long'},
                                        'tcpRetryEvents': ['connection-error']}}}}
        Response {'route': {'spec': {'httpRoute': {'retryPolicy': {'httpRetryEvents': ['string'],
                                                  'maxRetries': 'long',
                                                  'perRetryTimeout': {'unit': 'ms '
                                                                              '| '
                                                                              's',
                                                                      'value': 'long'},
                                                  'tcpRetryEvents': ['connection-error']}}}}}
      Updates an existing route for a specified service mesh and virtual router.
See also: AWS API Documentation
Request Syntax
client.update_route(
    clientToken='string',
    meshName='string',
    routeName='string',
    spec={
        'httpRoute': {
            'action': {
                'weightedTargets': [
                    {
                        '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': 'CONNECT'|'DELETE'|'GET'|'HEAD'|'OPTIONS'|'PATCH'|'POST'|'PUT'|'TRACE',
                'prefix': 'string',
                'scheme': 'http'|'https'
            },
            'retryPolicy': {
                'httpRetryEvents': [
                    'string',
                ],
                'maxRetries': 123,
                'perRetryTimeout': {
                    'unit': 'ms'|'s',
                    'value': 123
                },
                'tcpRetryEvents': [
                    'connection-error',
                ]
            }
        },
        'priority': 123,
        'tcpRoute': {
            'action': {
                'weightedTargets': [
                    {
                        'virtualNode': 'string',
                        'weight': 123
                    },
                ]
            }
        }
    },
    virtualRouterName='string'
)
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.
string
[REQUIRED]
The name of the service mesh that the route resides in.
string
[REQUIRED]
The name of the route to update.
dict
[REQUIRED]
The new route specification to apply. This overwrites the existing data.
httpRoute (dict) --
The HTTP routing information for the route.
action (dict) -- [REQUIRED]
The action to take if a match is determined.
weightedTargets (list) -- [REQUIRED]
The targets that traffic is routed to when a request matches the route. You can specify one or more targets and their relative weights to distribute traffic with.
(dict) --
An object representing 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.
virtualNode (string) -- [REQUIRED]
The virtual node to associate with the weighted target.
weight (integer) -- [REQUIRED]
The relative weight of the weighted target.
match (dict) -- [REQUIRED]
The criteria for determining an HTTP request match.
headers (list) --
The client request headers to match on.
(dict) --
An object representing the HTTP header in the request.
invert (boolean) --
Specify True to match the opposite of the HeaderMatchMethod method and value. The default value is False.
match (dict) --
The HeaderMatchMethod object.
exact (string) --
The header value sent by the client must match the specified value exactly.
prefix (string) --
The header value sent by the client must begin with the specified characters.
range (dict) --
The object that specifies the range of numbers that the header value sent by the client must be included in.
end (integer) -- [REQUIRED]
The end of the range.
start (integer) -- [REQUIRED]
The start of the range.
regex (string) --
The header value sent by the client must include the specified characters.
suffix (string) --
The header value sent by the client must end with the specified characters.
name (string) -- [REQUIRED]
A name for the HTTP header in the client request that will be matched on.
method (string) --
The client request header method to match on.
prefix (string) -- [REQUIRED]
/, 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.
scheme (string) --
The client request header scheme to match on.
retryPolicy (dict) --
An object that represents a retry policy.
httpRetryEvents (list) --
Specify at least one of the following values.
server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511
gateway-error – HTTP status codes 502, 503, and 504
client-error – HTTP status code 409
stream-error – Retry on refused stream
(string) --
maxRetries (integer) -- [REQUIRED]
The maximum number of retry attempts. If no value is specified, the default is 1.
perRetryTimeout (dict) -- [REQUIRED]
An object that represents the retry duration.
unit (string) --
The unit of time between retry attempts.
value (integer) --
The duration of time between retry attempts.
tcpRetryEvents (list) --
Specify a valid value.
(string) --
priority (integer) --
The priority for the route. Routes are matched based on the specified value, where 0 is the highest priority.
tcpRoute (dict) --
The TCP routing information for the route.
action (dict) -- [REQUIRED]
The action to take if a match is determined.
weightedTargets (list) -- [REQUIRED]
The targets that traffic is routed to when a request matches the route. You can specify one or more targets and their relative weights to distribute traffic with.
(dict) --
An object representing 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.
virtualNode (string) -- [REQUIRED]
The virtual node to associate with the weighted target.
weight (integer) -- [REQUIRED]
The relative weight of the weighted target.
string
[REQUIRED]
The name of the virtual router that the route is associated with.
dict
Response Syntax
{
    'route': {
        'meshName': 'string',
        'metadata': {
            'arn': 'string',
            'createdAt': datetime(2015, 1, 1),
            'lastUpdatedAt': datetime(2015, 1, 1),
            'uid': 'string',
            'version': 123
        },
        'routeName': 'string',
        'spec': {
            'httpRoute': {
                'action': {
                    'weightedTargets': [
                        {
                            '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': 'CONNECT'|'DELETE'|'GET'|'HEAD'|'OPTIONS'|'PATCH'|'POST'|'PUT'|'TRACE',
                    'prefix': 'string',
                    'scheme': 'http'|'https'
                },
                'retryPolicy': {
                    'httpRetryEvents': [
                        'string',
                    ],
                    'maxRetries': 123,
                    'perRetryTimeout': {
                        'unit': 'ms'|'s',
                        'value': 123
                    },
                    'tcpRetryEvents': [
                        'connection-error',
                    ]
                }
            },
            'priority': 123,
            'tcpRoute': {
                'action': {
                    'weightedTargets': [
                        {
                            'virtualNode': 'string',
                            'weight': 123
                        },
                    ]
                }
            }
        },
        'status': {
            'status': 'ACTIVE'|'DELETED'|'INACTIVE'
        },
        'virtualRouterName': 'string'
    }
}
Response Structure
(dict) --
route (dict) --
A full description of the route that was updated.
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.
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.
httpRoute (dict) --
The HTTP routing information for the route.
action (dict) --
The action to take if a match is determined.
weightedTargets (list) --
The targets that traffic is routed to when a request matches the route. You can specify one or more targets and their relative weights to distribute traffic with.
(dict) --
An object representing 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.
virtualNode (string) --
The virtual node to associate with the weighted target.
weight (integer) --
The relative weight of the weighted target.
match (dict) --
The criteria for determining an HTTP request match.
headers (list) --
The client request headers to match on.
(dict) --
An object representing the HTTP header in the request.
invert (boolean) --
Specify True to match the opposite of the HeaderMatchMethod method and value. The default value is False.
match (dict) --
The HeaderMatchMethod object.
exact (string) --
The header value sent by the client must match the specified value exactly.
prefix (string) --
The header value sent by the client must begin with the specified characters.
range (dict) --
The object that specifies the range of numbers that the header value sent by the client must be included in.
end (integer) --
The end of the range.
start (integer) --
The start of the range.
regex (string) --
The header value sent by the client must include the specified characters.
suffix (string) --
The header 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 header method 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.
scheme (string) --
The client request header scheme to match on.
retryPolicy (dict) --
An object that represents a retry policy.
httpRetryEvents (list) --
Specify at least one of the following values.
server-error – HTTP status codes 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, and 511
gateway-error – HTTP status codes 502, 503, and 504
client-error – HTTP status code 409
stream-error – Retry on refused stream
(string) --
maxRetries (integer) --
The maximum number of retry attempts. If no value is specified, the default is 1.
perRetryTimeout (dict) --
An object that represents the retry duration.
unit (string) --
The unit of time between retry attempts.
value (integer) --
The duration of time between retry attempts.
tcpRetryEvents (list) --
Specify a valid value.
(string) --
priority (integer) --
The priority for the route. Routes are matched based on the specified value, where 0 is the highest priority.
tcpRoute (dict) --
The TCP routing information for the route.
action (dict) --
The action to take if a match is determined.
weightedTargets (list) --
The targets that traffic is routed to when a request matches the route. You can specify one or more targets and their relative weights to distribute traffic with.
(dict) --
An object representing 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.
virtualNode (string) --
The virtual node to associate with the weighted target.
weight (integer) --
The relative weight of the weighted target.
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.