Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 3 | option go_package = "github.com/opencord/voltha-protos/v5/go/health"; |
| 4 | option java_package = "org.opencord.voltha.health"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 5 | |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 6 | package health; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 7 | |
| 8 | import "google/api/annotations.proto"; |
| 9 | import "google/protobuf/empty.proto"; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 10 | |
| 11 | // Encode health status of a Voltha instance |
| 12 | message HealthStatus { |
| 13 | |
| 14 | // Health states |
| 15 | enum HealthState { |
| 16 | HEALTHY = 0; // The instance is healthy |
| 17 | OVERLOADED = 1; // The instance is overloaded, decrease query rate |
| 18 | DYING = 2; // The instance is in a critical condition, do not use it |
| 19 | } |
| 20 | |
| 21 | // Current state of health of this Voltha instance |
khenaidoo | 4c6543e | 2021-10-19 17:25:58 -0400 | [diff] [blame] | 22 | HealthState state = 1 ; |
Zack Williams | 5220966 | 2019-02-07 10:15:31 -0700 | [diff] [blame] | 23 | } |
| 24 | |
| 25 | // Health related services |
| 26 | service HealthService { |
| 27 | |
| 28 | // Return current health status of a Voltha instance |
| 29 | rpc GetHealthStatus(google.protobuf.Empty) returns (HealthStatus) { |
| 30 | option (google.api.http) = { |
| 31 | get: "/health" |
| 32 | }; |
| 33 | } |
| 34 | |
| 35 | } |
| 36 | |