diff --git a/awscli/examples/apigatewayv2/create-routing-rule.rst b/awscli/examples/apigatewayv2/create-routing-rule.rst new file mode 100644 index 000000000000..c333827f979d --- /dev/null +++ b/awscli/examples/apigatewayv2/create-routing-rule.rst @@ -0,0 +1,52 @@ +**To create a routing rule** + +The following ``create-routing-rule`` example creates a routing rule with a priority of ``50``. :: + + aws apigatewayv2 create-routing-rule \ + --domain-name 'regional.example.com' \ + --priority 50 \ + --conditions '[ \ + { \ + "MatchBasePaths": { \ + "AnyOf": [ \ + "PetStoreShopper" \ + ] \ + } \ + } \ + ]' \ + --actions '[ \ + { \ + "InvokeApi": { \ + "ApiId": "abcd1234", \ + "Stage": "prod" \ + } \ + } \ + ]' + +Output:: + + { + "Actions": [ + { + "InvokeApi": { + "ApiId": "abcd1234", + "Stage": "prod", + "StripBasePath": false + } + } + ], + "Conditions": [ + { + "MatchBasePaths": { + "AnyOf": [ + "PetStoreShopper" + ] + } + } + ], + "Priority": 50, + "RoutingRuleArn": "arn:aws:apigateway:us-east-2:123456789012:/domainnames/regional.example.com/routingrules/aaa111", + "RoutingRuleId": "aaa111" + } + +For more information, see `Routing rules to connect API stages to a custom domain name for REST APIs `__ in the *Amazon API Gateway Developer Guide*. diff --git a/awscli/examples/apigatewayv2/delete-routing-rule.rst b/awscli/examples/apigatewayv2/delete-routing-rule.rst new file mode 100644 index 000000000000..cb1ef1ffd88f --- /dev/null +++ b/awscli/examples/apigatewayv2/delete-routing-rule.rst @@ -0,0 +1,11 @@ +**To delete a routing rule** + +The following ``delete-routing-rule`` example deletes a routing rule for a custom domain name. :: + + aws apigatewayv2 delete-routing-rule \ + --domain-name 'regional.example.com' \ + --routing-rule-id aaa111 + +This command produces no output. + +For more information, see `Routing rules to connect API stages to a custom domain name for REST APIs `__ in the *Amazon API Gateway Developer Guide*. \ No newline at end of file diff --git a/awscli/examples/apigatewayv2/get-routing-rule.rst b/awscli/examples/apigatewayv2/get-routing-rule.rst new file mode 100644 index 000000000000..03b1f3edbbdc --- /dev/null +++ b/awscli/examples/apigatewayv2/get-routing-rule.rst @@ -0,0 +1,35 @@ +**To get a routing rule** + +The following ``get-routing-rule`` example gets a routing rule for a domain name. :: + + aws apigatewayv2 get-routing-rule \ + --domain-name 'regional.example.com' \ + --routing-rule-id aaa111 + +Output:: + + { + "Actions": [ + { + "InvokeApi": { + "ApiId": "abcd1234", + "Stage": "prod", + "StripBasePath": false + } + } + ], + "Conditions": [ + { + "MatchBasePaths": { + "AnyOf": [ + "PetStoreShopper" + ] + } + } + ], + "Priority": 50, + "RoutingRuleArn": "arn:aws:apigateway:us-east-2:123456789012:/domainnames/regional.example.com/routingrules/aaa111", + "RoutingRuleId": "aaa111" + } + +For more information, see `Routing rules to connect API stages to a custom domain name for REST APIs `__ in the *Amazon API Gateway Developer Guide*. \ No newline at end of file diff --git a/awscli/examples/apigatewayv2/list-routing-rules.rst b/awscli/examples/apigatewayv2/list-routing-rules.rst new file mode 100644 index 000000000000..3cd9c707be69 --- /dev/null +++ b/awscli/examples/apigatewayv2/list-routing-rules.rst @@ -0,0 +1,38 @@ +**To list routing rules** + +The following ``list-routing-rules`` example lists the routing rules for a domain name. :: + + aws apigatewayv2 list-routing-rules \ + --domain-name 'regional.example.com' + +Output:: + + { + "RoutingRules": [ + { + "Actions": [ + { + "InvokeApi": { + "ApiId": "abcd1234", + "Stage": "prod", + "StripBasePath": false + } + } + ], + "Conditions": [ + { + "MatchBasePaths": { + "AnyOf": [ + "PetStoreShopper" + ] + } + } + ], + "Priority": 150, + "RoutingRuleArn": "arn:aws:apigateway:us-east-1:123456789012:/domainnames/regional.example.com/routingrules/aaa111", + "RoutingRuleId": "aaa111" + } + ] + } + +For more information, see `Routing rules to connect API stages to a custom domain name for REST APIs `__ in the *Amazon API Gateway Developer Guide*. \ No newline at end of file diff --git a/awscli/examples/apigatewayv2/put-routing-rule.rst b/awscli/examples/apigatewayv2/put-routing-rule.rst new file mode 100644 index 000000000000..c65634c4eb3d --- /dev/null +++ b/awscli/examples/apigatewayv2/put-routing-rule.rst @@ -0,0 +1,52 @@ +**To update a routing rule** + +The following ``put-routing-rule`` example updates the priority of a routing rule. :: + + aws apigatewayv2 put-routing-rule \ + --domain-name 'regional.example.com' \ + --priority 150 \ + --conditions '[ \ + { \ + "MatchBasePaths": { \ + "AnyOf": [ \ + "PetStoreShopper" \ + ] \ + } \ + } \ + ]' \ + --actions '[ \ + { \ + "InvokeApi": { \ + "ApiId": "abcd1234", \ + "Stage": "prod" \ + } \ + } \ + ]' + +Output:: + + { + "Actions": [ + { + "InvokeApi": { + "ApiId": "abcd1234", + "Stage": "prod", + "StripBasePath": false + } + } + ], + "Conditions": [ + { + "MatchBasePaths": { + "AnyOf": [ + "PetStoreShopper" + ] + } + } + ], + "Priority": 150, + "RoutingRuleArn": "arn:aws:apigateway:us-east-2:123456789012:/domainnames/regional.example.com/routingrules/aaa111", + "RoutingRuleId": "aaa111" + } + +For more information, see `Routing rules to connect API stages to a custom domain name for REST APIs `__ in the *Amazon API Gateway Developer Guide*.