mirror of
				https://github.com/onepanelio/onepanel.git
				synced 2025-11-01 01:02:32 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			156 lines
		
	
	
		
			4.2 KiB
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
			
		
		
	
	
			156 lines
		
	
	
		
			4.2 KiB
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
| syntax = "proto3";
 | |
| 
 | |
| package api;
 | |
| 
 | |
| import "google/api/annotations.proto";
 | |
| import "label.proto";
 | |
| 
 | |
| service WorkflowTemplateService {
 | |
|     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 CloneWorkflowTemplate (CloneWorkflowTemplateRequest) returns (WorkflowTemplate) {
 | |
|         option (google.api.http) = {
 | |
|             get: "/apis/v1beta1/{namespace}/workflow_templates/{uid}/clone/{name}"
 | |
|             additional_bindings {
 | |
| 				get: "/apis/v1beta1/{namespace}/workflow_templates/{uid}/clone/{name}/{version}"
 | |
| 			}
 | |
|         };
 | |
|     }
 | |
| 
 | |
|     rpc ArchiveWorkflowTemplate (ArchiveWorkflowTemplateRequest) returns (ArchiveWorkflowTemplateResponse) {
 | |
|         option (google.api.http) = {
 | |
|             put: "/apis/v1beta1/{namespace}/workflow_templates/{uid}/archive"
 | |
|         };
 | |
|     }
 | |
| }
 | |
| 
 | |
| message CreateWorkflowTemplateRequest {
 | |
|     string namespace = 1;
 | |
|     WorkflowTemplate workflowTemplate = 2;
 | |
| }
 | |
| 
 | |
| message UpdateWorkflowTemplateVersionRequest {
 | |
|     string namespace = 1;
 | |
|     WorkflowTemplate workflowTemplate = 2;
 | |
| }
 | |
| 
 | |
| message GetWorkflowTemplateRequest {
 | |
|     string namespace = 1;
 | |
|     string uid = 2;
 | |
|     int64 version = 3;
 | |
| }
 | |
| 
 | |
| message CloneWorkflowTemplateRequest {
 | |
|     string namespace = 1;
 | |
|     string uid = 2;
 | |
|     string name = 3;
 | |
|     int64 version = 4;
 | |
| }
 | |
| 
 | |
| message ListWorkflowTemplateVersionsRequest {
 | |
|     string namespace = 1;
 | |
|     string uid = 2;
 | |
| }
 | |
| 
 | |
| message ListWorkflowTemplateVersionsResponse {
 | |
|     int32 count = 1;
 | |
|     repeated WorkflowTemplate workflowTemplates = 2;
 | |
| }
 | |
| 
 | |
| message ListWorkflowTemplatesRequest {
 | |
|     string namespace = 1;
 | |
|     int32 pageSize = 2;
 | |
|     int32 page = 3;
 | |
| }
 | |
| 
 | |
| message ListWorkflowTemplatesResponse {
 | |
|     int32 count = 1;
 | |
|     repeated WorkflowTemplate workflowTemplates = 2;
 | |
|     int32 page = 3;
 | |
|     int32 pages = 4;
 | |
|     int32 totalCount = 5;
 | |
| }
 | |
| 
 | |
| message ArchiveWorkflowTemplateRequest {
 | |
|     string namespace = 1;
 | |
|     string uid = 2;
 | |
| }
 | |
| 
 | |
| message ArchiveWorkflowTemplateResponse {
 | |
|     WorkflowTemplate workflowTemplate = 1;
 | |
| }
 | |
| 
 | |
| message WorkflowExecutionStatisticReport {
 | |
|     int32 total = 1;
 | |
|     string lastExecuted = 2;
 | |
|     int32 running = 3;
 | |
|     int32 completed = 4;
 | |
|     int32 failed = 5;
 | |
|     int32 terminated = 6;
 | |
| }
 | |
| 
 | |
| message CronWorkflowStatisticsReport {
 | |
|     int32 total = 1;
 | |
| }
 | |
| 
 | |
| message WorkflowTemplate {
 | |
|     string createdAt = 1;
 | |
|     string modifiedAt = 2;
 | |
|     string uid = 3;
 | |
|     string name = 4;
 | |
|     int64 version = 5;
 | |
|     int64 versions = 6;
 | |
|     string manifest = 7;
 | |
|     bool isLatest = 8;
 | |
|     bool isArchived = 9;
 | |
|     repeated KeyValue labels = 10;
 | |
| 
 | |
|     WorkflowExecutionStatisticReport stats = 11;
 | |
|     CronWorkflowStatisticsReport cronStats = 12;
 | |
| }
 | |
| 
 | |
| message GetWorkflowTemplateLabelsRequest {
 | |
|     string namespace = 1;
 | |
|     string name = 2;
 | |
|     int64 version = 3;
 | |
| } | 
