yamcs.protobuf.web.websocket.proto Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yamcs-api Show documentation
Show all versions of yamcs-api Show documentation
Used by external clients to communicate with Yamcs
syntax="proto2";
package yamcs.protobuf.web;
option java_package = "org.yamcs.protobuf";
option java_outer_classname = "WebSocketProto";
option java_multiple_files = true;
import "yamcs/protobuf/yamcs.proto";
import "yamcs/protobuf/table/table.proto";
import "yamcs/protobuf/commanding/commanding.proto";
import "yamcs/protobuf/pvalue/pvalue.proto";
import "yamcs/protobuf/alarms/alarms.proto";
import "yamcs/protobuf/iam/iam.proto";
import "yamcs/protobuf/yamcsManagement/yamcsManagement.proto";
message WebSocketClientMessage {
optional uint32 protocolVersion = 1;
optional uint32 sequenceNumber = 2;
optional string resource = 3;
optional string operation = 4;
optional bytes data = 5;
}
message WebSocketServerMessage {
enum MessageType {
REPLY = 2; // one-time rpc-style ACK reply
EXCEPTION = 3; // one-time rpc-style exception reply
DATA = 4; // various subscribed data
}
message WebSocketReplyData {
optional uint32 protocolVersion = 1;
optional int32 sequenceNumber = 2; // allow for -1
optional string type = 3;
optional string message = 4;
optional bytes data = 5; // Structured data
}
message WebSocketExceptionData {
optional uint32 protocolVersion = 1;
optional int32 sequenceNumber = 2; // allow for -1
optional string type = 3;
optional string message = 4;
optional bytes data = 5; // Structured exception data
}
message WebSocketSubscriptionData {
optional uint32 sequenceNumber = 1;
optional ProtoDataType type = 2;
optional pvalue.ParameterData parameterData = 3;
optional commanding.CommandHistoryEntry command = 4;
optional yamcsManagement.ProcessorInfo processorInfo = 5;
optional yamcsManagement.ClientInfo clientInfo = 6;
optional yamcsManagement.Statistics statistics = 7;
optional Event event = 8;
optional table.StreamData streamData = 9;
optional alarms.AlarmData alarmData = 10;
optional TimeInfo timeInfo = 11;
optional yamcsManagement.LinkEvent linkEvent = 12;
optional commanding.CommandQueueInfo commandQueueInfo = 13;
optional commanding.CommandQueueEvent commandQueueEvent = 14;
optional TmPacketData tmPacket = 15;
optional ConnectionInfo connectionInfo = 16;
optional yamcsManagement.StreamEvent streamEvent = 17;
optional WebSocketExtensionData extensionData = 100;
}
optional MessageType type = 1;
optional WebSocketReplyData reply = 2;
optional WebSocketExceptionData exception = 3;
optional WebSocketSubscriptionData data = 4;
}
// Escape hatch for providing non-core Yamcs data over web socket
message WebSocketExtensionData {
optional uint32 type = 1;
optional bytes data = 2;
}
message LinkSubscriptionRequest {
optional string instance = 1;
}
message StreamsSubscriptionRequest {
optional string instance = 1;
}
message CfdpSubscriptionRequest {
optional string instance = 1;
}
message ProcessorSubscriptionRequest {
optional bool allProcessors = 1;
optional bool allInstances = 2;
}
message ManagementSubscriptionRequest {
optional bool clientInfo = 1;
optional bool processorStatistics = 3;
}
message AlarmSubscriptionRequest {
optional bool detail = 1;
}
message CommandHistorySubscriptionRequest {
// if not specified, updates on any command are returned
repeated commanding.CommandId commandId = 1 [deprecated=true];
// if set to true (default), incremental updates on commands that were
// issued before this subscription are not emitted.
optional bool ignorePastCommands = 2;
}
/*
* Used for parameter subscription and unsubscription.
*/
message ParameterSubscriptionRequest {
repeated NamedObjectId id = 1;
//if set to true, an error message will be sent back if any parameter from the list above is invalid
// by default is false
optional bool abortOnInvalid = 2;
// if set to true, send parameter updates when parameters expire.
// the parameter will have the same value and timestamp like the previous sent one, but the acquisition status will be set to EXPIRED (instead of ACQUIRED)
//by default is false
optional bool updateOnExpiration = 3;
//if set to true (default), send a first batch of the parameters from cache if available
// otherwise just wait for the parameters to be updated
optional bool sendFromCache = 4;
//subcriptionId
// 0 or not specified means to add parameters to the first subscription made
// this is for compatibility with the previous yamcs version before 4.1
// when it was not possible to have multiple subscriptions
// -1 means to create a new subscription
// >1 means to add parameters to the existing subcription with that id
optional int32 subscriptionId = 5;
//if set to true (higly recommended), a uint32 numeric id will be assigned to each parameter and will be sent back together with the value (instead of the NamedObjectId)
// this is done in order to reduce the bandwith used for transfering the parameter identifiers (since the NamedObjectId are quite long)
// Note that the numeric id is only unique on the websocket connection
// the ParameterSubscriptionResponse will contain the mapping id to NamedObjectId
optional bool useNumericIds = 6;
}
message SubscribedParameter {
optional NamedObjectId id = 1;
optional uint32 numericId = 2;
}
/*
* Response to parameter subscription
*
*/
message ParameterSubscriptionResponse {
repeated NamedObjectId invalid = 2;
optional int32 subscriptionId = 3;
//currently the list of subscribed parameters is sent back only if the option useNmericIds has been specified in the request
//it will contain the mapping between the subscribed id and the numeric id
repeated SubscribedParameter subscribed = 4;
}
message TimeSubscriptionResponse {
optional TimeInfo timeInfo = 1;
}
message ProcessorSubscriptionResponse {
optional yamcsManagement.ProcessorInfo processor = 1;
}
//sent via the websocket with information about connected client
message ConnectionInfo {
optional int32 clientId = 1;
optional yamcsManagement.YamcsInstance instance = 2;
optional yamcsManagement.ProcessorInfo processor = 3;
}
message AuthFlow {
enum Type {
PASSWORD = 1; // Login to Yamcs via standard username/password form
REDIRECT = 2; // Instruct client to login via an external URL (not yet implemented)
SPNEGO = 3; // Login to Yamcs via HTTP Negotiate (/auth/spnego endpoint)
}
optional Type type = 1;
//optional String uri = 2; //in case of POST is just a relative path to yamcs web
//optional string state; //the client has to send this to the POST link and then back to Yamcs
}
message AuthInfo {
optional bool requireAuthentication = 1;
repeated AuthFlow flow = 2;
}
// Naming conventions for this message follow RFC6749 - OAuth 2.0 Authorization Framework
message TokenResponse {
optional string access_token = 1;
optional string token_type = 2;
optional int32 expires_in = 3; // In seconds
optional string refresh_token = 4;
optional iam.UserInfo user = 5;
}