Class WebSocketApi
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.apigatewayv2.WebSocketApi
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,IApi
,IWebSocketApi
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:43.338Z")
@Stability(Experimental)
public class WebSocketApi
extends Resource
implements IWebSocketApi, IApi
(experimental) Create a new API Gateway WebSocket API endpoint.
Example:
import software.amazon.awscdk.services.apigatewayv2.integrations.WebSocketLambdaIntegration; Function messageHandler; WebSocketApi webSocketApi = new WebSocketApi(this, "mywsapi"); webSocketApi.addRoute("sendmessage", WebSocketRouteOptions.builder() .integration(new WebSocketLambdaIntegration("SendMessageIntegration", messageHandler)) .build());
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
(experimental) A fluent builder forWebSocketApi
.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.apigatewayv2.IApi
IApi.Jsii$Default, IApi.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.apigatewayv2.IWebSocketApi
IWebSocketApi.Jsii$Default, IWebSocketApi.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionprotected
WebSocketApi
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
WebSocketApi
(software.amazon.jsii.JsiiObjectRef objRef) WebSocketApi
(software.constructs.Construct scope, String id) WebSocketApi
(software.constructs.Construct scope, String id, WebSocketApiProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddRoute
(String routeKey, WebSocketRouteOptions options) (experimental) Add a new route.static IWebSocketApi
fromWebSocketApiAttributes
(software.constructs.Construct scope, String id, WebSocketApiAttributes attrs) (experimental) Import an existing WebSocket API into this CDK app.(experimental) The default endpoint for an API.getApiId()
(experimental) The identifier of this API Gateway API.(experimental) A human friendly name for this WebSocket API.grantManageConnections
(IGrantable identity) (experimental) Grant access to the API Gateway management API for this WebSocket API to an IAM principal (Role/Group/User).(experimental) Return the given named metric for this Api Gateway.metric
(String metricName, MetricOptions props) (experimental) Return the given named metric for this Api Gateway.Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.constructs.Construct
toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
WebSocketApi
protected WebSocketApi(software.amazon.jsii.JsiiObjectRef objRef) -
WebSocketApi
protected WebSocketApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
WebSocketApi
@Stability(Experimental) public WebSocketApi(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable WebSocketApiProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
-
-
WebSocketApi
@Stability(Experimental) public WebSocketApi(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.
-
-
Method Details
-
fromWebSocketApiAttributes
@Stability(Experimental) @NotNull public static IWebSocketApi fromWebSocketApiAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull WebSocketApiAttributes attrs) (experimental) Import an existing WebSocket API into this CDK app.- Parameters:
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.
-
addRoute
@Stability(Experimental) @NotNull public WebSocketRoute addRoute(@NotNull String routeKey, @NotNull WebSocketRouteOptions options) (experimental) Add a new route.- Parameters:
routeKey
- This parameter is required.options
- This parameter is required.
-
grantManageConnections
(experimental) Grant access to the API Gateway management API for this WebSocket API to an IAM principal (Role/Group/User).- Parameters:
identity
- The principal. This parameter is required.
-
metric
@Stability(Experimental) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props) (experimental) Return the given named metric for this Api Gateway. -
metric
(experimental) Return the given named metric for this Api Gateway. -
getApiEndpoint
(experimental) The default endpoint for an API.- Specified by:
getApiEndpoint
in interfaceIApi
-
getApiId
(experimental) The identifier of this API Gateway API. -
getWebSocketApiName
(experimental) A human friendly name for this WebSocket API.Note that this is different from
webSocketApiId
.
-