Skip to content

export_api async

export_api(
    api_id: __string,
    specification: __string,
    *,
    config_overrides: Optional[AsyncApiGatewayV2ClientConfig] = None,
    export_version: Optional[__string] = None,
    include_extensions: Optional[__boolean] = None,
    output_type: Optional[__string] = None,
    stage_name: Optional[__string] = None,
) -> ExportApiResponse

export_api

Parameters:

  • api_id (__string) –

    The API identifier.

  • export_version (Optional[__string], default: None ) –

    The version of the API Gateway export algorithm. API Gateway uses the latest version by default. Currently, the only supported version is 1.0.

  • include_extensions (Optional[__boolean], default: None ) –

    Specifies whether to include API Gateway extensions in the exported API definition. API Gateway extensions are included by default.

  • output_type (Optional[__string], default: None ) –

    The output type of the exported definition file. Valid values are JSON and YAML.

  • specification (__string) –

    The version of the API specification to use. OAS30, for OpenAPI 3.0, is the only supported value.

  • stage_name (Optional[__string], default: None ) –

    The name of the API stage to export. If you don't specify this property, a representation of the latest API configuration is exported.

Raises:

  • BadRequestException –

    The request is not valid, for example, the input is incomplete or incorrect. 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/async_api_gateway_v2.py
async def export_api(
    self,
    api_id: "capo_apigatewayv2.types.__string.__string",
    specification: "capo_apigatewayv2.types.__string.__string",
    *,
    config_overrides: Optional[AsyncApiGatewayV2ClientConfig] = None,
    export_version: Optional["capo_apigatewayv2.types.__string.__string"] = None,
    include_extensions: Optional[
        "capo_apigatewayv2.types.__boolean.__boolean"
    ] = None,
    output_type: Optional["capo_apigatewayv2.types.__string.__string"] = None,
    stage_name: Optional["capo_apigatewayv2.types.__string.__string"] = None,
) -> "capo_apigatewayv2.types.export_api_response.ExportApiResponse":
    """export_api

    Args:
        api_id: <p>The API identifier.</p>
        export_version: <p>The version of the API Gateway export algorithm. API Gateway uses the latest version by default. Currently, the only supported version is 1.0.</p>
        include_extensions: <p>Specifies whether to include <a href="https://docs.aws.amazon.com//apigateway/latest/developerguide/api-gateway-swagger-extensions.html">API Gateway extensions</a> in the exported API definition. API Gateway extensions are included by default.</p>
        output_type: <p>The output type of the exported definition file. Valid values are JSON and YAML.</p>
        specification: <p>The version of the API specification to use. OAS30, for OpenAPI 3.0, is the only supported value.</p>
        stage_name: <p>The name of the API stage to export. If you don't specify this property, a representation of the latest API configuration is exported.</p>

    Raises:
        capo_apigatewayv2.errors.bad_request_exception.BadRequestException: <p>The request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.</p>
        capo_apigatewayv2.errors.not_found_exception.NotFoundException: <p>The resource specified in the request was not found. See the message field for more information.</p>
        capo_apigatewayv2.errors.too_many_requests_exception.TooManyRequestsException: <p>A limit has been exceeded. See the accompanying error message for details.</p>
        capo_apigatewayv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_apigatewayv2.types.export_api_request.ExportApiRequest]",
    ) -> AsyncOperationResponse[
        "capo_apigatewayv2.types.export_api_response.ExportApiResponse"
    ]:
        import capo_apigatewayv2._operations.api_gateway_v2.export_api

        (
            output,
            http_response,
        ) = await capo_apigatewayv2._operations.api_gateway_v2.export_api.async_export_api(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ExportApi")
    )
    input_: capo_apigatewayv2.types.export_api_request.ExportApiRequest = {
        "api_id": api_id,
        "specification": specification,
    }
    if export_version is not None:
        input_["export_version"] = export_version
    if include_extensions is not None:
        input_["include_extensions"] = include_extensions
    if output_type is not None:
        input_["output_type"] = output_type
    if stage_name is not None:
        input_["stage_name"] = stage_name

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output