Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDez patch 2 #2635

Merged
merged 11 commits into from
Nov 21, 2019
8 changes: 6 additions & 2 deletions backend/api/experiment.proto
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,29 @@ option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
};

service ExperimentService {
//Create a new experiment.
rpc CreateExperiment(CreateExperimentRequest) returns (Experiment) {
option (google.api.http) = {
post: "/apis/v1beta1/experiments"
body: "experiment"
};
}

//Find a specific experiment by ID.
rpc GetExperiment(GetExperimentRequest) returns (Experiment) {
option (google.api.http) = {
get: "/apis/v1beta1/experiments/{id}"
};
}

//Find all experiments.
rpc ListExperiment(ListExperimentsRequest) returns (ListExperimentsResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/experiments"
};
}

//Delete an experiment.
rpc DeleteExperiment(DeleteExperimentRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/apis/v1beta1/experiments/{id}"
Expand All @@ -85,12 +89,12 @@ service ExperimentService {
}

message CreateExperimentRequest {
// The experiment to be created
// The experiment to be created.
Experiment experiment = 1;
}

message GetExperimentRequest {
// The ID of the experiment to be retrieved
// The ID of the experiment to be retrieved.
string id = 1;
}

Expand Down
9 changes: 8 additions & 1 deletion backend/api/job.proto
Original file line number Diff line number Diff line change
Expand Up @@ -61,38 +61,45 @@ option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
}
};


service JobService {
//Create a new job.
rpc CreateJob(CreateJobRequest) returns (Job) {
option (google.api.http) = {
post: "/apis/v1beta1/jobs"
body: "job"
};
}

//Find a specific job by ID.
rpc GetJob(GetJobRequest) returns (Job) {
option (google.api.http) = {
get: "/apis/v1beta1/jobs/{id}"
};
}

//Find all jobs.
rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/jobs"
};
}

//Enable a job.
rpc EnableJob(EnableJobRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/apis/v1beta1/jobs/{id}/enable"
};
}

//Disable a job.
rpc DisableJob(DisableJobRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/apis/v1beta1/jobs/{id}/disable"
};
}

//Delete a job.
rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/apis/v1beta1/jobs/{id}"
Expand All @@ -114,7 +121,7 @@ message ListJobsRequest {
string page_token = 1;
int32 page_size = 2;

// Can be format of "field_name", "field_name asc" or "field_name des"
// Can be format of "field_name", "field_name asc" or "field_name des".
// Ascending by default.
string sort_by = 3;

Expand Down
5 changes: 5 additions & 0 deletions backend/api/pipeline.proto
Original file line number Diff line number Diff line change
Expand Up @@ -61,31 +61,36 @@ option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
};

service PipelineService {
//Add a pipeline.
rpc CreatePipeline(CreatePipelineRequest) returns (Pipeline) {
option (google.api.http) = {
post: "/apis/v1beta1/pipelines"
body: "pipeline"
};
}

//Find a specific pipeline by ID.
rpc GetPipeline(GetPipelineRequest) returns (Pipeline) {
option (google.api.http) = {
get: "/apis/v1beta1/pipelines/{id}"
};
}

//Find all pipelines.
rpc ListPipelines(ListPipelinesRequest) returns (ListPipelinesResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/pipelines"
};
}

//Delete a pipeline.
rpc DeletePipeline(DeletePipelineRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/apis/v1beta1/pipelines/{id}"
};
}

//Get a YAML template for the selected pipeline.
rpc GetTemplate(GetTemplateRequest) returns (GetTemplateResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/pipelines/{id}/templates"
Expand Down
20 changes: 10 additions & 10 deletions backend/api/run.proto
Original file line number Diff line number Diff line change
Expand Up @@ -59,45 +59,45 @@ option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
}
};

//Initiate a run.

service RunService {
// Creates a new run.
//Create a new run.
rpc CreateRun(CreateRunRequest) returns (RunDetail) {
option (google.api.http) = {
post: "/apis/v1beta1/runs"
body: "run"
};
}

//Finds a specific run by ID.
//Find a specific run by ID.
rpc GetRun(GetRunRequest) returns (RunDetail) {
option (google.api.http) = {
get: "/apis/v1beta1/runs/{run_id}"
};
}

//Finds all runs.
//Find all runs.
rpc ListRuns(ListRunsRequest) returns (ListRunsResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/runs"
};
}

//Archives a run.
//Archive a run.
rpc ArchiveRun(ArchiveRunRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/apis/v1beta1/runs/{id}:archive"
};
}

//Restores an archived run.
//Restore an archived run.
rpc UnarchiveRun(UnarchiveRunRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/apis/v1beta1/runs/{id}:unarchive"
};
}

//Deletes a run.
//Delete a run.
rpc DeleteRun(DeleteRunRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/apis/v1beta1/runs/{id}"
Expand All @@ -116,21 +116,21 @@ service RunService {
};
}

//Finds a run's artifact data.
//Find a run's artifact data.
rpc ReadArtifact(ReadArtifactRequest) returns (ReadArtifactResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/runs/{run_id}/nodes/{node_id}/artifacts/{artifact_name}:read"
};
}

//Terminates an active run.
//Terminate an active run.
rpc TerminateRun(TerminateRunRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/apis/v1beta1/runs/{run_id}/terminate"
};
}

//Re-initiates a failed or terminated run.
//Re-initiate a failed or terminated run.
rpc RetryRun(RetryRunRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/apis/v1beta1/runs/{run_id}/retry"
Expand Down