2019-02-18 07:41:30 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package core;
|
|
|
|
|
|
|
|
service CoreApi {
|
2019-02-24 15:44:41 +00:00
|
|
|
rpc CreateSession (CreateSessionRequest) returns (CreateSessionResponse) {
|
|
|
|
}
|
2019-02-24 16:15:33 +00:00
|
|
|
rpc DeleteSession (DeleteSessionRequest) returns (DeleteSessionResponse) {
|
|
|
|
}
|
2019-02-21 05:19:35 +00:00
|
|
|
rpc GetSessions (SessionsRequest) returns (SessionsResponse) {
|
|
|
|
}
|
|
|
|
rpc GetSession (SessionRequest) returns (SessionResponse) {
|
|
|
|
}
|
|
|
|
rpc GetSessionOptions (SessionOptionsRequest) returns (SessionOptionsResponse) {
|
|
|
|
}
|
2019-02-24 15:44:41 +00:00
|
|
|
rpc GetSessionLocation (GetSessionLocationRequest) returns (GetSessionLocationResponse) {
|
|
|
|
}
|
|
|
|
rpc SetSessionLocation (SetSessionLocationRequest) returns (SetSessionLocationResponse) {
|
2019-02-24 16:15:33 +00:00
|
|
|
}
|
|
|
|
rpc SetSessionState (SetSessionStateRequest) returns (SetSessionStateResponse) {
|
2019-02-21 05:19:35 +00:00
|
|
|
}
|
2019-02-18 07:41:30 +00:00
|
|
|
}
|
|
|
|
|
2019-02-24 15:44:41 +00:00
|
|
|
// rpc request/response messages
|
|
|
|
message CreateSessionRequest {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
message CreateSessionResponse {
|
|
|
|
int32 id = 1;
|
|
|
|
int32 state = 2;
|
|
|
|
}
|
|
|
|
|
2019-02-24 16:15:33 +00:00
|
|
|
message DeleteSessionRequest {
|
|
|
|
int32 id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DeleteSessionResponse {
|
|
|
|
bool result = 1;
|
|
|
|
}
|
|
|
|
|
2019-02-18 07:41:30 +00:00
|
|
|
message SessionsRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
message SessionsResponse {
|
2019-02-21 05:19:35 +00:00
|
|
|
repeated Session sessions = 1;
|
2019-02-18 07:41:30 +00:00
|
|
|
}
|
|
|
|
|
2019-02-19 06:54:14 +00:00
|
|
|
message SessionRequest {
|
2019-02-21 05:19:35 +00:00
|
|
|
int32 id = 1;
|
2019-02-19 06:54:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message SessionResponse {
|
2019-02-21 05:19:35 +00:00
|
|
|
int32 state = 1;
|
|
|
|
repeated Node nodes = 2;
|
|
|
|
repeated Link links = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SessionOptionsRequest {
|
|
|
|
int32 id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SessionOptionsResponse {
|
|
|
|
repeated ConfigGroup groups = 1;
|
|
|
|
}
|
|
|
|
|
2019-02-24 15:44:41 +00:00
|
|
|
message GetSessionLocationRequest {
|
2019-02-21 05:19:35 +00:00
|
|
|
int32 id = 1;
|
|
|
|
}
|
|
|
|
|
2019-02-24 15:44:41 +00:00
|
|
|
message GetSessionLocationResponse {
|
2019-02-21 05:19:35 +00:00
|
|
|
Position position = 1;
|
|
|
|
float scale = 2;
|
|
|
|
}
|
|
|
|
|
2019-02-24 15:44:41 +00:00
|
|
|
message SetSessionLocationRequest {
|
|
|
|
int32 id = 1;
|
|
|
|
Position position = 2;
|
|
|
|
float scale = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SetSessionLocationResponse {
|
2019-02-24 16:15:33 +00:00
|
|
|
}
|
2019-02-24 15:44:41 +00:00
|
|
|
|
2019-02-24 16:15:33 +00:00
|
|
|
message SetSessionStateRequest {
|
|
|
|
int32 id = 1;
|
|
|
|
SessionState state = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SetSessionStateResponse {
|
|
|
|
bool result = 1;
|
2019-02-24 15:44:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// data structures for messages below
|
2019-02-24 16:15:33 +00:00
|
|
|
enum SessionState {
|
|
|
|
NONE = 0;
|
|
|
|
DEFINITION = 1;
|
|
|
|
CONFIGURATION = 2;
|
|
|
|
INSTANTIATION = 3;
|
|
|
|
RUNTIME = 4;
|
|
|
|
DATACOLLECT = 5;
|
|
|
|
SHUTDOWN = 6;
|
|
|
|
}
|
|
|
|
|
2019-02-21 05:19:35 +00:00
|
|
|
message ConfigGroup {
|
|
|
|
string name = 1;
|
|
|
|
repeated ConfigOption options = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ConfigOption {
|
|
|
|
string label = 1;
|
|
|
|
string name = 2;
|
|
|
|
string value = 3;
|
|
|
|
int32 type = 4;
|
|
|
|
repeated string select = 5;
|
2019-02-19 06:54:14 +00:00
|
|
|
}
|
|
|
|
|
2019-02-18 07:41:30 +00:00
|
|
|
message Session {
|
2019-02-21 05:19:35 +00:00
|
|
|
int32 id = 1;
|
|
|
|
int32 state = 2;
|
|
|
|
int32 nodes = 3;
|
2019-02-19 06:54:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message Node {
|
2019-02-21 05:19:35 +00:00
|
|
|
int32 id = 1;
|
|
|
|
string name = 2;
|
|
|
|
int32 type = 3;
|
|
|
|
string model = 4;
|
|
|
|
Position position = 5;
|
|
|
|
repeated string services = 6;
|
|
|
|
string emane = 7;
|
2019-02-19 06:54:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message Link {
|
2019-02-21 05:19:35 +00:00
|
|
|
int32 node_one = 1;
|
|
|
|
int32 node_two = 2;
|
|
|
|
int32 type = 3;
|
|
|
|
Interface interface_one = 4;
|
|
|
|
Interface interface_two = 5;
|
|
|
|
LinkOptions options = 6;
|
2019-02-20 07:32:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message LinkOptions {
|
2019-02-21 05:19:35 +00:00
|
|
|
string opaque = 1;
|
|
|
|
float jitter = 2;
|
|
|
|
string key = 3;
|
|
|
|
float mburst = 4;
|
|
|
|
float mer = 5;
|
|
|
|
float per = 6;
|
|
|
|
float bandwidth = 7;
|
|
|
|
float burst = 8;
|
|
|
|
float delay = 9;
|
|
|
|
float dup = 10;
|
|
|
|
bool unidirectional = 11;
|
2019-02-20 07:32:04 +00:00
|
|
|
}
|
2019-02-19 06:54:14 +00:00
|
|
|
|
2019-02-20 07:32:04 +00:00
|
|
|
message Interface {
|
2019-02-21 05:19:35 +00:00
|
|
|
int32 id = 1;
|
|
|
|
string name = 2;
|
|
|
|
string mac = 3;
|
|
|
|
string ip4 = 4;
|
|
|
|
int32 ip4mask = 5;
|
|
|
|
string ip6 = 6;
|
|
|
|
int32 ip6mask = 7;
|
2019-02-19 06:54:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message Position {
|
2019-02-21 05:19:35 +00:00
|
|
|
float x = 1;
|
|
|
|
float y = 2;
|
|
|
|
float z = 3;
|
|
|
|
float lat = 4;
|
|
|
|
float lon = 5;
|
|
|
|
float alt = 6;
|
2019-02-18 07:41:30 +00:00
|
|
|
}
|