-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_job.proto
executable file
·85 lines (71 loc) · 2.45 KB
/
admin_job.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
syntax = "proto3";
import "status.proto";
option go_package = "vectara.com/public/proto/admin";
option java_package = "com.vectara.admin";
option java_outer_classname = "AdminJobProtos";
package com.vectara.admin;
// Type of jobs.
enum JobType {
JOB__UNKNOWN = 0;
JOB__CORPUS_REBUILD_VECTOR_INDEX = 1;
JOB__CORPUS_REPLACE_FILTER_ATTRS = 2;
}
// The state of a job.
enum JobState {
JOB_STATE__UNKNOWN = 0;
JOB_STATE__QUEUED = 5;
JOB_STATE__STARTED = 10;
JOB_STATE__COMPLETED = 15;
JOB_STATE__FAILED = 20;
JOB_STATE__TRANSIENT_FAILURE_RETRY_IMMINENT = 25;
JOB_STATE__ABORTED = 30;
}
message ListJobsRequest {
// Optional filters. If specified, the filters are logically ANDed.
//
// [Optional] If specified, return the job for this id.
string job_id = 1;
// [Optional] If specified, return jobs for these corpora only.
repeated uint32 corpus_id = 2;
// [Optional] Get jobs that were created since this epoch timestamp.
// Max allowed value is 180 days ago. Default is 180 days.
int64 epoch_secs = 3;
// [Optional] Get jobs with these states. If not specified, all job
// states are fetched.
// Default: If not set, JOB_STATE__QUEUED and JOB_STATE__STARTED are returned.
repeated JobState state = 4;
// Maximum results to return. Max allowed value is 100.
uint32 num_results = 25;
// A key that is passed in to retrieve a specific page of results.
// Leave empty to retrieve first page. Subsequent page request should
// use the page key returned in previous response, and all other
// fields are ignored.
bytes page_key = 30;
}
// Represents a job in the system.
// A job is typically a long running unit of work for achieving a particular outcome.
// Example job: replace filter attributes of a corpus.
message Job {
string id = 1;
JobType type = 2;
// Set if the job belongs to a corpus.
repeated uint32 corpus_id = 3;
JobState state = 4;
// Epoch (secs) when the job was created.
int64 ts_create = 10;
// Epoch (secs) when the job was started. Not set if the job
// hasn't started yet.
int64 ts_start = 15;
// Epoch (secs) when the job completed. Not set if the job
// hasn't completed yet.
int64 ts_complete = 16;
// Handle of the user that created this job.
string user_handle = 17;
}
message ListJobsResponse {
repeated Status status = 1000;
repeated Job job = 10;
// A key that is passed into a subsequent result in order to
// retrieve the next page of results.
bytes page_key = 500;
}