Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

Note: You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . apigatewayv2 ]

export-api

Description

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  export-api
--api-id <value>
[--export-version <value>]
[--include-extensions | --no-include-extensions]
--output-type <value>
--specification <value>
[--stage-name <value>]
<outfile>

Options

--api-id (string)

The API identifier.

--export-version (string)

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 | --no-include-extensions (boolean)

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

--output-type (string)

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

Possible values:

  • YAML
  • JSON

--specification (string)

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

Possible values:

  • OAS30

--stage-name (string)

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

outfile (string) Filename where the content will be saved

See 'aws help' for descriptions of global parameters.

Examples

To export an OpenAPI definition of an HTTP API

The following export-api example exports an OpenAPI 3.0 definition of an API stage named prod to a YAML file named stage-definition.yaml. The exported definition file includes API Gateway extensions by default.

aws apigatewayv2 export-api \
    --api-id a1b2c3d4 \
    --output-type YAML \
    --specification OAS30 \
    --stage-name prod \
    stage-definition.yaml

This command produces no output.

For more information, see Exporting an HTTP API from API Gateway in the Amazon API Gateway Developer Guide.

Output

body -> (blob)

Represents an exported definition of an API in a particular output format, for example, YAML. The API is serialized to the requested specification, for example, OpenAPI 3.0.