blob: c351f1fe0ea88c9cd09bdb3b81001b617745efe7 [file] [log] [blame]
syntax = "proto3";
package xos;
import "google/protobuf/empty.proto";
import "annotations.proto";
import "common.proto";
import "xosoptions.proto";
message LoginRequest {
string username = 1;
string password = 2;
};
message LoginResponse {
string sessionid = 1;
};
message ModelFilter {
string class_name = 1;
};
message ModelListEntry {
string class_name = 1;
int32 id = 2;
string info = 3;
};
message ModelList {
repeated ModelListEntry items = 1;
};
message XProtos {
string xproto = 1;
};
message VersionInfo {
string version = 1;
string pythonVersion = 2;
string gitCommit = 3;
string buildTime = 4;
string os = 5;
string arch = 6;
};
message DatabaseInfo {
enum DatabaseStatus {
UNKNOWN=0;
OPERATIONAL=1;
ERROR=2;
}
string name = 1;
string connection = 2;
string version = 3;
DatabaseStatus status = 4;
}
message PopulatedServiceInstance {
option (contentTypeId) = "core.serviceinstance";
oneof id_present {
int32 id = 1;
}
oneof leaf_model_name_present {
string leaf_model_name = 2[(val).maxLength = 1024, (val).nonNull = true];
}
oneof name_present {
string name = 3[(val).maxLength = 200];
}
oneof owner_present {
int32 owner_id = 4[(val).nonNull = true, (foreignKey).modelName = "Service", (foreignKey).reverseFieldName = "service_instances"];
}
repeated int32 provided_service_instances = 5;
repeated int32 subscribed_service_instances = 6;
repeated int32 subscribed_service = 7;
repeated int32 subscribed_network = 8;
};
service utility {
rpc Login(LoginRequest) returns (LoginResponse) {
option (googleapi.http) = {
post: "/xosapi/v1/utility/login"
body: "*"
};
}
rpc Logout(google.protobuf.Empty) returns (google.protobuf.Empty) {
option (googleapi.http) = {
post: "/xosapi/v1/utility/logout"
body: "*"
};
}
rpc NoOp(google.protobuf.Empty) returns (google.protobuf.Empty) {
option (googleapi.http) = {
post: "/xosapi/v1/utility/noop"
body: "*"
};
}
rpc AuthenticatedNoOp(google.protobuf.Empty) returns (google.protobuf.Empty) {
option (googleapi.http) = {
post: "/xosapi/v1/utility/auth_noop"
body: "*"
};
}
rpc SetDirtyModels(ModelFilter) returns (ModelList) {
option (googleapi.http) = {
post: "/xosapi/v1/utility/dirty_models"
body: "*"
};
}
rpc ListDirtyModels(ModelFilter) returns (ModelList) {
option (googleapi.http) = {
get: "/xosapi/v1/utility/dirty_models"
};
}
rpc GetXproto(google.protobuf.Empty) returns (XProtos) {
option (googleapi.http) = {
get: "/xosapi/v1/xproto"
};
}
rpc GetPopulatedServiceInstances(ID) returns (PopulatedServiceInstance) {
option (googleapi.http) = {
get: "/xosapi/v1/core/populatedserviceinstance/{id}"
};
}
rpc GetVersion(google.protobuf.Empty) returns (VersionInfo) {
option (googleapi.http) = {
get: "/xosapi/v1/version"
};
}
rpc GetDatabaseInfo(google.protobuf.Empty) returns (DatabaseInfo) {
option (googleapi.http) = {
get: "/xosapi/v1/dbinfo"
};
}
};