WSGateway REST Api (1.0.0.alpha)

Download OpenAPI specification:Download

WSGateway configuration REST Api Spec

Endpoints

Api's used to configure gateway endpoints

Get all the endpoints

Responses

200

Successful operation

401

Unauthorized

500

Internal Server Error

get/api/internal/endpoints

Local

http://localhost:8080/api/internal/endpoints

Your server url

http://{serverUrl}/api/internal/endpoints

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Create new endpoint

Request Body schema: application/json

All configuration details used by Gateway for one endpoint

path
required
string [ 2 .. 255 ] characters ^(?!\/api\/internal).*

The url path used to by the user to establish a WebSocket connection

settings
object

General settings used used by the gateway

authentication
object

Authentification details

filters
object
routes
Array of objects (Route) <= 255 items

A set of routes

Responses

201

Successful operation

400

Bad Request

401

Unauthorized

500

Internal Server Error

post/api/internal/endpoints

Local

http://localhost:8080/api/internal/endpoints

Your server url

http://{serverUrl}/api/internal/endpoints

Request samples

Content type
application/json
Loading...

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "path": "/ws/chat",
  • "settings":
    {
    },
  • "authentication":
    {
    },
  • "filters":
    {
    },
  • "routes":
    [
    ]
}

Get endpoint by id

Get single endoint

path Parameters
endpointId
required
string

Id of the endpoint

Responses

200

Successful operation

401

Unauthorized

404

The specified resource was not found

500

Internal Server Error

get/api/internal/endpoints/{endpointId}

Local

http://localhost:8080/api/internal/endpoints/{endpointId}

Your server url

http://{serverUrl}/api/internal/endpoints/{endpointId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "path": "/ws/chat",
  • "settings":
    {
    },
  • "authentication":
    {
    },
  • "filters":
    {
    },
  • "routes":
    [
    ]
}

Update an endpoint

Update an endpoint

path Parameters
endpointId
required
string

Id of the endpoint

Request Body schema: application/json

All configuration details used by Gateway for one endpoint

path
required
string [ 2 .. 255 ] characters ^(?!\/api\/internal).*

The url path used to by the user to establish a WebSocket connection

settings
object

General settings used used by the gateway

authentication
object

Authentification details

filters
object
routes
Array of objects (Route) <= 255 items

A set of routes

Responses

200

Successful operation

400

Invalid endpoint

401

Unauthorized

404

The specified resource was not found

500

Internal Server Error

put/api/internal/endpoints/{endpointId}

Local

http://localhost:8080/api/internal/endpoints/{endpointId}

Your server url

http://{serverUrl}/api/internal/endpoints/{endpointId}

Request samples

Content type
application/json
Loading...

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "string",
  • "path": "/ws/chat",
  • "settings":
    {
    },
  • "authentication":
    {
    },
  • "filters":
    {
    },
  • "routes":
    [
    ]
}

Delete endpoint

Delete endpoint by id

path Parameters
endpointId
required
string

Id of the endpoint

Responses

204

Successful operation

401

Unauthorized

404

The specified resource was not found

500

Internal Server Error

delete/api/internal/endpoints/{endpointId}

Local

http://localhost:8080/api/internal/endpoints/{endpointId}

Your server url

http://{serverUrl}/api/internal/endpoints/{endpointId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "Bad Request",
  • "errorType": "ConstraintViolation",
  • "message": "Some Exception Mesage",
  • "timestamp": 1582454804000,
  • "errors":
    [
    ]
}

Connections

Api's used for various operations on active web socket connections

Send event to user

Send a json event to the end user through the websocket connection

path Parameters
connectionId
required
string

Websocket connection id

Request Body schema: application/json

The json event to be sent

Responses

202

successful operation

400

Bad Request

401

Unauthorized

500

Internal Server Error

post/api/internal/connections/{connectionId}

Local

http://localhost:8080/api/internal/connections/{connectionId}

Your server url

http://{serverUrl}/api/internal/connections/{connectionId}

Request samples

Content type
application/json
Copy
Expand all Collapse all
{ }

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "status": "Bad Request",
  • "errorType": "ConstraintViolation",
  • "message": "Some Exception Mesage",
  • "timestamp": 1582454804000,
  • "errors":
    [
    ]
}

Health

Health check api's

Get gateway heatlh

Responses

200

Gateway is healthy

503

Gateway is un healthy

get/health

Local

http://localhost:8080/health

Your server url

http://{serverUrl}/health

Response samples

Content type
application/json
Copy
Expand all Collapse all
[
  • {
    }
]

Endpoint Model

id
string
path
required
string [ 2 .. 255 ] characters ^(?!\/api\/internal).*

The url path used to by the user to establish a WebSocket connection

settings
object

General settings used used by the gateway

authentication
object

Authentification details

filters
object
routes
Array of objects (Route) <= 255 items

A set of routes

Copy
Expand all Collapse all
{
  • "id": "string",
  • "path": "/ws/chat",
  • "settings":
    {
    },
  • "authentication":
    {
    },
  • "filters":
    {
    },
  • "routes":
    [
    ]
}

Route Model

type
required
string
Enum: "connect" "disconnect" "default" "custom"

Type of the route

name
required
string [ 4 .. 255 ] characters

The name of the route. Within an endpoint pair (name, type) is unique

backends
Array of objects <= 10 items

Set of http and kafka backends to forward inbound events for current route

expression
object Nullable

Expression to be evaluated against the inbound event. For custom routes the expression is mandatory

Copy
Expand all Collapse all
{
  • "type": "connect",
  • "name": "Connect Route",
  • "backends":
    [
    ],
  • "expression":
    {
    }
}

Error Model

status
string

Http status code phrase

errorType
string

Type of the error

message
string

Message error

timestamp
integer

Timestamp in milliseconds when error occurred

errors
Array of strings

List of aditional erorr messages(causes)

Copy
Expand all Collapse all
{
  • "status": "Bad Request",
  • "errorType": "ConstraintViolation",
  • "message": "Some Exception Mesage",
  • "timestamp": 1582454804000,
  • "errors":
    [
    ]
}

Health Model

Array
status
string
Enum: "UP" "DOWN" "UNKNOWN"

Gateway statys

components
Array of objects

Gateway health status by each component

Copy
Expand all Collapse all
[
  • {
    }
]