Files
yatm/entity/job.proto
2023-09-26 16:47:06 +08:00

67 lines
1.3 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 = 255;
}
message Job {
int64 id = 1;
JobStatus status = 2;
int64 priority = 3;
int64 create_time = 4;
int64 update_time = 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 JobDisplay {
oneof display {
job_archive.JobArchiveDisplay archive = 1;
job_restore.JobRestoreDisplay restore = 2;
}
}