syntax = “proto3”;

import public “google/protobuf/empty.proto”;

package cloudkeeper_grpc;

message Appliance {

string identifier = 1;
string title = 2;
string description = 3;
string mpuri = 4;
string group = 5;
int64 ram = 6;
int32 core = 7;
string version = 8;
string architecture = 9;
string operating_system = 10;
string vo = 11;
int64 expiration_date = 12;
string image_list_identifier = 13;
string base_mpuri = 14;
string appid = 15;
string digest = 16;
Image image = 17;

}

message Image {

enum Mode {
  LOCAL = 0;
  REMOTE = 1;
}
Mode mode = 1;
string location = 2;
enum Format {
  RAW = 0;
  OVA = 1;
  QCOW2 = 2;
  VMDK = 3;
}
Format format = 3;
string uri = 4;
string checksum = 5;
int64 size = 6;
string username = 7;
string password = 8;
string digest = 9;

}

message ImageListIdentifier {

string image_list_identifier = 1;

}

service Communicator {

rpc PreAction(google.protobuf.Empty) returns (google.protobuf.Empty) {}
rpc PostAction(google.protobuf.Empty) returns (google.protobuf.Empty) {}
rpc AddAppliance(Appliance) returns (google.protobuf.Empty) {}
rpc UpdateAppliance(Appliance) returns (google.protobuf.Empty) {}
rpc UpdateApplianceMetadata(Appliance) returns (google.protobuf.Empty) {}
rpc RemoveAppliance(Appliance) returns (google.protobuf.Empty) {}
rpc RemoveImageList(ImageListIdentifier) returns (google.protobuf.Empty) {}
rpc ImageLists(google.protobuf.Empty) returns (stream ImageListIdentifier) {}
rpc Appliances(ImageListIdentifier) returns (stream Appliance) {}
rpc RemoveExpiredAppliances(google.protobuf.Empty) returns (google.protobuf.Empty) {}

}