Admin Endpoints

EventNative has system endpoints for admins. For using it you should configure admin authorization.

server:
admin_token: your_admin_token

Put admin token to HTTP requests in X-Admin-Token header.

post
Destinations test connection

https://instance.com/api/v1/destinations/test
Request
Response
Request
Headers
X-Admin-Token
required
string
admin token authorization
Response
200: OK
Connection successfully tested.
400: Bad Request
Connection was failed with a reason message
{
"message": "pq: database \"my-db\" does not exist"
}
401: Unauthorized
Response body contains error message
{
"message": "admin_token must be configured"
}
or
{
"message": "Admin token does not match"
}

JSON body has the same structure as EventNative destination configuration. For example Postgres:

{
"type": "postgres",
"datasource": {
"host": "my_postgres_host",
"db": "my-db",
"schema": "myschema",
"port": 5432,
"username": "user",
"password": "pass",
"parameters": {}
}
}

get
Cluster information

https://instance.com/api/v1/cluster
If synchronization service is configured, this endpoint returns all instances, otherwise only server.name from the configuration.
Request
Response
Request
Headers
X-Admin-Token
required
string
admin token authorization
Response
200: OK
Response body contains instance names (from server.name configuration section)
{
"instances": [
{
"name": "instance1.domain.com"
},
{
"name": "instance2.domain.com"
}
]
}
400: Bad Request
Response body contains error message if request failed.
{
"message": "error getting cluster information: ..."
}
401: Unauthorized
Response body contains error message
{
"message": "admin_token must be configured"
}
or
{
"message": "Admin token does not match"
}

get
Fallback files

https://instance.com/api/v1/fallback?destination_ids=id1,id2
Get all fallback files with not stored events per destination.
Request
Response
Request
Headers
X-Admin-Token
required
string
admin token authorization
Query Parameters
destination_id
optional
array
comma-separated array of destination ids strings
Response
200: OK
Response body contains files
{
"files": [
{
"file_name": "host-errors-destination1-2020-11-25T09-57-10.411.log",
"destination_id": "destination1",
"uploaded": false,
// error - replaying error
"error": "Error uploading host-errors-destination1-2020-11-25T09-57-10.411.log wrong format"
}
}
401: Unauthorized
Response body contains error message
{
"message": "admin_token must be configured"
}
or
{
"message": "Admin token does not match"
}

post
Replay fallback events file

https://instance.com/api/v1/fallback/replay
Store fallback events from file into the destination.
Request
Response
Request
Headers
X-Admin-Token
required
string
admin token authorization
Body Parameters
file_name
required
string
name of a fallback file to replay
Response
200: OK
Response body contains status ok
{
"status": "ok"
}
400: Bad Request
Response body contains error message
{
"message": "Failed to replay file: host-errors-d1-2020-11-25T09-57-10.411.log",
"error": "File name can't be empty"
}
401: Unauthorized
Response body contains error message
{
"message": "admin_token must be configured"
}
or
{
"message": "Admin token does not match"
}

Request JSON body example:

{
"file_name": "hostname-destination1-2020-11-25T09-57-10.411.log"
}