ApiGatewayV2 / Client / put_routing_rule

put_routing_rule

ApiGatewayV2.Client.put_routing_rule(**kwargs)

Updates a routing rule.

See also: AWS API Documentation

Request Syntax

response = client.put_routing_rule(
    Actions=[
        {
            'InvokeApi': {
                'ApiId': 'string',
                'Stage': 'string',
                'StripBasePath': True|False
            }
        },
    ],
    Conditions=[
        {
            'MatchBasePaths': {
                'AnyOf': [
                    'string',
                ]
            },
            'MatchHeaders': {
                'AnyOf': [
                    {
                        'Header': 'string',
                        'ValueGlob': 'string'
                    },
                ]
            }
        },
    ],
    DomainName='string',
    DomainNameId='string',
    Priority=123,
    RoutingRuleId='string'
)
Parameters:
  • Actions (list) –

    [REQUIRED]

    The routing rule action.

    • (dict) –

      The routing rule action.

      • InvokeApi (dict) – [REQUIRED]

        Represents an InvokeApi action.

        • ApiId (string) – [REQUIRED]

          The identifier.

        • Stage (string) – [REQUIRED]

          A string with a length between [1-128].

        • StripBasePath (boolean) –

          The strip base path setting.

  • Conditions (list) –

    [REQUIRED]

    The routing rule condition.

    • (dict) –

      Represents a routing rule condition.

      • MatchBasePaths (dict) –

        The base path to be matched.

        • AnyOf (list) – [REQUIRED] The string of the case sensitive base path to be matched.

          • (string) –

            After evaluating a selection expression, the result is compared against one or more selection keys to find a matching key. See Selection Expressions for a list of expressions and each expression’s associated selection key type.

      • MatchHeaders (dict) –

        The headers to be matched.

        • AnyOf (list) – [REQUIRED]

          The header name and header value glob to be matched. The matchHeaders condition is matched if any of the header name and header value globs are matched.

          • (dict) –

            Represents a MatchHeaderValue.

            • Header (string) – [REQUIRED]

              After evaluating a selection expression, the result is compared against one or more selection keys to find a matching key. See Selection Expressions for a list of expressions and each expression’s associated selection key type.

            • ValueGlob (string) – [REQUIRED]

              An expression used to extract information at runtime. See Selection Expressions for more information.

  • DomainName (string) –

    [REQUIRED]

    The domain name.

  • DomainNameId (string) – The domain name ID.

  • Priority (integer) –

    [REQUIRED]

    The routing rule priority.

  • RoutingRuleId (string) –

    [REQUIRED]

    The routing rule ID.

Return type:

dict

Returns:

Response Syntax

{
    'Actions': [
        {
            'InvokeApi': {
                'ApiId': 'string',
                'Stage': 'string',
                'StripBasePath': True|False
            }
        },
    ],
    'Conditions': [
        {
            'MatchBasePaths': {
                'AnyOf': [
                    'string',
                ]
            },
            'MatchHeaders': {
                'AnyOf': [
                    {
                        'Header': 'string',
                        'ValueGlob': 'string'
                    },
                ]
            }
        },
    ],
    'Priority': 123,
    'RoutingRuleArn': 'string',
    'RoutingRuleId': 'string'
}

Response Structure

  • (dict) –

    Success

    • Actions (list) –

      The routing rule action.

      • (dict) –

        The routing rule action.

        • InvokeApi (dict) –

          Represents an InvokeApi action.

          • ApiId (string) –

            The identifier.

          • Stage (string) –

            A string with a length between [1-128].

          • StripBasePath (boolean) –

            The strip base path setting.

    • Conditions (list) –

      The conditions of the routing rule.

      • (dict) –

        Represents a routing rule condition.

        • MatchBasePaths (dict) –

          The base path to be matched.

          • AnyOf (list) – The string of the case sensitive base path to be matched.

            • (string) –

              After evaluating a selection expression, the result is compared against one or more selection keys to find a matching key. See Selection Expressions for a list of expressions and each expression’s associated selection key type.

        • MatchHeaders (dict) –

          The headers to be matched.

          • AnyOf (list) –

            The header name and header value glob to be matched. The matchHeaders condition is matched if any of the header name and header value globs are matched.

            • (dict) –

              Represents a MatchHeaderValue.

              • Header (string) –

                After evaluating a selection expression, the result is compared against one or more selection keys to find a matching key. See Selection Expressions for a list of expressions and each expression’s associated selection key type.

              • ValueGlob (string) –

                An expression used to extract information at runtime. See Selection Expressions for more information.

    • Priority (integer) –

      The routing rule priority.

    • RoutingRuleArn (string) –

      The routing rule ARN.

    • RoutingRuleId (string) –

      The routing rule ID.

Exceptions