// Copyright 2018-2019 .
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


syntax = "proto3";
package vsperf;

service Controller {
  rpc HostConnect (HostInfo) returns (StatusReply) {}
  rpc VsperfInstall (HostInfo) returns (StatusReply) {}
  rpc TGenHostConnect (HostInfo) returns (StatusReply) {}
  rpc TGenInstall (HostVerInfo) returns (StatusReply) {}
  rpc TGenUploadConfigFile (stream ConfFile) returns (UploadStatus) {}
  rpc CollectdInstall (HostInfo) returns (StatusReply) {} 
  rpc CollectdUploadConfig (stream ConfFile) returns (UploadStatus) {}
  rpc DutHugepageConfig (HugepConf) returns (StatusReply) {}
  rpc CheckDependecies (HostInfo) returns (StatusReply) {}
  rpc UploadConfigFile (ConfFileTest) returns (UploadStatus) {}
  rpc StartTest (ControlVsperf) returns (StatusReply) {}
  rpc TestStatus (StatusQuery) returns (StatusReply) {}
  rpc StartTGen (ControlTGen) returns (StatusReply) {}
  rpc StartBeats (HostInfo) returns (StatusReply) {}
  rpc RemoveVsperf (HostInfo) returns (StatusReply) {}
  rpc RemoveResultFolder (HostInfo) returns (StatusReply) {}
  rpc RemoveUploadedConfig (HostInfo) returns (StatusReply) {}
  rpc RemoveCollectd (HostInfo) returns (StatusReply) {}
  rpc RemoveEverything (HostInfo) returns (StatusReply) {}
  rpc TerminateVsperf (HostInfo) returns (StatusReply) {}
  rpc SanityNICCheck (HostInfo) returns (StatusReply) {}
  rpc SanityCollectdCheck (HostInfo) returns (StatusReply) {}
  rpc SanityVNFpath (HostInfo) returns (StatusReply) {}
  rpc SanityVSPERFCheck (HostInfo) returns (StatusReply) {}
  rpc SanityTgenConnDUTCheck (HostInfo) returns (StatusReply) {}
  rpc SanityCPUAllocationCheck (HostInfo) returns (StatusReply) {}
  rpc DUTvsperfTestAvailability (HostInfo) returns (StatusReply) {}
  rpc GetVSPERFConffromDUT (HostInfo) returns (StatusReply) {}
}

message ControlVsperf {
  string testtype = 1;
  string conffile = 2;
}

message ControlTGen {
  string params = 1;
  string conffile = 2;
}

message LogDir {
  string directory = 1;
}

message ConfFile {
  bytes Content = 1;
}

message ConfFileTest {
  string Content = 1;
  string Filename = 2;
}

message HostInfo {
  string ip = 1;
  string uname = 2;
  string pwd = 3;
}

message HugepConf {
  string hpmax = 1;
  string hprequested = 2;
}

message HostVerInfo {
  string ip = 1;
  string uname = 2;
  string pwd = 3;
  string version = 4;
}

message StatusQuery {
  string testtype = 1;
}

message StatusReply {
  string message = 1;
}

enum UploadStatusCode {
    Unknown = 0;
    Ok = 1;
    Failed = 2;
}

message UploadStatus {
    string Message = 1;
    UploadStatusCode Code = 2;
}