mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-05 13:46:51 +08:00
321 lines
8.9 KiB
Protocol Buffer
321 lines
8.9 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package api;
|
|
|
|
import "google/api/annotations.proto";
|
|
import "google/protobuf/empty.proto";
|
|
import "workflow_template.proto";
|
|
import "metric.proto";
|
|
|
|
service WorkflowService {
|
|
// Creates a Workflow
|
|
rpc CreateWorkflowExecution (CreateWorkflowExecutionRequest) returns (WorkflowExecution) {
|
|
option (google.api.http) = {
|
|
post: "/apis/v1beta1/{namespace}/workflow_executions"
|
|
body: "workflowExecution"
|
|
};
|
|
}
|
|
|
|
rpc GetWorkflowExecution (GetWorkflowExecutionRequest) returns (WorkflowExecution) {
|
|
option (google.api.http) = {
|
|
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}"
|
|
};
|
|
}
|
|
|
|
rpc ListWorkflowExecutions (ListWorkflowExecutionsRequest) returns (ListWorkflowExecutionsResponse) {
|
|
option (google.api.http) = {
|
|
get: "/apis/v1beta1/{namespace}/workflow_executions"
|
|
};
|
|
}
|
|
|
|
rpc WatchWorkflowExecution (WatchWorkflowExecutionRequest) returns (stream WorkflowExecution) {
|
|
option (google.api.http) = {
|
|
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}/watch"
|
|
};
|
|
}
|
|
|
|
rpc GetWorkflowExecutionLogs (GetWorkflowExecutionLogsRequest) returns (stream LogEntry) {
|
|
option (google.api.http) = {
|
|
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}/pods/{podName}/containers/{containerName}/logs"
|
|
};
|
|
}
|
|
|
|
rpc GetWorkflowExecutionMetrics (GetWorkflowExecutionMetricsRequest) returns (GetWorkflowExecutionMetricsResponse) {
|
|
option (google.api.http) = {
|
|
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}/pods/{podName}/metrics"
|
|
};
|
|
}
|
|
|
|
rpc ResubmitWorkflowExecution (ResubmitWorkflowExecutionRequest) returns (WorkflowExecution) {
|
|
option (google.api.http) = {
|
|
put: "/apis/v1beta1/{namespace}/workflow_executions/{name}/resubmit"
|
|
};
|
|
}
|
|
|
|
rpc TerminateWorkflowExecution (TerminateWorkflowExecutionRequest) returns (google.protobuf.Empty) {
|
|
option (google.api.http) = {
|
|
put: "/apis/v1beta1/{namespace}/workflow_executions/{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"
|
|
};
|
|
}
|
|
|
|
rpc GetArtifact (GetArtifactRequest) returns (ArtifactResponse) {
|
|
option (google.api.http) = {
|
|
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}/artifacts/{key=**}"
|
|
};
|
|
}
|
|
|
|
rpc ListFiles (ListFilesRequest) returns (ListFilesResponse) {
|
|
option (google.api.http) = {
|
|
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}/files/{path=**}"
|
|
};
|
|
}
|
|
|
|
rpc GetWorkflowExecutionLabels (GetLabelsRequest) returns (GetLabelsResponse) {
|
|
option (google.api.http) = {
|
|
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}/labels"
|
|
};
|
|
}
|
|
|
|
rpc AddWorkflowExecutionLabels (AddLabelsRequest) returns (GetLabelsResponse) {
|
|
option (google.api.http) = {
|
|
post: "/apis/v1beta1/{namespace}/workflow_executions/{name}/labels"
|
|
body: "labels"
|
|
};
|
|
}
|
|
|
|
rpc ReplaceWorkflowExecutionLabels (ReplaceLabelsRequest) returns (GetLabelsResponse) {
|
|
option (google.api.http) = {
|
|
put: "/apis/v1beta1/{namespace}/workflow_executions/{name}/labels"
|
|
body: "labels"
|
|
};
|
|
}
|
|
|
|
rpc DeleteWorkflowExecutionLabel (DeleteLabelRequest) returns (GetLabelsResponse) {
|
|
option (google.api.http) = {
|
|
delete: "/apis/v1beta1/{namespace}/workflow_executions/{name}/labels/{key}"
|
|
};
|
|
}
|
|
|
|
rpc GetWorkflowTemplateLabels (GetLabelsRequest) returns (GetLabelsResponse) {
|
|
option (google.api.http) = {
|
|
get: "/apis/v1beta1/{namespace}/workflow_templates/{name}/labels"
|
|
};
|
|
}
|
|
|
|
rpc AddWorkflowTemplateLabels (AddLabelsRequest) returns (GetLabelsResponse) {
|
|
option (google.api.http) = {
|
|
post: "/apis/v1beta1/{namespace}/workflow_templates/{name}/labels"
|
|
body: "labels"
|
|
};
|
|
}
|
|
|
|
rpc ReplaceWorkflowTemplateLabels (ReplaceLabelsRequest) returns (GetLabelsResponse) {
|
|
option (google.api.http) = {
|
|
put: "/apis/v1beta1/{namespace}/workflow_templates/{name}/labels"
|
|
body: "labels"
|
|
};
|
|
}
|
|
|
|
rpc DeleteWorkflowTemplateLabel (DeleteLabelRequest) returns (GetLabelsResponse) {
|
|
option (google.api.http) = {
|
|
delete: "/apis/v1beta1/{namespace}/workflow_templates/{name}/labels/{key}"
|
|
};
|
|
}
|
|
}
|
|
|
|
message CreateWorkflowExecutionRequest {
|
|
string namespace = 1;
|
|
WorkflowExecution workflowExecution = 2;
|
|
}
|
|
|
|
message GetWorkflowExecutionRequest {
|
|
string namespace = 1;
|
|
string name = 2;
|
|
}
|
|
|
|
message GetArtifactRequest {
|
|
string namespace = 1;
|
|
string name = 2;
|
|
string key = 3;
|
|
}
|
|
|
|
message WatchWorkflowExecutionRequest {
|
|
string namespace = 1;
|
|
string name = 2;
|
|
}
|
|
|
|
message ResubmitWorkflowExecutionRequest {
|
|
string namespace = 1;
|
|
string name = 2;
|
|
}
|
|
|
|
message TerminateWorkflowExecutionRequest {
|
|
string namespace = 1;
|
|
string name = 2;
|
|
}
|
|
|
|
message GetWorkflowExecutionLogsRequest {
|
|
string namespace = 1;
|
|
string name = 2;
|
|
string podName = 3;
|
|
string containerName = 4;
|
|
}
|
|
|
|
message GetWorkflowExecutionMetricsRequest {
|
|
string namespace = 1;
|
|
string name = 2;
|
|
string podName = 3;
|
|
}
|
|
|
|
message GetWorkflowExecutionMetricsResponse {
|
|
repeated Metric metrics = 1;
|
|
}
|
|
|
|
message ListWorkflowExecutionsRequest {
|
|
string namespace = 1;
|
|
string workflowTemplateUid = 2;
|
|
string workflowTemplateVersion = 3;
|
|
int32 pageSize = 4;
|
|
int32 page = 5;
|
|
}
|
|
|
|
message ListWorkflowExecutionsResponse {
|
|
int32 count = 1;
|
|
repeated WorkflowExecution workflowExecutions = 2;
|
|
int32 page = 3;
|
|
int32 pages = 4;
|
|
int32 totalCount = 5;
|
|
}
|
|
|
|
message LogEntry {
|
|
string timestamp = 1;
|
|
string content = 2;
|
|
}
|
|
|
|
message WorkflowExecution {
|
|
string createdAt = 1;
|
|
string uid = 2;
|
|
string name = 3;
|
|
string phase = 4;
|
|
string startedAt = 5;
|
|
string finishedAt = 6;
|
|
string manifest = 7;
|
|
|
|
repeated WorkflowExecutionParameter parameters = 8;
|
|
|
|
WorkflowTemplate workflowTemplate = 9;
|
|
}
|
|
|
|
message WorkflowExecutionParameter {
|
|
string name = 1;
|
|
string value = 2;
|
|
}
|
|
|
|
message ArtifactResponse {
|
|
bytes data = 1;
|
|
}
|
|
|
|
message File {
|
|
string path = 1;
|
|
string name = 2;
|
|
string extension = 3;
|
|
int64 size = 4;
|
|
string contentType = 5;
|
|
string lastModified = 6;
|
|
bool directory = 7;
|
|
}
|
|
|
|
message ListFilesRequest {
|
|
string namespace = 1;
|
|
string name = 2;
|
|
string path = 3;
|
|
}
|
|
|
|
message ListFilesResponse {
|
|
repeated File files = 1;
|
|
string parentPath = 2;
|
|
}
|
|
|
|
message KeyValue {
|
|
string key = 1;
|
|
string value = 2;
|
|
}
|
|
|
|
message Labels {
|
|
repeated KeyValue items = 1;
|
|
}
|
|
|
|
message AddLabelsRequest {
|
|
string namespace = 1;
|
|
string name = 2;
|
|
Labels labels = 3;
|
|
}
|
|
|
|
message ReplaceLabelsRequest {
|
|
string namespace = 1;
|
|
string name = 2;
|
|
Labels labels = 3;
|
|
}
|
|
|
|
message GetLabelsRequest {
|
|
string namespace = 1;
|
|
string name = 2;
|
|
}
|
|
|
|
message GetLabelsResponse {
|
|
repeated KeyValue labels = 1;
|
|
}
|
|
|
|
message DeleteLabelRequest {
|
|
string namespace = 1;
|
|
string name = 2;
|
|
string key = 3;
|
|
} |