@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-07T23:46:59.871Z") @Stability(value=Experimental) public class WebSocketApi extends Resource implements IWebSocketApi, IApi
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());
| Modifier and Type | Class and Description |
|---|---|
static class |
WebSocketApi.Builder
(experimental) A fluent builder for
WebSocketApi. |
software.amazon.jsii.JsiiObject.InitializationModeIWebSocketApi.Jsii$Default, IWebSocketApi.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
WebSocketApi(software.constructs.Construct scope,
String id) |
|
WebSocketApi(software.constructs.Construct scope,
String id,
WebSocketApiProps props) |
protected |
WebSocketApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
WebSocketApi(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
WebSocketRoute |
addRoute(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.
|
String |
getApiEndpoint()
(experimental) The default endpoint for an API.
|
String |
getApiId()
(experimental) The identifier of this API Gateway API.
|
String |
getWebSocketApiName()
(experimental) A human friendly name for this WebSocket API.
|
Grant |
grantManageConnections(IGrantable identity)
(experimental) Grant access to the API Gateway management API for this WebSocket API to an IAM principal (Role/Group/User).
|
Metric |
metric(String metricName)
(experimental) Return the given named metric for this Api Gateway.
|
Metric |
metric(String metricName,
MetricOptions props)
(experimental) Return the given named metric for this Api Gateway.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResourcegetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validatejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackgetNodeprotected WebSocketApi(software.amazon.jsii.JsiiObjectRef objRef)
protected WebSocketApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental)
public WebSocketApi(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
WebSocketApiProps props)
scope - This parameter is required.id - This parameter is required.props - @Stability(value=Experimental)
public WebSocketApi(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - This parameter is required.id - This parameter is required.@Stability(value=Experimental) @NotNull public static IWebSocketApi fromWebSocketApiAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull WebSocketApiAttributes attrs)
scope - This parameter is required.id - This parameter is required.attrs - This parameter is required.@Stability(value=Experimental) @NotNull public WebSocketRoute addRoute(@NotNull String routeKey, @NotNull WebSocketRouteOptions options)
routeKey - This parameter is required.options - This parameter is required.@Stability(value=Experimental) @NotNull public Grant grantManageConnections(@NotNull IGrantable identity)
identity - The principal. This parameter is required.@Stability(value=Experimental) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
@Stability(value=Experimental) @NotNull public Metric metric(@NotNull String metricName)
@Stability(value=Experimental) @NotNull public String getApiEndpoint()
getApiEndpoint in interface IApi@Stability(value=Experimental) @NotNull public String getApiId()
@Stability(value=Experimental) @Nullable public String getWebSocketApiName()
Note that this is different from webSocketApiId.
Copyright © 2022. All rights reserved.