syntax = "proto3";

package kubevirt.cmd.v1;
option go_package = "v1";

service Cmd {
  rpc SyncVirtualMachine(VMIRequest) returns (Response) {}
  rpc PauseVirtualMachine(VMIRequest) returns (Response) {}
  rpc UnpauseVirtualMachine(VMIRequest) returns (Response) {}
  rpc ShutdownVirtualMachine(VMIRequest) returns (Response) {}
  rpc KillVirtualMachine(VMIRequest) returns (Response) {}
  rpc DeleteVirtualMachine(VMIRequest) returns (Response) {}
  rpc MigrateVirtualMachine(MigrationRequest) returns (Response) {}
  rpc SyncMigrationTarget(VMIRequest) returns (Response) {}
  rpc CancelVirtualMachineMigration(VMIRequest) returns (Response) {}
  rpc SignalTargetPodCleanup(VMIRequest) returns (Response) {}
  rpc FinalizeVirtualMachineMigration(VMIRequest) returns (Response) {}
  rpc GetDomain(EmptyRequest) returns (DomainResponse) {}
  rpc GetDomainStats(EmptyRequest) returns (DomainStatsResponse) {}
  rpc GetGuestInfo(EmptyRequest) returns (GuestInfoResponse) {}
  rpc GetUsers(EmptyRequest) returns (GuestUserListResponse) {}
  rpc GetFilesystems(EmptyRequest) returns (GuestFilesystemsResponse) {}
  rpc Ping(EmptyRequest) returns (Response) {}
}

message VMI {
  bytes vmiJson = 1;
}

message SMBios {
  string manufacturer = 1;
  string product = 2;
  string version = 3;
  string sku = 4;
  string family = 5;
}

message VirtualMachineOptions {
  SMBios VirtualMachineSMBios = 1;
  uint32 MemBalloonStatsPeriod = 2;
  repeated string PreallocatedVolumes = 3;
}

message VMIRequest {
  VMI vmi = 1;
  VirtualMachineOptions options = 2;
}

message MigrationRequest {
  VMI vmi = 1;
  bytes options = 2;
}

message EmptyRequest {}

message Response {
  bool success = 1;
  string message = 2;
}

message DomainResponse {
  Response response = 1;
  string domain = 2;
}

message DomainStatsResponse {
  Response response = 1;
  string domainStats = 2;
}

message GuestInfoResponse {
  Response response = 1;
  string guestInfoResponse = 2;
}

message GuestUserListResponse {
  Response response = 1;
  string guestUserListResponse = 2;
}

message GuestFilesystemsResponse {
  Response response = 1;
  string guestFilesystemsResponse = 2;
}
