// https://git-aws.internal.justin.tv/vidops/shimmy#interaction

syntax = "proto3";

package code_justin_tv.rhys.nursery.ext.shimmy.v1;
option go_package = "shimmy_v1";

import "google/api/annotations.proto";

service Shimmy {
  rpc ValidateHealth (ValidateHealthRequest) returns (ValidateHealthResponse) {
    option (google.api.http) = { get: "/api/v1/validate/health/{host_name}" };
  }
  rpc ValidateDrained (ValidateDrainedRequest) returns (ValidateDrainedResponse) {
    option (google.api.http) = { get: "/api/v1/validate/drained/{host_name}" };
  }
}

message ValidateHealthRequest {
  string host_name = 1;
}

message ValidateHealthResponse {
  string host_name = 1;
  string oper_state = 2;
  string admin_state = 3;
  repeated ServiceHealth service_data = 4;
}

message ServiceHealth {
  string service_name = 1;
  string state = 2;
  int32 time_since_last_state_change = 3;
  bool downtimed = 4;
}

message ValidateDrainedRequest {
  string host_name = 1;
}

message ValidateDrainedResponse {
  string host_name = 1;
  string oper_state = 2;
  string admin_state = 3;
  // There's a service_data field as well; what is its type?
}
