create_rest_api
async
¶
create_rest_api(
name: String,
*,
config_overrides: Optional[AsyncAPIGatewayClientConfig] = None,
description: Optional[String] = None,
version: Optional[String] = None,
clone_from: Optional[String] = None,
binary_media_types: Optional[ListOfString] = None,
minimum_compression_size: Optional[NullableInteger] = None,
api_key_source: Optional[ApiKeySourceType] = None,
endpoint_configuration: Optional[EndpointConfiguration] = None,
policy: Optional[String] = None,
tags: Optional[MapOfStringToString] = None,
disable_execute_api_endpoint: Optional[Boolean] = None,
security_policy: Optional[SecurityPolicy] = None,
endpoint_access_mode: Optional[EndpointAccessMode] = None,
) -> RestApi
Creates a new RestApi resource.
Parameters:
-
name(String) –The name of the RestApi.
-
description(Optional[String], default:None) –The description of the RestApi.
-
version(Optional[String], default:None) –A version identifier for the API.
-
clone_from(Optional[String], default:None) –The ID of the RestApi that you want to clone from.
-
binary_media_types(Optional[ListOfString], default:None) –The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
-
minimum_compression_size(Optional[NullableInteger], default:None) –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(Optional[ApiKeySourceType], default:None) –The source of the API key for metering requests according to a usage plan. Valid values are:
HEADERto read the API key from theX-API-Keyheader of a request.AUTHORIZERto read the API key from theUsageIdentifierKeyfrom a custom authorizer. -
endpoint_configuration(Optional[EndpointConfiguration], default:None) –The endpoint configuration of this RestApi showing the endpoint types and IP address types of the API.
-
policy(Optional[String], default:None) –A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
-
tags(Optional[MapOfStringToString], default:None) –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(Optional[Boolean], default:None) –Specifies whether clients can invoke your API by using the default
execute-apiendpoint. By default, clients can invoke your API with the defaulthttps://{api_id}.execute-api.{region}.amazonaws.comendpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint -
security_policy(Optional[SecurityPolicy], default:None) –The Transport Layer Security (TLS) version + cipher suite for this RestApi.
-
endpoint_access_mode(Optional[EndpointAccessMode], default:None) –The endpoint access mode of the RestApi. Only available for RestApis that use security policies that start with
SecurityPolicy_.
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.
-
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.
Source code in docs_src/capo_api_gateway/_services/async_api_gateway.py
1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 | |