create_route
¶
create_route(
api_id: __string,
*,
config_overrides: Optional[ApiGatewayV2ClientConfig] = None,
api_key_required: Optional[__boolean] = None,
authorization_scopes: Optional[AuthorizationScopes] = None,
authorization_type: Optional[AuthorizationType] = None,
authorizer_id: Optional[Id] = None,
model_selection_expression: Optional[SelectionExpression] = None,
operation_name: Optional[StringWithLengthBetween1And64] = None,
request_models: Optional[RouteModels] = None,
request_parameters: Optional[RouteParameters] = None,
route_key: Optional[SelectionKey] = None,
route_response_selection_expression: Optional[SelectionExpression] = None,
target: Optional[StringWithLengthBetween1And128] = None,
) -> CreateRouteResult
Creates a Route for an API.
Parameters:
-
api_id(__string) –The API identifier.
-
api_key_required(Optional[__boolean], default:None) –Specifies whether an API key is required for the route. Supported only for WebSocket APIs.
-
authorization_scopes(Optional[AuthorizationScopes], default:None) –The authorization scopes supported by this route.
-
authorization_type(Optional[AuthorizationType], default:None) –The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer.
-
authorizer_id(Optional[Id], default:None) –The identifier of the Authorizer resource to be associated with this route. The authorizer identifier is generated by API Gateway when you created the authorizer.
-
model_selection_expression(Optional[SelectionExpression], default:None) –The model selection expression for the route. Supported only for WebSocket APIs.
-
operation_name(Optional[StringWithLengthBetween1And64], default:None) –The operation name for the route.
-
request_models(Optional[RouteModels], default:None) –The request models for the route. Supported only for WebSocket APIs.
-
request_parameters(Optional[RouteParameters], default:None) –The request parameters for the route. Supported only for WebSocket APIs.
-
route_key(Optional[SelectionKey], default:None) –The route key for the route.
-
route_response_selection_expression(Optional[SelectionExpression], default:None) –The route response selection expression for the route. Supported only for WebSocket APIs.
-
target(Optional[StringWithLengthBetween1And128], default:None) –The target for the route.
Raises:
-
BadRequestException–The request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.
-
ConflictException–The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. See the accompanying error message for details.
-
NotFoundException–The resource specified in the request was not found. See the message field for more information.
-
TooManyRequestsException–A limit has been exceeded. See the accompanying error message for details.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_apigatewayv2/_services/api_gateway_v2.py
1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 | |