87 lines
1.3 KiB
Protocol Buffer
87 lines
1.3 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package za.co.agriio.job;
|
|
|
|
enum JobState {
|
|
Stop = 0;
|
|
Scheduled = 1;
|
|
Started = 2;
|
|
Done = 3;
|
|
Removed = 4;
|
|
}
|
|
|
|
enum JobType {
|
|
Cron = 0;
|
|
Repeated = 1;
|
|
OneShot = 2;
|
|
}
|
|
|
|
message CronJob {
|
|
string schedule = 1;
|
|
}
|
|
|
|
message NonCronJob {
|
|
bool repeating = 1;
|
|
uint64 repeated_every = 2;
|
|
}
|
|
|
|
message Uuid {
|
|
uint64 id1 = 1;
|
|
uint64 id2 = 2;
|
|
}
|
|
|
|
message JobStoredData {
|
|
Uuid id = 1;
|
|
optional uint64 last_updated = 2;
|
|
optional uint64 last_tick = 3;
|
|
uint64 next_tick = 4;
|
|
JobType job_type = 5;
|
|
oneof job {
|
|
CronJob cron_job = 6;
|
|
NonCronJob non_cron_job = 7;
|
|
}
|
|
uint32 count = 8;
|
|
|
|
bytes extra = 9;
|
|
bool ran = 10;
|
|
bool stopped = 11;
|
|
int32 time_offset_seconds = 12;
|
|
}
|
|
|
|
message JobIdAndNotification {
|
|
Uuid job_id = 1;
|
|
Uuid notification_id = 2;
|
|
}
|
|
|
|
message NotificationData {
|
|
JobIdAndNotification job_id = 1;
|
|
repeated JobState job_states = 2;
|
|
bytes extra = 3;
|
|
}
|
|
|
|
message NotificationIdAndState {
|
|
Uuid notification_id = 1;
|
|
JobState job_state = 2;
|
|
}
|
|
|
|
message JobAndNextTick {
|
|
Uuid id = 1;
|
|
JobType job_type = 2;
|
|
uint64 next_tick = 3;
|
|
optional uint64 last_tick = 4;
|
|
}
|
|
|
|
message ListOfUuids {
|
|
repeated Uuid uuids = 1;
|
|
}
|
|
|
|
message JobAndNotifications {
|
|
Uuid job_id = 1;
|
|
repeated Uuid notification_ids = 2;
|
|
}
|
|
|
|
message ListOfJobsAndNotifications {
|
|
repeated JobAndNotifications job_and_notifications = 1;
|
|
}
|
|
|