create_api
¶
create_api(
*,
config_overrides: Optional[ApiGatewayV2ClientConfig] = None,
api_key_selection_expression: Optional[SelectionExpression] = None,
cors_configuration: Optional[Cors] = None,
credentials_arn: Optional[Arn] = None,
description: Optional[StringWithLengthBetween0And1024] = None,
disable_schema_validation: Optional[__boolean] = None,
disable_execute_api_endpoint: Optional[__boolean] = None,
ip_address_type: Optional[IpAddressType] = None,
name: Optional[StringWithLengthBetween1And128] = None,
protocol_type: Optional[ProtocolType] = None,
route_key: Optional[SelectionKey] = None,
route_selection_expression: Optional[SelectionExpression] = None,
tags: Optional[Tags] = None,
target: Optional[UriWithLengthBetween1And2048] = None,
version: Optional[StringWithLengthBetween1And64] = None,
) -> CreateApiResponse
Creates an Api resource.
Parameters:
-
api_key_selection_expression(Optional[SelectionExpression], default:None) –An API key selection expression. Supported only for WebSocket APIs. See API Key Selection Expressions.
-
cors_configuration(Optional[Cors], default:None) –A CORS configuration. Supported only for HTTP APIs. See Configuring CORS for more information.
-
credentials_arn(Optional[Arn], default:None) –This property is part of quick create. It specifies the credentials required for the integration, if any. For a Lambda integration, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify arn:aws:iam::*:user/*. To use resource-based permissions on supported AWS services, specify null. Currently, this property is not used for HTTP integrations. Supported only for HTTP APIs.
-
description(Optional[StringWithLengthBetween0And1024], default:None) –The description of the API.
-
disable_schema_validation(Optional[__boolean], default:None) –Avoid validating models when creating a deployment. Supported only for WebSocket APIs.
-
disable_execute_api_endpoint(Optional[__boolean], default:None) –Specifies whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
-
ip_address_type(Optional[IpAddressType], default:None) –The IP address types that can invoke the API.
-
name(Optional[StringWithLengthBetween1And128], default:None) –The name of the API.
-
protocol_type(Optional[ProtocolType], default:None) –The API protocol.
-
route_key(Optional[SelectionKey], default:None) –This property is part of quick create. If you don't specify a routeKey, a default route of $default is created. The $default route acts as a catch-all for any request made to your API, for a particular stage. The $default route key can't be modified. You can add routes after creating the API, and you can update the route keys of additional routes. Supported only for HTTP APIs.
-
route_selection_expression(Optional[SelectionExpression], default:None) –The route selection expression for the API. For HTTP APIs, the routeSelectionExpression must be ${request.method} ${request.path}. If not provided, this will be the default for HTTP APIs. This property is required for WebSocket APIs.
-
tags(Optional[Tags], default:None) –The collection of tags. Each tag element is associated with a given resource.
-
target(Optional[UriWithLengthBetween1And2048], default:None) –This property is part of quick create. Quick create produces an API with an integration, a default catch-all route, and a default stage which is configured to automatically deploy changes. For HTTP integrations, specify a fully qualified URL. For Lambda integrations, specify a function ARN. The type of the integration will be HTTP_PROXY or AWS_PROXY, respectively. Supported only for HTTP APIs.
-
version(Optional[StringWithLengthBetween1And64], default:None) –A version identifier for the API.
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
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | |