mirror of
https://github.com/samuelncui/yatm.git
synced 2026-01-07 05:46:39 +00:00
75 lines
1.4 KiB
Protocol Buffer
75 lines
1.4 KiB
Protocol Buffer
syntax = "proto3";
|
|
package job;
|
|
option go_package = "github.com/samuelncui/yatm/entity";
|
|
|
|
import "job_archive.proto";
|
|
import "job_restore.proto";
|
|
|
|
enum JobStatus {
|
|
DRAFT = 0;
|
|
NOT_READY = 1; // dependencies not satisfied
|
|
PENDING = 2; // waiting in queue
|
|
PROCESSING = 3;
|
|
COMPLETED = 4;
|
|
|
|
FAILED = 127;
|
|
|
|
DELETED = 255;
|
|
}
|
|
|
|
message Job {
|
|
int64 id = 1;
|
|
JobStatus status = 2;
|
|
int64 priority = 3;
|
|
int64 create_time_ns = 4;
|
|
int64 update_time_ns = 5;
|
|
|
|
JobState state = 17;
|
|
}
|
|
|
|
message JobParam {
|
|
oneof param {
|
|
job_archive.JobArchiveParam archive = 1;
|
|
job_restore.JobRestoreParam restore = 2;
|
|
}
|
|
}
|
|
|
|
message JobState {
|
|
oneof state {
|
|
job_archive.JobArchiveState archive = 1;
|
|
job_restore.JobRestoreState restore = 2;
|
|
}
|
|
}
|
|
|
|
message JobNextParam {
|
|
oneof param {
|
|
job_archive.JobArchiveNextParam archive = 1;
|
|
job_restore.JobRestoreNextParam restore = 2;
|
|
}
|
|
}
|
|
|
|
message CreatableJob {
|
|
int64 priority = 3;
|
|
JobParam param = 17;
|
|
}
|
|
|
|
message JobFilter {
|
|
optional JobStatus status = 1;
|
|
|
|
optional int64 limit = 33;
|
|
optional int64 offset = 34;
|
|
}
|
|
|
|
message JobRecentlyUpdateFilter {
|
|
optional int64 update_since_ns = 1;
|
|
|
|
optional int64 limit = 33;
|
|
}
|
|
|
|
message JobDisplay {
|
|
oneof display {
|
|
job_archive.JobArchiveDisplay archive = 1;
|
|
job_restore.JobRestoreDisplay restore = 2;
|
|
}
|
|
}
|