syntax = "proto3"; package arikedbpbuff; service ArikedbRPC { // Global Server rpc methods rpc CreateCollections (CreateCollectionsRequest) returns (CreateCollectionsResponse); rpc DeleteCollections (DeleteCollectionsRequest) returns (DeleteCollectionsResponse); rpc ListCollections (ListCollectionsRequest) returns (ListCollectionsResponse); // Collection rpc methods rpc CreateVariables (CreateVariablesRequest) returns (CreateVariablesResponse); rpc DeleteVariables (DeleteVariablesRequest) returns (DeleteVariablesResponse); rpc ListVariables (ListVariablesRequest) returns (ListVariablesResponse); rpc SetVariables (SetVariablesRequest) returns (SetVariablesResponse); rpc GetVariables (GetVariablesRequest) returns (GetVariablesResponse); rpc SubscribeVariables(SubscribeVariablesRequest) returns (stream VarDataPoint); // Auth rpc Authenticate (AuthenticateRequest) returns (AuthenticateResponse); } enum VarType { I8 = 0; I16 = 1; I32 = 2; I64 = 3; I128 = 4; U8 = 5; U16 = 6; U32 = 7; U64 = 8; U128 = 9; F32 = 10; F64 = 11; STR = 12; BOOL = 13; } enum Epoch { SEC = 0; MS = 1; US = 2; NS = 3; } enum Event { ON_SET = 0; ON_CHANGE = 1; ON_RISE = 2; ON_FALL = 3; ON_VALUE_REACH_VAL = 4; ON_VALUE_EQ_VAL = 5; ON_VALUE_LEAVE_VAL = 6; ON_VALUE_DIFF_VAL = 7; ON_CROSS_HIGH_LIMIT = 8; ON_CROSS_LOW_LIMIT = 9; ON_OVER_HIGH_LIMIT = 10; ON_UNDER_LOW_LIMIT = 11; ON_VALUE_REACH_RANGE = 12; ON_VALUE_IN_RANGE = 13; ON_VALUE_LEAVE_RANGE = 14; ON_VALUE_OUT_RANGE = 15; } enum StatusCode { OK = 0; LICENSE_EXPIRED = 1; LICENSE_LIMITS_EXCEEDED = 2; SESSION_EXPIRED = 3; INTERNAL_ERROR = 4; UNAUTHORIZED = 5; UNAUTHENTICATED = 6; COLLECTION_NOT_FOUND = 7; INVALID_REQUEST = 8; } message VariableEvent { Event event = 1; string value = 2; string low_limit = 3; string high_limit = 4; } message CollectionMeta { string name = 1; } message VariableMeta { string name = 1; VarType vtype = 2; uint32 buffer_size = 3; } message VarDataPoint { string name = 1; VarType vtype = 2; string timestamp = 3; Epoch epoch = 4; string value = 5; } // Global Server Messages message CreateCollectionsRequest { repeated CollectionMeta collections = 1; } message CreateCollectionsResponse { StatusCode status = 1; } message DeleteCollectionsRequest { repeated string names = 1; } message DeleteCollectionsResponse { StatusCode status = 1; } message ListCollectionsRequest {} message ListCollectionsResponse { StatusCode status = 1; repeated CollectionMeta collections = 2; } // Collection Messages message CreateVariablesRequest { string collection = 1; repeated VariableMeta variables = 2; } message CreateVariablesResponse { StatusCode status = 1; } message DeleteVariablesRequest { string collection = 1; repeated string names = 2; } message DeleteVariablesResponse { StatusCode status = 1; } message ListVariablesRequest { string collection = 1; } message ListVariablesResponse { StatusCode status = 1; repeated VariableMeta variables = 2; } message SetVariablesRequest { string collection = 1; repeated string names = 2; repeated string values = 3; string timestamp = 4; Epoch epoch = 5; } message SetVariablesResponse { StatusCode status = 1; } message GetVariablesRequest { string collection = 1; repeated string names = 2; uint32 derived_order = 3; Epoch epoch = 4; } message GetVariablesResponse { StatusCode status = 1; repeated VarDataPoint points = 2; } message SubscribeVariablesRequest { string collection = 1; repeated string names = 2; repeated VariableEvent events = 3; } message AuthenticateRequest { string username = 1; string password = 2; } message AuthenticateResponse { StatusCode status = 1; string token = 2; }