Find the full Open API spec here. Use go-swagger to view as HTML:
swagger serve -F=swagger swagger.yaml
EARS supports multi-tenancy and is therefore suitable to be offered as a service. This means, before you can create a route for a tenant, you must create that tenant with a valid tenant configuration. A tenant is a two-dimensional structure consisting of an org ID and an application ID. Currently, the only required configuration for a tenant is its event throughput quota in events per second. EARS will then enforce rate limiting accordingly, provided the rate limit feature is turned on in ears.yaml.
Example tenant configuration:
{
"quota": {
"eventsPerSec": 100
}
}
GET /ears/v1/orgs/{orgId}/applications/{appId}/config
PUT /ears/v1/orgs/{orgId}/applications/{appId}/config {tenantBody}
DELETE /ears/v1/orgs/{orgId}/applications/{appId}/config
Example route configuration:
{
"id": "ks1",
"userId": "boris",
"name": "kafkaSqsRoute",
"receiver": {
"plugin": "kafka",
"name": "kafkaSqsReceiver",
"config": {
"brokers": "localhost:9092",
"topic": "ears-kafka-test",
"groupId": "mygroup"
}
},
"sender": {
"plugin": "sqs",
"name": "kafkaSqsSender",
"config": {
"queueUrl": "https://sqs.us-west-2.amazonaws.com/{accountId}/ears-sqs-test"
}
},
"deliveryMode": ""
}
The above example directly connects a Kafka topic called ears-kafka-test to an SQS queue called ears-sqs-test. Notice that no filter chain is configured in this example so all events received from Kafka will be routed to SQS unmodified and unfiltered. Notice that the route has an ID and an optional name field. The ID must match the ID given in a PUT call or be blank. When no ID is given in a POST call a random route ID will be generated for you and returned with the API response. The deliveryMode field is currently unused.
GET /ears/v1/orgs/{orgId}/applications/{appId}/routes/{routeId}
PUT /ears/v1/orgs/{orgId}/applications/{appId}/routes/{routeId} {routeBody}
DELETE /ears/v1/orgs/{orgId}/applications/{appId}/routes/{routeId}
POST /ears/v1/orgs/{orgId}/applications/{appId}/routes {routeBody}
GET /ears/v1/orgs/{orgId}/applications/{appId}/routes
POST /ears/v1/orgs/{orgId}/applications/{appId}/routes/{routeId}/event {eventBody}
Get all routes across all tenants.
GET /ears/v1/routes
Get all tenant configurations.
GET /ears/v1/tenants
Get all sender plugins configurations across all routes and all tenants. A reference count is given in the response to indicate by how many routes this plugin is shared.
GET /ears/v1/senders
Get all receiver plugins configurations across all routes and all tenants. A reference count is given in the response to indicate by how many routes this plugin is shared.
GET /ears/v1/receivers
Get all filter plugins configurations across all routes and all tenants. A reference count is given in the response to indicate by how many routes this plugin is shared.
GET /ears/v1/filters