Checking status of connection

CLI

https://docs.aws.amazon.com/cli/latest/reference/apigatewaymanagementapi/get-connection.html

aws apigatewaymanagementapi get-connection \
    --connection-id c4lbndwAIAMCFHA= \
    --endpoint-url https://1rz9jj0did.execute-api.us-east-1.amazonaws.com/gitpod

Node SDK

https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-apigatewaymanagementapi/classes/getconnectioncommand.html

https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-apigatewaymanagementapi/interfaces/getconnectioncommandinput.html

AwsSocket

static clientEndpoint = `https://${process.env.SOCKETS_API_URL_DEV || process.env.SOCKETS_API_URL
    }`;

  static client = new ApiGatewayManagementApiClient({
    region: "us-east-1",
    endpoint: AwsSocket.clientEndpoint,
  });
static checkConnectionStatus = async (connectionId) => {
    try {
      const command = new GetConnectionCommand({ ConnectionId: connectionId });
      const response = await AwsSocket.client.send(command);
      return response;
    } catch (e) {
      ti(e);
    }
  }

Leave a Reply

Your email address will not be published.