Skip to content

APIGatewayClient.create_rest_api

rboto-api-gateway==0.4.0 · Service index · Types

Model summary (excerpt): Creates a new RestApi resource.

Install and imports

python -m pip install "rboto[api-gateway]==0.4.0"
from rboto import APIGatewayClient
from collections.abc import Sequence
from rboto_api_gateway.types import (
    ApiKeySourceType,
    CreateRestApiOutput,
    EndpointAccessMode,
    EndpointConfiguration,
    SecurityPolicy,
)

Signature

async def create_rest_api(
    *,
    name: str,
    description: str | None = None,
    version: str | None = None,
    clone_from: str | None = None,
    binary_media_types: Sequence[str] | None = None,
    minimum_compression_size: int | None = None,
    api_key_source: ApiKeySourceType | None = None,
    endpoint_configuration: EndpointConfiguration | None = None,
    policy: str | None = None,
    tags: dict[str, str] | None = None,
    disable_execute_api_endpoint: bool | None = None,
    security_policy: SecurityPolicy | None = None,
    endpoint_access_mode: EndpointAccessMode | None = None,
) -> CreateRestApiOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
name Yes The name of the RestApi.
description No The description of the RestApi.
version No A version identifier for the API.
clone_from No The ID of the RestApi that you want to clone from.
binary_media_types No The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
minimum_compression_size No A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.
api_key_source No The source of the API key for metering requests according to a usage plan. Valid values are: HEADER to read the API key from the X-API-Key header of a request. AUTHORIZER to read the API key from the UsageIdentifierKey from a custom authorizer.
endpoint_configuration No The endpoint configuration of this RestApi showing the endpoint types and IP address types of the API.
policy No A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
tags No The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start with aws: . The tag value can be up to 256 characters.
disable_execute_api_endpoint No 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
security_policy No The Transport Layer Security (TLS) version + cipher suite for this RestApi.
endpoint_access_mode No The endpoint access mode of the RestApi. Only available for RestApis that use security policies that start with SecurityPolicy_ .

Output

CreateRestApiOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
id str | None Always present —
name str | None Always present —
description str | None Always present —
created_date str | None Always present —
version str | None Always present —
warnings list[str] | None Always present —
binary_media_types list[str] | None Always present —
minimum_compression_size int | None Always present —
api_key_source ApiKeySourceTypeOutput | None Always present ApiKeySourceTypeOutput
endpoint_configuration EndpointConfigurationOutput | None Always present EndpointConfigurationOutput
policy str | None Always present —
tags dict[str, str] | None Always present —
disable_execute_api_endpoint bool Always present —
root_resource_id str | None Always present —
security_policy SecurityPolicyOutput | None Always present SecurityPolicyOutput
endpoint_access_mode EndpointAccessModeOutput | None Always present EndpointAccessModeOutput
api_status ApiStatusOutput | None Always present ApiStatusOutput
api_status_message str | None Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

ApiKeySourceType, CreateRestApiOutput, EndpointAccessMode, EndpointConfiguration, SecurityPolicy

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_api_gateway.exceptions:

BadRequestError, ConflictError, LimitExceededError, TooManyRequestsError, UnauthorizedError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model