Jump to Content

This API Documentation is now deprecated

We are excited to announce our new API Documentation.

Class UpdateApiCommandProtected

Updates an Api resource.

Example

Use a bare-bones client and the command you need to make an API call.

import { ApiGatewayV2Client, UpdateApiCommand } from "@aws-sdk/client-apigatewayv2"; // ES Modules import
// const { ApiGatewayV2Client, UpdateApiCommand } = require("@aws-sdk/client-apigatewayv2"); // CommonJS import
const client = new ApiGatewayV2Client(config);
const input = { // UpdateApiRequest
ApiId: "STRING_VALUE", // required
ApiKeySelectionExpression: "STRING_VALUE",
CorsConfiguration: { // Cors
AllowCredentials: true || false,
AllowHeaders: [ // CorsHeaderList
"STRING_VALUE",
],
AllowMethods: [ // CorsMethodList
"STRING_VALUE",
],
AllowOrigins: [ // CorsOriginList
"STRING_VALUE",
],
ExposeHeaders: [
"STRING_VALUE",
],
MaxAge: Number("int"),
},
CredentialsArn: "STRING_VALUE",
Description: "STRING_VALUE",
DisableSchemaValidation: true || false,
DisableExecuteApiEndpoint: true || false,
Name: "STRING_VALUE",
RouteKey: "STRING_VALUE",
RouteSelectionExpression: "STRING_VALUE",
Target: "STRING_VALUE",
Version: "STRING_VALUE",
};
const command = new UpdateApiCommand(input);
const response = await client.send(command);
// { // UpdateApiResponse
// ApiEndpoint: "STRING_VALUE",
// ApiGatewayManaged: true || false,
// ApiId: "STRING_VALUE",
// ApiKeySelectionExpression: "STRING_VALUE",
// CorsConfiguration: { // Cors
// AllowCredentials: true || false,
// AllowHeaders: [ // CorsHeaderList
// "STRING_VALUE",
// ],
// AllowMethods: [ // CorsMethodList
// "STRING_VALUE",
// ],
// AllowOrigins: [ // CorsOriginList
// "STRING_VALUE",
// ],
// ExposeHeaders: [
// "STRING_VALUE",
// ],
// MaxAge: Number("int"),
// },
// CreatedDate: new Date("TIMESTAMP"),
// Description: "STRING_VALUE",
// DisableSchemaValidation: true || false,
// DisableExecuteApiEndpoint: true || false,
// ImportInfo: [ // __listOf__string
// "STRING_VALUE",
// ],
// Name: "STRING_VALUE",
// ProtocolType: "WEBSOCKET" || "HTTP",
// RouteSelectionExpression: "STRING_VALUE",
// Tags: { // Tags
// "<keys>": "STRING_VALUE",
// },
// Version: "STRING_VALUE",
// Warnings: [
// "STRING_VALUE",
// ],
// };

Param

UpdateApiCommandInput

Returns

UpdateApiCommandOutput

See

Throws

BadRequestException (client fault)

The request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.

Throws

ConflictException (client fault)

The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. See the accompanying error message for details.

Throws

NotFoundException (client fault)

The resource specified in the request was not found. See the message field for more information.

Throws

TooManyRequestsException (client fault)

A limit has been exceeded. See the accompanying error message for details.

Throws

ApiGatewayV2ServiceException

Base exception class for all service exceptions from ApiGatewayV2 service.

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

Methods