@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:46.282Z") 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 . |
IWebSocketApi.Jsii$Default, IWebSocketApi.Jsii$Proxy
Modifier | Constructor and Description |
---|---|
protected |
WebSocketApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
WebSocketApi(software.amazon.jsii.JsiiObjectRef objRef) |
|
WebSocketApi(software.constructs.Construct scope,
java.lang.String id) |
|
WebSocketApi(software.constructs.Construct scope,
java.lang.String id,
WebSocketApiProps props) |
Modifier and Type | Method and Description |
---|---|
WebSocketRoute |
addRoute(java.lang.String routeKey,
WebSocketRouteOptions options)
(experimental) Add a new route.
|
static IWebSocketApi |
fromWebSocketApiAttributes(software.constructs.Construct scope,
java.lang.String id,
WebSocketApiAttributes attrs)
(experimental) Import an existing WebSocket API into this CDK app.
|
java.lang.String |
getApiEndpoint()
(experimental) The default endpoint for an API.
|
java.lang.String |
getApiId()
(experimental) The identifier of this API Gateway API.
|
java.lang.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(java.lang.String metricName)
(experimental) Return the given named metric for this Api Gateway.
|
Metric |
metric(java.lang.String metricName,
MetricOptions props)
(experimental) Return the given named metric for this Api Gateway.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyRemovalPolicy, getEnv, getStack
getNode
protected WebSocketApi(software.amazon.jsii.JsiiObjectRef objRef)
protected WebSocketApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public WebSocketApi(software.constructs.Construct scope, java.lang.String id, WebSocketApiProps props)
scope
- This parameter is required.id
- This parameter is required.props
- public WebSocketApi(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.public static IWebSocketApi fromWebSocketApiAttributes(software.constructs.Construct scope, java.lang.String id, WebSocketApiAttributes attrs)
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.public WebSocketRoute addRoute(java.lang.String routeKey, WebSocketRouteOptions options)
routeKey
- This parameter is required.options
- This parameter is required.public Grant grantManageConnections(IGrantable identity)
identity
- The principal. This parameter is required.public Metric metric(java.lang.String metricName, MetricOptions props)
public Metric metric(java.lang.String metricName)
public java.lang.String getApiEndpoint()
getApiEndpoint
in interface IApi
public java.lang.String getApiId()
public java.lang.String getWebSocketApiName()
Note that this is different from webSocketApiId
.