Neutrino is minimalistic service discovery application.
branch | status |
---|---|
master | |
develop |
Neutrino provides API to manage registered services and K/V properties.
Version: v1
Authentication:
All endpoint's in API requires specify special token. Value of that token is set in appsettings.json. The same token have to be specify in HTTP request in headers section. If in appsettings.json we have that value:
{
"SecureToken": "0efd0f67-f641-427e-98eb-cd8a07e879c6",
}
in HTTP headers we have to send:
Authorization: SecureToken 0efd0f67-f641-427e-98eb-cd8a07e879c6
All request without token or with invalid token will be finished with status code: 401 (Unauthorized)
.
Summary: Returns all key-value properties.
Description: Endpoint returns all registered key-value properties.
Responses
Code | Description | Schema |
---|---|---|
200 | Success | [ KvProperty ] |
Summary: Creates new key-value property..
Description: Endpoint for creating new key-value property.
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
kvProperty | body | Key-value property. | No | KvProperty |
Responses
Code | Description | Schema |
---|---|---|
201 | Success | KvProperty |
400 | Bad Request |
Summary: Returns key-value item by key.
Description: Endpoint returns specific key-value property by key.
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
key | path | Key of item. | Yes | string |
Responses
Code | Description | Schema |
---|---|---|
200 | Success | KvProperty |
404 | Not Found |
Summary: Updates key-value property.
Description: Endpoint for updating key-value property.
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
key | path | Key-value property key to update. | Yes | string |
kvProperty | body | New key-value property. | No | KvProperty |
Responses
Code | Description |
---|---|
200 | Success |
400 | Bad Request |
404 | Not Found |
Summary: Deletes key-value property.
Description: Endpoint for deleting key-value property.
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
key | path | Key-value property key. | Yes | string |
Responses
Code | Description |
---|---|
200 | Success |
404 | Not Found |
Summary: Returns list of all defined nodes.
Description: Endpoint returns all nodes wich are registered in current node.
Responses
Code | Description | Schema |
---|---|---|
200 | Success | [ NodeInfo ] |
Summary: Returns current node information.
Description: Endpoint returns information about current node.
Responses
Code | Description | Schema |
---|---|---|
200 | Success | NodeInfo |
Summary: Returns current node state.
Description: Endpoint returns current node state. Node can be at one of following state:
- Follower,
- Candidate,
- Leader.
Responses
Code | Description |
---|---|
200 | Success |
Summary: Append log entries.
Description: Endpoint for appending log entries. It's alos used for heartbeats.
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
appendEntriesEvent | body | New log data. | No | AppendEntriesEvent |
Responses
Code | Description |
---|---|
200 | Success |
Summary: Voting for new leader.
Description: Endpoint is used during election new leader.
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
requestVoteEvent | body | Voting information. | No | RequestVoteEvent |
Responses
Code | Description |
---|---|
200 | Success |
Summary: Returns full log.
Description: Endpoint is used for retrieve full log from node.
Responses
Code | Description |
---|---|
200 | Success |
Summary: Returns all registered services.
Description: Endpoint returns all registered services.
Responses
Code | Description | Schema |
---|---|---|
200 | Success | [ Service ] |
Summary: Creates new service.
Description: Endpoint for registering new service information.
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
service | body | Service information. | No | Service |
Responses
Code | Description | Schema |
---|---|---|
201 | Success | Service |
400 | Bad Request |
Summary: Returns service by id.
Description: Endpoint returns specific service information.
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
serviceId | path | Service id. | Yes | string |
Responses
Code | Description | Schema |
---|---|---|
200 | Success | Service |
404 | Not Found |
Summary: Updates service information.
Description: Endpoint for updating service information.
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
serviceId | path | Service id to update. | Yes | string |
service | body | New service information. | No | Service |
Responses
Code | Description |
---|---|
200 | Success |
400 | Bad Request |
404 | Not Found |
Summary: Deletes service.
Description: Endpoint for deleting service.
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
serviceId | path | Service id. | Yes | string |
Responses
Code | Description |
---|---|
200 | Success |
404 | Not Found |
Summary: Returns service health.
Description: Endpoint returns all health information for specific service.
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
serviceId | path | Service id. | Yes | string |
Responses
Code | Description | Schema |
---|---|---|
200 | Success | [ ServiceHealth ] |
Summary: Returns current service health.
Description: Endpoint returns only current healt status for specific endpoint.
Parameters
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
serviceId | path | Service id. | Yes | string |
Responses
Code | Description | Schema |
---|---|---|
200 | Success | ServiceHealth |
Name | Type | Description | Required |
---|---|---|---|
key | string | No | |
value | string | No | |
createdDate | dateTime | No |
Name | Type | Description | Required |
---|---|---|---|
id | string | No | |
name | string | No | |
address | string | No | |
tags | object | No |
Name | Type | Description | Required |
---|---|---|---|
term | integer | No | |
leaderNode | NodeInfo | No | |
entries | [ Entry ] | No |
Name | Type | Description | Required |
---|---|---|---|
objectType | string | No | |
method | integer | No | |
value | object | No |
Name | Type | Description | Required |
---|---|---|---|
term | integer | No | |
node | NodeInfo | No |
Name | Type | Description | Required |
---|---|---|---|
serviceType | string | No | |
address | string | No | |
tags | [ string ] | No | |
healthCheck | HealthCheck | No | |
id | string | No | |
createdDate | dateTime | No |
Name | Type | Description | Required |
---|---|---|---|
healthCheckType | integer | No | |
address | string | No | |
interval | integer | No | |
deregisterCriticalServiceAfter | integer | No |
Name | Type | Description | Required |
---|---|---|---|
healthState | integer | No | |
statusCode | integer | No | |
responseMessage | string | No | |
serviceId | string | No | |
id | string | No | |
createdDate | dateTime | No |