yamcs.protobuf.yamcsManagement.yamcsManagement.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.yamcsManagement;
option java_package = "org.yamcs.protobuf";
option java_outer_classname = "YamcsManagementProto";
option java_multiple_files = true;
import "yamcs/protobuf/yamcs.proto";
import "yamcs/protobuf/mdb/mdb.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/empty.proto";
import "yamcs/api/annotations.proto";
service ManagementApi {
// Get system info
rpc GetSystemInfo(google.protobuf.Empty) returns (SystemInfo) {
option (yamcs.api.route) = {
get: "/api/sysinfo"
};
}
// Get UTC leap seconds
rpc GetLeapSeconds(google.protobuf.Empty) returns (LeapSecondsTable) {
option (yamcs.api.route) = {
get: "/api/leap-seconds"
};
}
// List instance templates
rpc ListInstanceTemplates(google.protobuf.Empty) returns (ListInstanceTemplatesResponse) {
option (yamcs.api.route) = {
get: "/api/instance-templates"
};
}
// Get an instance template
rpc GetInstanceTemplate(GetInstanceTemplateRequest) returns (InstanceTemplate) {
option (yamcs.api.route) = {
get: "/api/instance-templates/{template}"
};
}
// List instances
rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) {
option (yamcs.api.route) = {
get: "/api/instances"
};
}
// Get an instance
rpc GetInstance(GetInstanceRequest) returns (YamcsInstance) {
option (yamcs.api.route) = {
get: "/api/instances/{instance}"
};
}
// Create an instance
rpc CreateInstance(CreateInstanceRequest) returns (YamcsInstance) {
option (yamcs.api.route) = {
post: "/api/instances"
body: "*"
};
}
// Start an instance
rpc StartInstance(StartInstanceRequest) returns (YamcsInstance) {
option (yamcs.api.route) = {
post: "/api/instances/{instance}:start"
};
}
// Stop an instance
rpc StopInstance(StopInstanceRequest) returns (YamcsInstance) {
option (yamcs.api.route) = {
post: "/api/instances/{instance}:stop"
};
}
// Restart an instance
rpc RestartInstance(RestartInstanceRequest) returns (YamcsInstance) {
option (yamcs.api.route) = {
post: "/api/instances/{instance}:restart"
};
}
// List services
rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
option (yamcs.api.route) = {
get: "/api/services/{instance}"
};
}
// Get a service
rpc GetService(GetServiceRequest) returns (ServiceInfo) {
option (yamcs.api.route) = {
get: "/api/services/{instance}/{name}"
};
}
// Start a service
rpc StartService(StartServiceRequest) returns (google.protobuf.Empty) {
option (yamcs.api.route) = {
post: "/api/services/{instance}/{name}:start"
};
}
// Stop a service
rpc StopService(StopServiceRequest) returns (google.protobuf.Empty) {
option (yamcs.api.route) = {
post: "/api/services/{instance}/{name}:stop"
};
}
// List links
rpc ListLinks(ListLinksRequest) returns (ListLinksResponse) {
option (yamcs.api.route) = {
get: "/api/links/{instance?}"
};
}
// Get a link
rpc GetLink(GetLinkRequest) returns (LinkInfo) {
option (yamcs.api.route) = {
get: "/api/links/{instance}/{name}"
};
}
// Update a link
rpc UpdateLink(EditLinkRequest) returns (LinkInfo) {
option (yamcs.api.route) = {
patch: "/api/links/{instance}/{name}"
body: "*"
};
}
}
/*service states coming from guava (numbers have to correspond)*/
enum ServiceState {
NEW = 0;
STARTING = 1;
RUNNING = 2;
STOPPING = 3;
TERMINATED = 4;
FAILED = 5;
}
message YamcsInstances {
repeated YamcsInstance instance = 1;
}
message YamcsInstance {
enum InstanceState {
OFFLINE = 0;
INITIALIZING = 1;
INITIALIZED = 2;
STARTING = 3;
RUNNING = 4;
STOPPING = 5;
FAILED = 6;
}
optional string name = 1;
optional mdb.MissionDatabase missionDatabase = 3;
repeated ProcessorInfo processor = 4;
optional InstanceState state = 11;
//in case the state=FAILED, this field will indicate the cause of the failure
// the missionDatabase and other fields may not be filled when this happens
optional string failureCause = 9;
optional string missionTime = 10;
map labels = 12;
}
message InstanceTemplate {
optional string name = 1;
repeated TemplateVariable variable = 2;
}
message TemplateVariable {
optional string name = 1;
optional string description = 2;
optional bool required = 3;
}
message ProcessorInfo {
optional string instance = 1; //yamcs instance
optional string name = 2;
optional string type = 3;
optional string spec = 4;
optional string creator = 5;
optional bool hasAlarms = 6;
optional bool hasCommanding = 7;
optional ServiceState state = 8;
optional ReplayRequest replayRequest = 9; //in case of replay
optional ReplayStatus.ReplayState replayState = 10; //in case of replay
repeated ServiceInfo service = 16;
optional bool persistent = 17;
optional string time = 18;
optional bool replay = 19;
}
message ClientInfo {
reserved 8,9;
enum ClientState {
CONNECTED = 0;
DISCONNECTED = 1;
}
optional int32 id = 2;
optional string username = 3;
optional string applicationName = 4;
optional string address = 10;
optional string instance = 1;
optional string processorName = 5;
optional ClientState state = 6;
optional google.protobuf.Timestamp loginTime = 11;
}
message TmStatistics {
reserved 3,4,7, 8;
optional string packetName = 1;
optional string qualifiedName = 9;
optional int64 receivedPackets = 2;
optional int32 subscribedParameterCount = 6;
optional google.protobuf.Timestamp lastReceived = 10;
optional google.protobuf.Timestamp lastPacketTime = 11;
optional int64 packetRate = 12;
optional int64 dataRate = 13;
}
message Statistics {
reserved 4,5;
optional string instance = 1;
optional string yProcessorName = 2 [deprecated=true];
optional string processor = 7;
repeated TmStatistics tmstats = 3;
optional google.protobuf.Timestamp lastUpdated = 6; //java local time of the last update
}
message ProcessorManagementRequest {
enum Operation {
CREATE_PROCESSOR = 0;
CONNECT_TO_PROCESSOR = 1;
}
optional Operation operation = 1;
optional string instance = 2; //yamcs instance
optional string name = 3; //processor name
optional string type = 4; //only for CREATE
optional string config = 5; //only for CREATE - used to be called spec
repeated int32 clientId = 6; //for CREATE and CONNECT
optional bool persistent = 7[default=false]; //only for CREATE
}
message ProcessorRequest {
enum Operation {
PAUSE = 2;
RESUME = 3;
SEEK = 4;
CHANGE_SPEED = 5;
}
optional Operation operation = 1;
optional string instance = 2; //yamcs instance
optional string name = 3; //processor name
optional int64 seekTime = 4; //for SEEK
optional ReplaySpeed replaySpeed = 5; //for CHANGE_SPEED
}
message LinkInfo {
reserved 5,8;
optional string instance = 1;
optional string name = 2;
optional string type = 3;
optional string spec = 4;
optional bool disabled = 6;
optional string status = 7;
optional int64 dataInCount = 10;
optional int64 dataOutCount = 11;
optional string detailedStatus = 9;
//if this is a sublink of an aggregated data link, this is the name of the parent
optional string parentName = 12;
}
message LinkEvent {
enum Type {
REGISTERED = 1;
UNREGISTERED = 2;
UPDATED = 3;
}
optional Type type = 1;
optional LinkInfo linkInfo = 2;
}
message ServiceInfo {
optional string instance = 1;
optional string name = 2;
optional ServiceState state = 3;
optional string className = 4;
optional string processor = 5;
}
message StreamEvent {
enum Type {
CREATED = 1;
DELETED = 2;
UPDATED = 3;
}
optional Type type = 1;
optional string name = 2;
optional int64 dataCount = 3;
}
message SystemInfo {
optional string yamcsVersion = 1;
optional string revision = 2;
optional string serverId = 3;
optional int64 uptime = 5;
optional string jvm = 6;
optional string workingDirectory = 7;
optional string configDirectory = 8;
optional string dataDirectory = 9;
optional string cacheDirectory = 10;
optional string os = 11;
optional string arch = 12;
optional int32 availableProcessors = 13;
optional double loadAverage = 14;
optional int64 heapMemory = 15;
optional int64 usedHeapMemory = 16;
optional int64 maxHeapMemory = 17;
optional int64 nonHeapMemory = 18;
optional int64 usedNonHeapMemory = 19;
optional int64 maxNonHeapMemory = 20;
optional int64 jvmThreadCount = 21;
repeated RootDirectory rootDirectories = 22;
}
message RootDirectory {
optional string directory = 1;
optional string type = 2;
optional int64 totalSpace = 3;
optional int64 unallocatedSpace = 4;
optional int64 usableSpace = 5;
}
message ListServicesRequest {
optional string instance = 1;
}
message GetServiceRequest {
optional string instance = 1;
optional string name = 2;
}
message StartServiceRequest {
optional string instance = 1;
optional string name = 2;
}
message StopServiceRequest {
optional string instance = 1;
optional string name = 2;
}
message ListServicesResponse {
repeated ServiceInfo services = 1;
}
message ListInstancesRequest {
repeated string filter = 1;
}
message ListInstancesResponse {
repeated YamcsInstance instances = 1;
}
message CreateInstanceRequest {
optional string name = 1;
optional string template = 2;
map templateArgs = 3;
map labels = 4;
}
message ListInstanceTemplatesResponse {
repeated InstanceTemplate templates = 1;
}
message EditInstanceRequest {
optional string instance = 1;
optional string state = 2;
}
message LeapSecondsTable {
message ValidityRange {
optional string start = 1; // UTC timestamp (unsmeared)
optional string stop = 2; // UTC timestamp (unsmeared)
optional int32 leapSeconds = 3;
optional int32 taiDifference = 4;
}
repeated ValidityRange ranges = 1;
}
message GetInstanceTemplateRequest {
optional string template = 1;
}
message GetInstanceRequest {
optional string instance = 1;
}
message StartInstanceRequest {
optional string instance = 1;
}
message StopInstanceRequest {
optional string instance = 1;
}
message RestartInstanceRequest {
optional string instance = 1;
}
message ListLinksRequest {
optional string instance = 1;
}
message ListLinksResponse {
repeated LinkInfo links = 1;
}
message GetLinkRequest {
optional string instance = 1;
optional string name = 2;
}
message EditLinkRequest {
optional string instance = 3;
optional string name = 4;
optional string state = 1;
optional bool resetCounters = 2;
}