syntax = "proto3"; import "google/protobuf/empty.proto"; import "google/protobuf/wrappers.proto"; service TSGRain { // Starte eine neue Bewässerungsaufgabe (oder stoppe eine laufende, wenn // diese bereits läuft). rpc RequestTask(TaskRequest) returns (TaskRequestResult) {} // Starte eine Bewässerungsaufgabe rpc StartTask(TaskStart) returns (google.protobuf.BoolValue) {} // Stoppe eine Bewässerungsaufgabe rpc StopTask(TaskStop) returns (google.protobuf.BoolValue) {} // Gibt sämtliche in der Warteschlange befindlichen Bewässerungsaufgaben zurück. rpc GetTasks(google.protobuf.Empty) returns (TaskList) {} // Streamt die aktuelle Warteschlange mit ihren Bewässerungsaufgaben, // d.h. bei Änderung wird die neue Version übertragen. rpc StreamTasks(google.protobuf.Empty) returns (stream TaskList) {} // Erstelle einen neuen Bewässerungsjob. rpc CreateJob(Job) returns (JobID) {} // Gibt den Bewässerungsjob mit der gegebenen ID zurück. rpc GetJob(JobID) returns (Job) {} // Gibt alle gespeicherten Bewässerungsjobs zurück. rpc GetJobs(google.protobuf.Empty) returns (JobList) {} // Aktualisiert einen Bewässerungsjob. rpc UpdateJob(Job) returns (google.protobuf.Empty) {} // Lösche den Bewässerungsjob mit der gegebenen ID. rpc DeleteJob(JobID) returns (google.protobuf.Empty) {} // Aktiviere Bewässerungsjob rpc EnableJob(JobID) returns (google.protobuf.Empty) {} // Deaktiviere Bewässerungsjob rpc DisableJob(JobID) returns (google.protobuf.Empty) {} // Gibt zurück, ob der Automatikmodus aktiviert ist. rpc GetAutoMode(google.protobuf.Empty) returns (google.protobuf.BoolValue) {} // Aktiviert/deaktiviert den Automatikmodus. rpc SetAutoMode(google.protobuf.BoolValue) returns (google.protobuf.Empty) {} // Datum/Uhrzeit/Zeitzone abrufen rpc GetSystemTime(google.protobuf.Empty) returns (SystemTime) {} // Datum/Uhrzeit einstellen rpc SetSystemTime(Timestamp) returns (google.protobuf.Empty) {} // Zeitzone einstellen rpc SetSystemTimezone(google.protobuf.StringValue) returns (google.protobuf.Empty) {} // Standardzeit bei manueller Bewässerung abrufen rpc GetDefaultIrrigationTime(google.protobuf.Empty) returns (google.protobuf.Int32Value) {} // Standardzeit bei manueller Bewässerung einstellen rpc SetDefaultIrrigationTime(google.protobuf.Int32Value) returns (google.protobuf.Empty) {} // Anzahl Bewässerungszonen abrufen rpc GetNZones(google.protobuf.Empty) returns (google.protobuf.Int32Value) {} } // Quelle einer Bewässerungsaufgabe enum TaskSource { MANUAL = 0; SCHEDULE = 1; } // Unix-Zeitstempel message Timestamp { int64 seconds = 1; } message TaskRequest { TaskSource source = 1; int32 zone_id = 2; int32 duration = 3; bool queuing = 4; bool cancelling = 5; } message TaskRequestResult { bool started = 1; bool stopped = 2; } message TaskStart { TaskSource source = 1; int32 zone_id = 2; int32 duration = 3; bool queuing = 4; } message TaskStop { TaskSource source = 1; int32 zone_id = 2; } message Task { TaskSource source = 1; int32 zone_id = 2; int32 duration = 3; Timestamp datetime_started = 4; Timestamp datetime_finished = 5; } message TaskList { repeated Task tasks = 1; Timestamp now = 2; bool auto_mode = 3; } message Job { int32 id = 1; Timestamp date = 2; int32 duration = 3; repeated int32 zones = 4; bool enable = 5; bool repeat = 6; } message JobID { int32 id = 1; } message JobList { repeated Job jobs = 1; } message SystemTime { Timestamp datetime = 1; string timezone = 2; }