Skip to main content

exports

Creates, updates, deletes, gets or lists an exports resource.

Overview

Nameexports
TypeResource
Idaws.apigateway.exports

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
bodystring (byte)The binary blob response to GetExport, which contains the export.
content_dispositionstringThe content-disposition header value in the HTTP response.
content_typestringThe content-type header value in the HTTP response. This will correspond to a valid 'accept' type in the request.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_exportselectrestapi_id, stage_name, export_type, regionparameters, AcceptExports a deployed version of a RestApi in a specified format.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
export_typestringThe type of export. Acceptable values are 'oas30' for OpenAPI 3.0.x and 'swagger' for Swagger/OpenAPI 2.0.
regionstringAWS region (default: us-east-1)
restapi_idstringThe string identifier of the associated RestApi.
stage_namestringThe name of the Stage that will be exported.
AcceptstringThe content-type of the export, for example application/json. Currently application/json and application/yaml are supported for exportType ofoas30 and swagger. This should be specified in the Accept header for direct API requests.
parametersobjectA key-value map of query string parameters that specify properties of the export, depending on the requested exportType. For exportType oas30 and swagger, any combination of the following parameters are supported: extensions='integrations' or extensions='apigateway' will export the API with x-amazon-apigateway-integration extensions. extensions='authorizers' will export the API with x-amazon-apigateway-authorizer extensions. postman will export the API with Postman extensions, allowing for import to the Postman tool

SELECT examples

Exports a deployed version of a RestApi in a specified format.

SELECT
body,
content_disposition,
content_type
FROM aws.apigateway.exports
WHERE restapi_id = '{{ restapi_id }}' -- required
AND stage_name = '{{ stage_name }}' -- required
AND export_type = '{{ export_type }}' -- required
AND region = '{{ region }}' -- required
AND parameters = '{{ parameters }}'
AND Accept = '{{ Accept }}'
;