Skip to content

Commit 961697f

Browse files
authored
Merge pull request #6 from odpf/optimus-check-job-spec
feat: check job specification rpc in optimus
2 parents 877cc0d + 9fcb930 commit 961697f

2 files changed

Lines changed: 36 additions & 3 deletions

File tree

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apply plugin: 'maven-publish'
55

66

77
group 'io.odpf'
8-
version '0.1.0'
8+
version '0.2.0'
99

1010

1111
repositories {

odpf/optimus/RuntimeService.proto

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ service RuntimeService {
5252
get: "/api/v1/project/{project_name}/job/{job_name}/dump"
5353
};
5454
}
55+
// CheckJobSpecification checks if a job specification is valid
56+
rpc CheckJobSpecification(CheckJobSpecificationRequest) returns (CheckJobSpecificationResponse) {
57+
option (google.api.http) = {
58+
post: "/api/v1/project/{project_name}/job/check"
59+
};
60+
}
61+
// CheckJobSpecifications checks if the job specifications are valid
62+
rpc CheckJobSpecifications(CheckJobSpecificationsRequest) returns (stream CheckJobSpecificationsResponse) {}
5563

5664
// RegisterProject creates a new project
5765
rpc RegisterProject(RegisterProjectRequest) returns (RegisterProjectResponse) {
@@ -203,10 +211,10 @@ message JobStatus {
203211

204212
// ResourceSpecification are datastore specification representation of a resource
205213
message ResourceSpecification {
214+
reserved 3; // depricated "datastore"
215+
206216
int32 version = 1;
207217
string name = 2;
208-
209-
string datastore = 3;
210218
string type = 4;
211219

212220
google.protobuf.Struct spec = 5;
@@ -261,6 +269,31 @@ message DumpJobSpecificationResponse {
261269
string content = 2;
262270
}
263271

272+
message CheckJobSpecificationRequest {
273+
string project_name = 1;
274+
JobSpecification job = 2;
275+
}
276+
277+
message CheckJobSpecificationResponse {
278+
bool success = 1;
279+
}
280+
281+
message CheckJobSpecificationsRequest {
282+
string project_name = 1;
283+
repeated JobSpecification jobs = 2;
284+
}
285+
286+
message CheckJobSpecificationsResponse {
287+
bool success = 1;
288+
289+
// non ack responses are more of a progress/info response
290+
// and not really success or failure statuses
291+
bool ack = 2;
292+
293+
string message = 3;
294+
string job_name = 4;
295+
}
296+
264297
message RegisterProjectRequest {
265298
ProjectSpecification project = 1;
266299
}

0 commit comments

Comments
 (0)