import_rest_api
async
¶
import_rest_api(
body: Blob,
*,
config_overrides: Optional[AsyncAPIGatewayClientConfig] = None,
fail_on_warnings: Optional[Boolean] = None,
parameters: Optional[MapOfStringToString] = None,
) -> RestApi
A feature of the API Gateway control service for creating a new API from an external API definition file.
Parameters:
-
fail_on_warnings(Optional[Boolean], default:None) –A query parameter to indicate whether to rollback the API creation (
true) or not (false) when a warning is encountered. The default value isfalse. -
parameters(Optional[MapOfStringToString], default:None) –A key-value map of context-specific query string parameters specifying the behavior of different API importing operations. The following shows operation-specific parameters and their supported values.
To exclude DocumentationParts from the import, set
parametersasignore=documentation.To configure the endpoint type, set
parametersasendpointConfigurationTypes=EDGE,endpointConfigurationTypes=REGIONAL, orendpointConfigurationTypes=PRIVATE. The default endpoint type isEDGE.To handle imported
basepath, setparametersasbasepath=ignore,basepath=prependorbasepath=split. -
body(Blob) –The POST request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.
Raises:
-
BadRequestException–The submitted request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.
-
ConflictException–The request configuration has conflicts. For details, see the accompanying error message.
-
LimitExceededException–The request exceeded the rate limit. Retry after the specified time period.
-
NotFoundException–The requested resource is not found. Make sure that the request URI is correct.
-
TooManyRequestsException–The request has reached its throttling limit. Retry after the specified time period.
-
UnauthorizedException–The request is denied because the caller has insufficient permissions.
-
UnknownServiceError–The service returned an error code this client does not model.