Files
onepanel/api/workflow.proto
2020-02-12 09:46:21 -08:00

182 lines
5.0 KiB
Protocol Buffer

syntax = "proto3";
package api;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "workflow_template.proto";
service WorkflowService {
// Creates a Workflow
rpc CreateWorkflow (CreateWorkflowRequest) returns (Workflow) {
option (google.api.http) = {
post: "/apis/v1beta1/{namespace}/workflows"
body: "workflow"
};
}
rpc GetWorkflow (GetWorkflowRequest) returns (Workflow) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/workflows/{name}"
};
}
rpc ListWorkflows (ListWorkflowsRequest) returns (ListWorkflowsResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/workflows"
};
}
rpc WatchWorkflow (WatchWorkflowRequest) returns (stream Workflow) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/workflows/{name}/watch"
};
}
rpc GetWorkflowLogs (GetWorkflowLogsRequest) returns (stream LogEntry) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/workflows/{name}/pods/{podName}/containers/{containerName}/logs"
};
}
rpc GetWorkflowMetrics (GetWorkflowMetricsRequest) returns (GetWorkflowMetricsResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/workflows/{name}/pods/{podName}/metrics"
};
}
rpc ResubmitWorkflow (ResubmitWorkflowRequest) returns (Workflow) {
option (google.api.http) = {
put: "/apis/v1beta1/{namespace}/workflows/{name}/resubmit"
};
}
rpc TerminateWorkflow (TerminateWorkflowRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
put: "/apis/v1beta1/{namespace}/workflows/{name}/terminate"
};
}
rpc CreateWorkflowTemplate (CreateWorkflowTemplateRequest) returns (WorkflowTemplate) {
option (google.api.http) = {
post: "/apis/v1beta1/{namespace}/workflow_templates"
body: "workflowTemplate"
};
}
rpc UpdateWorkflowTemplateVersion (UpdateWorkflowTemplateVersionRequest) returns (WorkflowTemplate) {
option (google.api.http) = {
put: "/apis/v1beta1/{namespace}/workflow_templates/{workflowTemplate.uid}/versions/{workflowTemplate.version}"
body: "workflowTemplate"
};
}
rpc CreateWorkflowTemplateVersion (CreateWorkflowTemplateRequest) returns (WorkflowTemplate) {
option (google.api.http) = {
post: "/apis/v1beta1/{namespace}/workflow_templates/{workflowTemplate.uid}/versions"
body: "workflowTemplate"
};
}
rpc GetWorkflowTemplate (GetWorkflowTemplateRequest) returns (WorkflowTemplate) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/workflow_templates/{uid}"
additional_bindings {
get: "/apis/v1beta1/{namespace}/workflow_templates/{uid}/versions/{version}"
}
};
}
rpc ListWorkflowTemplateVersions (ListWorkflowTemplateVersionsRequest) returns (ListWorkflowTemplateVersionsResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/workflow_templates/{uid}/versions"
};
}
rpc ListWorkflowTemplates (ListWorkflowTemplatesRequest) returns (ListWorkflowTemplatesResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/workflow_templates"
};
}
rpc ArchiveWorkflowTemplate (ArchiveWorkflowTemplateRequest) returns (ArchiveWorkflowTemplateResponse) {
option (google.api.http) = {
put: "/apis/v1beta1/{namespace}/workflow_templates/{uid}/archive"
};
}
}
message CreateWorkflowRequest {
string namespace = 1;
Workflow workflow = 2;
}
message GetWorkflowRequest {
string namespace = 1;
string name = 2;
}
message WatchWorkflowRequest {
string namespace = 1;
string name = 2;
}
message ResubmitWorkflowRequest {
string namespace = 1;
string name = 2;
}
message TerminateWorkflowRequest {
string namespace = 1;
string name = 2;
}
message GetWorkflowLogsRequest {
string namespace = 1;
string name = 2;
string podName = 3;
string containerName = 4;
}
message GetWorkflowMetricsRequest {
string namespace = 1;
string name = 2;
string podName = 3;
}
message GetWorkflowMetricsResponse {
string metrics = 1;
}
message ListWorkflowsRequest {
string namespace = 1;
string workflowTemplateUid = 2;
string workflowTemplateVersion = 3;
}
message ListWorkflowsResponse {
int32 count = 1;
repeated Workflow workflows = 2;
}
message LogEntry {
string timestamp = 1;
string content = 2;
}
message Workflow {
string createdAt = 1;
string uid = 2;
string name = 3;
string manifest = 4;
repeated WorkflowParameter parameters = 5;
WorkflowTemplate workflowTemplate = 6;
}
message WorkflowParameter {
string name = 1;
string value = 2;
}