syntax="proto3";

option go_package = "./proto";
package deevirt;

// The greeting service definition.
service Domain {
  rpc Event (DomainEventRequest) returns (DomainEventResponse) {}

  rpc List (DomainListAllRequest) returns (DomainListAllResponse) {}
  rpc Get (DomainListRequest) returns (DomainListResponse) {}
  rpc Create (DomainCreateRequest) returns (DomainCreateResponse) {}
  rpc Update (DomainUpdateRequest) returns (DomainUpdateResponse) {}
  rpc Delete (DomainDeleteRequest) returns (DomainDeleteResponse) {}

  rpc Power (DomainPowerRequest) returns (DomainPowerResponse) {}

}

message DomainEventRequest {
  bytes event = 1;
}

message DomainEventResponse {}

message DomainListAllRequest {}

message DomainListAllResponse {
  repeated DomainListResponse domains = 1;
}

message DomainListRequest {
  string domain_id = 1;
}

message DomainListResponse {
  string domain_id = 1;
  string config = 2;
  int64 state = 3;
}

message DomainCreateRequest {
  string node_id = 1;
  string config = 2;
}

message DomainCreateResponse {
  int64 progress = 1;
}

service DomainDevicesGraphics {
  rpc Console (DomainDevicesGraphicsConsoleRequest) returns (DomainDevicesGraphicsConsoleResponse) {}
}



message DomainUpdateRequest {
  string vm_id = 1;
}

message DomainUpdateResponse {
}

message DomainDeleteRequest {
  string vm_id = 1;
}

message DomainDeleteResponse {
}

enum DomainPower {
  UNDEFINED = 0;
  START = 1;
  REBOOT = 2;
  SHUTDOWN = 3;
  PAUSE = 4;
  RESUME = 5;
  RESET = 6;
  DESTROY = 7;
}

message DomainPowerRequest {
  bytes vm_id = 1;
  DomainPower action = 2;
}

message DomainPowerResponse {
}

message DomainDevicesGraphicsConsoleRequest {
  bytes vm_id = 1;
}

message DomainDevicesGraphicsConsoleResponse {
  string uri = 1;
}


