rename Workflow to workflowExecution

This commit is contained in:
rushtehrani
2020-02-20 20:43:02 -08:00
parent 48cd98344d
commit be711a94c0
8 changed files with 957 additions and 953 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -31,15 +31,15 @@ var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = descriptor.ForMessage
func request_WorkflowService_CreateWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateWorkflowRequest
func request_WorkflowService_CreateWorkflowExecution_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateWorkflowExecutionRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Workflow); err != nil && err != io.EOF {
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.WorkflowExecution); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
@@ -61,20 +61,20 @@ func request_WorkflowService_CreateWorkflow_0(ctx context.Context, marshaler run
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
}
msg, err := client.CreateWorkflow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
msg, err := client.CreateWorkflowExecution(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_WorkflowService_CreateWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateWorkflowRequest
func local_request_WorkflowService_CreateWorkflowExecution_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateWorkflowExecutionRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Workflow); err != nil && err != io.EOF {
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.WorkflowExecution); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
@@ -96,13 +96,13 @@ func local_request_WorkflowService_CreateWorkflow_0(ctx context.Context, marshal
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
}
msg, err := server.CreateWorkflow(ctx, &protoReq)
msg, err := server.CreateWorkflowExecution(ctx, &protoReq)
return msg, metadata, err
}
func request_WorkflowService_GetWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetWorkflowRequest
func request_WorkflowService_GetWorkflowExecution_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetWorkflowExecutionRequest
var metadata runtime.ServerMetadata
var (
@@ -134,13 +134,13 @@ func request_WorkflowService_GetWorkflow_0(ctx context.Context, marshaler runtim
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
msg, err := client.GetWorkflow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
msg, err := client.GetWorkflowExecution(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_WorkflowService_GetWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetWorkflowRequest
func local_request_WorkflowService_GetWorkflowExecution_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetWorkflowExecutionRequest
var metadata runtime.ServerMetadata
var (
@@ -172,17 +172,17 @@ func local_request_WorkflowService_GetWorkflow_0(ctx context.Context, marshaler
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
msg, err := server.GetWorkflow(ctx, &protoReq)
msg, err := server.GetWorkflowExecution(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_WorkflowService_ListWorkflows_0 = &utilities.DoubleArray{Encoding: map[string]int{"namespace": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
filter_WorkflowService_ListWorkflowExecutions_0 = &utilities.DoubleArray{Encoding: map[string]int{"namespace": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
)
func request_WorkflowService_ListWorkflows_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListWorkflowsRequest
func request_WorkflowService_ListWorkflowExecutions_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListWorkflowExecutionsRequest
var metadata runtime.ServerMetadata
var (
@@ -206,17 +206,17 @@ func request_WorkflowService_ListWorkflows_0(ctx context.Context, marshaler runt
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WorkflowService_ListWorkflows_0); err != nil {
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WorkflowService_ListWorkflowExecutions_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListWorkflows(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
msg, err := client.ListWorkflowExecutions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_WorkflowService_ListWorkflows_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListWorkflowsRequest
func local_request_WorkflowService_ListWorkflowExecutions_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListWorkflowExecutionsRequest
var metadata runtime.ServerMetadata
var (
@@ -237,17 +237,17 @@ func local_request_WorkflowService_ListWorkflows_0(ctx context.Context, marshale
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_WorkflowService_ListWorkflows_0); err != nil {
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_WorkflowService_ListWorkflowExecutions_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ListWorkflows(ctx, &protoReq)
msg, err := server.ListWorkflowExecutions(ctx, &protoReq)
return msg, metadata, err
}
func request_WorkflowService_WatchWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (WorkflowService_WatchWorkflowClient, runtime.ServerMetadata, error) {
var protoReq WatchWorkflowRequest
func request_WorkflowService_WatchWorkflowExecution_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (WorkflowService_WatchWorkflowExecutionClient, runtime.ServerMetadata, error) {
var protoReq WatchWorkflowExecutionRequest
var metadata runtime.ServerMetadata
var (
@@ -279,7 +279,7 @@ func request_WorkflowService_WatchWorkflow_0(ctx context.Context, marshaler runt
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
stream, err := client.WatchWorkflow(ctx, &protoReq)
stream, err := client.WatchWorkflowExecution(ctx, &protoReq)
if err != nil {
return nil, metadata, err
}
@@ -292,8 +292,8 @@ func request_WorkflowService_WatchWorkflow_0(ctx context.Context, marshaler runt
}
func request_WorkflowService_GetWorkflowLogs_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (WorkflowService_GetWorkflowLogsClient, runtime.ServerMetadata, error) {
var protoReq GetWorkflowLogsRequest
func request_WorkflowService_GetWorkflowExecutionLogs_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (WorkflowService_GetWorkflowExecutionLogsClient, runtime.ServerMetadata, error) {
var protoReq GetWorkflowExecutionLogsRequest
var metadata runtime.ServerMetadata
var (
@@ -347,7 +347,7 @@ func request_WorkflowService_GetWorkflowLogs_0(ctx context.Context, marshaler ru
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "containerName", err)
}
stream, err := client.GetWorkflowLogs(ctx, &protoReq)
stream, err := client.GetWorkflowExecutionLogs(ctx, &protoReq)
if err != nil {
return nil, metadata, err
}
@@ -360,8 +360,8 @@ func request_WorkflowService_GetWorkflowLogs_0(ctx context.Context, marshaler ru
}
func request_WorkflowService_GetWorkflowMetrics_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetWorkflowMetricsRequest
func request_WorkflowService_GetWorkflowExecutionMetrics_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetWorkflowExecutionMetricsRequest
var metadata runtime.ServerMetadata
var (
@@ -404,13 +404,13 @@ func request_WorkflowService_GetWorkflowMetrics_0(ctx context.Context, marshaler
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "podName", err)
}
msg, err := client.GetWorkflowMetrics(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
msg, err := client.GetWorkflowExecutionMetrics(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_WorkflowService_GetWorkflowMetrics_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetWorkflowMetricsRequest
func local_request_WorkflowService_GetWorkflowExecutionMetrics_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetWorkflowExecutionMetricsRequest
var metadata runtime.ServerMetadata
var (
@@ -453,13 +453,13 @@ func local_request_WorkflowService_GetWorkflowMetrics_0(ctx context.Context, mar
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "podName", err)
}
msg, err := server.GetWorkflowMetrics(ctx, &protoReq)
msg, err := server.GetWorkflowExecutionMetrics(ctx, &protoReq)
return msg, metadata, err
}
func request_WorkflowService_ResubmitWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ResubmitWorkflowRequest
func request_WorkflowService_ResubmitWorkflowExecution_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ResubmitWorkflowExecutionRequest
var metadata runtime.ServerMetadata
var (
@@ -491,13 +491,13 @@ func request_WorkflowService_ResubmitWorkflow_0(ctx context.Context, marshaler r
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
msg, err := client.ResubmitWorkflow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
msg, err := client.ResubmitWorkflowExecution(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_WorkflowService_ResubmitWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ResubmitWorkflowRequest
func local_request_WorkflowService_ResubmitWorkflowExecution_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ResubmitWorkflowExecutionRequest
var metadata runtime.ServerMetadata
var (
@@ -529,13 +529,13 @@ func local_request_WorkflowService_ResubmitWorkflow_0(ctx context.Context, marsh
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
msg, err := server.ResubmitWorkflow(ctx, &protoReq)
msg, err := server.ResubmitWorkflowExecution(ctx, &protoReq)
return msg, metadata, err
}
func request_WorkflowService_TerminateWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq TerminateWorkflowRequest
func request_WorkflowService_TerminateWorkflowExecution_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq TerminateWorkflowExecutionRequest
var metadata runtime.ServerMetadata
var (
@@ -567,13 +567,13 @@ func request_WorkflowService_TerminateWorkflow_0(ctx context.Context, marshaler
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
msg, err := client.TerminateWorkflow(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
msg, err := client.TerminateWorkflowExecution(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_WorkflowService_TerminateWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq TerminateWorkflowRequest
func local_request_WorkflowService_TerminateWorkflowExecution_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq TerminateWorkflowExecutionRequest
var metadata runtime.ServerMetadata
var (
@@ -605,7 +605,7 @@ func local_request_WorkflowService_TerminateWorkflow_0(ctx context.Context, mars
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
msg, err := server.TerminateWorkflow(ctx, &protoReq)
msg, err := server.TerminateWorkflowExecution(ctx, &protoReq)
return msg, metadata, err
}
@@ -1286,7 +1286,7 @@ func local_request_WorkflowService_ArchiveWorkflowTemplate_0(ctx context.Context
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterWorkflowServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WorkflowServiceServer) error {
mux.Handle("POST", pattern_WorkflowService_CreateWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_WorkflowService_CreateWorkflowExecution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1295,18 +1295,18 @@ func RegisterWorkflowServiceHandlerServer(ctx context.Context, mux *runtime.Serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_WorkflowService_CreateWorkflow_0(rctx, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_WorkflowService_CreateWorkflowExecution_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_CreateWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_WorkflowService_CreateWorkflowExecution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_WorkflowService_GetWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("GET", pattern_WorkflowService_GetWorkflowExecution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1315,18 +1315,18 @@ func RegisterWorkflowServiceHandlerServer(ctx context.Context, mux *runtime.Serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_WorkflowService_GetWorkflow_0(rctx, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_WorkflowService_GetWorkflowExecution_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_GetWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_WorkflowService_GetWorkflowExecution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_WorkflowService_ListWorkflows_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("GET", pattern_WorkflowService_ListWorkflowExecutions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1335,32 +1335,32 @@ func RegisterWorkflowServiceHandlerServer(ctx context.Context, mux *runtime.Serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_WorkflowService_ListWorkflows_0(rctx, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_WorkflowService_ListWorkflowExecutions_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_ListWorkflows_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_WorkflowService_ListWorkflowExecutions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_WorkflowService_WatchWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("GET", pattern_WorkflowService_WatchWorkflowExecution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport")
_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
})
mux.Handle("GET", pattern_WorkflowService_GetWorkflowLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("GET", pattern_WorkflowService_GetWorkflowExecutionLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport")
_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
})
mux.Handle("GET", pattern_WorkflowService_GetWorkflowMetrics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("GET", pattern_WorkflowService_GetWorkflowExecutionMetrics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1369,18 +1369,18 @@ func RegisterWorkflowServiceHandlerServer(ctx context.Context, mux *runtime.Serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_WorkflowService_GetWorkflowMetrics_0(rctx, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_WorkflowService_GetWorkflowExecutionMetrics_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_GetWorkflowMetrics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_WorkflowService_GetWorkflowExecutionMetrics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("PUT", pattern_WorkflowService_ResubmitWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("PUT", pattern_WorkflowService_ResubmitWorkflowExecution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1389,18 +1389,18 @@ func RegisterWorkflowServiceHandlerServer(ctx context.Context, mux *runtime.Serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_WorkflowService_ResubmitWorkflow_0(rctx, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_WorkflowService_ResubmitWorkflowExecution_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_ResubmitWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_WorkflowService_ResubmitWorkflowExecution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("PUT", pattern_WorkflowService_TerminateWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("PUT", pattern_WorkflowService_TerminateWorkflowExecution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1409,14 +1409,14 @@ func RegisterWorkflowServiceHandlerServer(ctx context.Context, mux *runtime.Serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_WorkflowService_TerminateWorkflow_0(rctx, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_WorkflowService_TerminateWorkflowExecution_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_TerminateWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_WorkflowService_TerminateWorkflowExecution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@@ -1621,7 +1621,7 @@ func RegisterWorkflowServiceHandler(ctx context.Context, mux *runtime.ServeMux,
// "WorkflowServiceClient" to call the correct interceptors.
func RegisterWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WorkflowServiceClient) error {
mux.Handle("POST", pattern_WorkflowService_CreateWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_WorkflowService_CreateWorkflowExecution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1630,18 +1630,18 @@ func RegisterWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.Serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_WorkflowService_CreateWorkflow_0(rctx, inboundMarshaler, client, req, pathParams)
resp, md, err := request_WorkflowService_CreateWorkflowExecution_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_CreateWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_WorkflowService_CreateWorkflowExecution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_WorkflowService_GetWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("GET", pattern_WorkflowService_GetWorkflowExecution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1650,18 +1650,18 @@ func RegisterWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.Serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_WorkflowService_GetWorkflow_0(rctx, inboundMarshaler, client, req, pathParams)
resp, md, err := request_WorkflowService_GetWorkflowExecution_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_GetWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_WorkflowService_GetWorkflowExecution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_WorkflowService_ListWorkflows_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("GET", pattern_WorkflowService_ListWorkflowExecutions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1670,18 +1670,18 @@ func RegisterWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.Serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_WorkflowService_ListWorkflows_0(rctx, inboundMarshaler, client, req, pathParams)
resp, md, err := request_WorkflowService_ListWorkflowExecutions_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_ListWorkflows_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_WorkflowService_ListWorkflowExecutions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_WorkflowService_WatchWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("GET", pattern_WorkflowService_WatchWorkflowExecution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1690,18 +1690,18 @@ func RegisterWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.Serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_WorkflowService_WatchWorkflow_0(rctx, inboundMarshaler, client, req, pathParams)
resp, md, err := request_WorkflowService_WatchWorkflowExecution_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_WatchWorkflow_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
forward_WorkflowService_WatchWorkflowExecution_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_WorkflowService_GetWorkflowLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("GET", pattern_WorkflowService_GetWorkflowExecutionLogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1710,18 +1710,18 @@ func RegisterWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.Serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_WorkflowService_GetWorkflowLogs_0(rctx, inboundMarshaler, client, req, pathParams)
resp, md, err := request_WorkflowService_GetWorkflowExecutionLogs_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_GetWorkflowLogs_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
forward_WorkflowService_GetWorkflowExecutionLogs_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_WorkflowService_GetWorkflowMetrics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("GET", pattern_WorkflowService_GetWorkflowExecutionMetrics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1730,18 +1730,18 @@ func RegisterWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.Serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_WorkflowService_GetWorkflowMetrics_0(rctx, inboundMarshaler, client, req, pathParams)
resp, md, err := request_WorkflowService_GetWorkflowExecutionMetrics_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_GetWorkflowMetrics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_WorkflowService_GetWorkflowExecutionMetrics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("PUT", pattern_WorkflowService_ResubmitWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("PUT", pattern_WorkflowService_ResubmitWorkflowExecution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1750,18 +1750,18 @@ func RegisterWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.Serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_WorkflowService_ResubmitWorkflow_0(rctx, inboundMarshaler, client, req, pathParams)
resp, md, err := request_WorkflowService_ResubmitWorkflowExecution_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_ResubmitWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_WorkflowService_ResubmitWorkflowExecution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("PUT", pattern_WorkflowService_TerminateWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("PUT", pattern_WorkflowService_TerminateWorkflowExecution_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@@ -1770,14 +1770,14 @@ func RegisterWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.Serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_WorkflowService_TerminateWorkflow_0(rctx, inboundMarshaler, client, req, pathParams)
resp, md, err := request_WorkflowService_TerminateWorkflowExecution_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_TerminateWorkflow_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_WorkflowService_TerminateWorkflowExecution_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@@ -1945,21 +1945,21 @@ func RegisterWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.Serv
}
var (
pattern_WorkflowService_CreateWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "workflows"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_CreateWorkflowExecution_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "workflow_exeuctions"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_GetWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "workflows", "name"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_GetWorkflowExecution_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "workflow_executions", "name"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_ListWorkflows_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "workflows"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_ListWorkflowExecutions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "workflows"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_WatchWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workflows", "name", "watch"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_WatchWorkflowExecution_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workflow_executions", "name", "watch"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_GetWorkflowLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8, 2, 9}, []string{"apis", "v1beta1", "namespace", "workflows", "name", "pods", "podName", "containers", "containerName", "logs"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_GetWorkflowExecutionLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8, 2, 9}, []string{"apis", "v1beta1", "namespace", "workflow_executions", "name", "pods", "podName", "containers", "containerName", "logs"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_GetWorkflowMetrics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"apis", "v1beta1", "namespace", "workflows", "name", "pods", "podName", "metrics"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_GetWorkflowExecutionMetrics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"apis", "v1beta1", "namespace", "workflow_executions", "name", "pods", "podName", "metrics"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_ResubmitWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workflows", "name", "resubmit"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_ResubmitWorkflowExecution_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workflow_executions", "name", "resubmit"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_TerminateWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workflows", "name", "terminate"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_TerminateWorkflowExecution_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workflow_executions", "name", "terminate"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_CreateWorkflowTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "workflow_templates"}, "", runtime.AssumeColonVerbOpt(true)))
@@ -1979,21 +1979,21 @@ var (
)
var (
forward_WorkflowService_CreateWorkflow_0 = runtime.ForwardResponseMessage
forward_WorkflowService_CreateWorkflowExecution_0 = runtime.ForwardResponseMessage
forward_WorkflowService_GetWorkflow_0 = runtime.ForwardResponseMessage
forward_WorkflowService_GetWorkflowExecution_0 = runtime.ForwardResponseMessage
forward_WorkflowService_ListWorkflows_0 = runtime.ForwardResponseMessage
forward_WorkflowService_ListWorkflowExecutions_0 = runtime.ForwardResponseMessage
forward_WorkflowService_WatchWorkflow_0 = runtime.ForwardResponseStream
forward_WorkflowService_WatchWorkflowExecution_0 = runtime.ForwardResponseStream
forward_WorkflowService_GetWorkflowLogs_0 = runtime.ForwardResponseStream
forward_WorkflowService_GetWorkflowExecutionLogs_0 = runtime.ForwardResponseStream
forward_WorkflowService_GetWorkflowMetrics_0 = runtime.ForwardResponseMessage
forward_WorkflowService_GetWorkflowExecutionMetrics_0 = runtime.ForwardResponseMessage
forward_WorkflowService_ResubmitWorkflow_0 = runtime.ForwardResponseMessage
forward_WorkflowService_ResubmitWorkflowExecution_0 = runtime.ForwardResponseMessage
forward_WorkflowService_TerminateWorkflow_0 = runtime.ForwardResponseMessage
forward_WorkflowService_TerminateWorkflowExecution_0 = runtime.ForwardResponseMessage
forward_WorkflowService_CreateWorkflowTemplate_0 = runtime.ForwardResponseMessage

View File

@@ -9,52 +9,52 @@ import "metric.proto";
service WorkflowService {
// Creates a Workflow
rpc CreateWorkflow (CreateWorkflowRequest) returns (Workflow) {
rpc CreateWorkflowExecution (CreateWorkflowExecutionRequest) returns (WorkflowExecution) {
option (google.api.http) = {
post: "/apis/v1beta1/{namespace}/workflows"
body: "workflow"
post: "/apis/v1beta1/{namespace}/workflow_exeuctions"
body: "workflowExecution"
};
}
rpc GetWorkflow (GetWorkflowRequest) returns (Workflow) {
rpc GetWorkflowExecution (GetWorkflowExecutionRequest) returns (WorkflowExecution) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/workflows/{name}"
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}"
};
}
rpc ListWorkflows (ListWorkflowsRequest) returns (ListWorkflowsResponse) {
rpc ListWorkflowExecutions (ListWorkflowExecutionsRequest) returns (ListWorkflowExecutionsResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/workflows"
};
}
rpc WatchWorkflow (WatchWorkflowRequest) returns (stream Workflow) {
rpc WatchWorkflowExecution (WatchWorkflowExecutionRequest) returns (stream WorkflowExecution) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/workflows/{name}/watch"
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}/watch"
};
}
rpc GetWorkflowLogs (GetWorkflowLogsRequest) returns (stream LogEntry) {
rpc GetWorkflowExecutionLogs (GetWorkflowExecutionLogsRequest) returns (stream LogEntry) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/workflows/{name}/pods/{podName}/containers/{containerName}/logs"
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}/pods/{podName}/containers/{containerName}/logs"
};
}
rpc GetWorkflowMetrics (GetWorkflowMetricsRequest) returns (GetWorkflowMetricsResponse) {
rpc GetWorkflowExecutionMetrics (GetWorkflowExecutionMetricsRequest) returns (GetWorkflowExecutionMetricsResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/workflows/{name}/pods/{podName}/metrics"
get: "/apis/v1beta1/{namespace}/workflow_executions/{name}/pods/{podName}/metrics"
};
}
rpc ResubmitWorkflow (ResubmitWorkflowRequest) returns (Workflow) {
rpc ResubmitWorkflowExecution (ResubmitWorkflowExecutionRequest) returns (WorkflowExecution) {
option (google.api.http) = {
put: "/apis/v1beta1/{namespace}/workflows/{name}/resubmit"
put: "/apis/v1beta1/{namespace}/workflow_executions/{name}/resubmit"
};
}
rpc TerminateWorkflow (TerminateWorkflowRequest) returns (google.protobuf.Empty) {
rpc TerminateWorkflowExecution (TerminateWorkflowExecutionRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
put: "/apis/v1beta1/{namespace}/workflows/{name}/terminate"
put: "/apis/v1beta1/{namespace}/workflow_executions/{name}/terminate"
};
}
@@ -107,49 +107,49 @@ service WorkflowService {
}
}
message CreateWorkflowRequest {
message CreateWorkflowExecutionRequest {
string namespace = 1;
Workflow workflow = 2;
WorkflowExecution workflowExecution = 2;
}
message GetWorkflowRequest {
message GetWorkflowExecutionRequest {
string namespace = 1;
string name = 2;
}
message WatchWorkflowRequest {
message WatchWorkflowExecutionRequest {
string namespace = 1;
string name = 2;
}
message ResubmitWorkflowRequest {
message ResubmitWorkflowExecutionRequest {
string namespace = 1;
string name = 2;
}
message TerminateWorkflowRequest {
message TerminateWorkflowExecutionRequest {
string namespace = 1;
string name = 2;
}
message GetWorkflowLogsRequest {
message GetWorkflowExecutionLogsRequest {
string namespace = 1;
string name = 2;
string podName = 3;
string containerName = 4;
}
message GetWorkflowMetricsRequest {
message GetWorkflowExecutionMetricsRequest {
string namespace = 1;
string name = 2;
string podName = 3;
}
message GetWorkflowMetricsResponse {
message GetWorkflowExecutionMetricsResponse {
repeated Metric metrics = 1;
}
message ListWorkflowsRequest {
message ListWorkflowExecutionsRequest {
string namespace = 1;
string workflowTemplateUid = 2;
string workflowTemplateVersion = 3;
@@ -157,9 +157,9 @@ message ListWorkflowsRequest {
int32 page = 5;
}
message ListWorkflowsResponse {
message ListWorkflowExecutionsResponse {
int32 count = 1;
repeated Workflow workflows = 2;
repeated WorkflowExecution workflowExecutions = 2;
int32 page = 3;
int32 pages = 4;
int32 totalCount = 5;
@@ -170,7 +170,7 @@ message LogEntry {
string content = 2;
}
message Workflow {
message WorkflowExecution {
string createdAt = 1;
string uid = 2;
string name = 3;
@@ -179,12 +179,12 @@ message Workflow {
string finishedAt = 6;
string manifest = 7;
repeated WorkflowParameter parameters = 8;
repeated WorkflowExecutionParameter parameters = 8;
WorkflowTemplate workflowTemplate = 9;
}
message WorkflowParameter {
message WorkflowExecutionParameter {
string name = 1;
string value = 2;
}

View File

@@ -11,6 +11,237 @@
"application/json"
],
"paths": {
"/apis/v1beta1/{namespace}/workflow_executions/{name}": {
"get": {
"operationId": "GetWorkflowExecution",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/apiWorkflowExecution"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "name",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/apis/v1beta1/{namespace}/workflow_executions/{name}/pods/{podName}/containers/{containerName}/logs": {
"get": {
"operationId": "GetWorkflowExecutionLogs",
"responses": {
"200": {
"description": "A successful response.(streaming responses)",
"schema": {
"$ref": "#/x-stream-definitions/apiLogEntry"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "name",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "podName",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "containerName",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/apis/v1beta1/{namespace}/workflow_executions/{name}/pods/{podName}/metrics": {
"get": {
"operationId": "GetWorkflowExecutionMetrics",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/apiGetWorkflowExecutionMetricsResponse"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "name",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "podName",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/apis/v1beta1/{namespace}/workflow_executions/{name}/resubmit": {
"put": {
"operationId": "ResubmitWorkflowExecution",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/apiWorkflowExecution"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "name",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/apis/v1beta1/{namespace}/workflow_executions/{name}/terminate": {
"put": {
"operationId": "TerminateWorkflowExecution",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "name",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/apis/v1beta1/{namespace}/workflow_executions/{name}/watch": {
"get": {
"operationId": "WatchWorkflowExecution",
"responses": {
"200": {
"description": "A successful response.(streaming responses)",
"schema": {
"$ref": "#/x-stream-definitions/apiWorkflowExecution"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "name",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/apis/v1beta1/{namespace}/workflow_exeuctions": {
"post": {
"summary": "Creates a Workflow",
"operationId": "CreateWorkflowExecution",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/apiWorkflowExecution"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/apiWorkflowExecution"
}
}
],
"tags": [
"WorkflowService"
]
}
},
"/apis/v1beta1/{namespace}/workflow_templates": {
"get": {
"operationId": "ListWorkflowTemplates",
@@ -284,12 +515,12 @@
},
"/apis/v1beta1/{namespace}/workflows": {
"get": {
"operationId": "ListWorkflows",
"operationId": "ListWorkflowExecutions",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/apiListWorkflowsResponse"
"$ref": "#/definitions/apiListWorkflowExecutionsResponse"
}
}
},
@@ -330,235 +561,6 @@
"tags": [
"WorkflowService"
]
},
"post": {
"summary": "Creates a Workflow",
"operationId": "CreateWorkflow",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/apiWorkflow"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/apiWorkflow"
}
}
],
"tags": [
"WorkflowService"
]
}
},
"/apis/v1beta1/{namespace}/workflows/{name}": {
"get": {
"operationId": "GetWorkflow",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/apiWorkflow"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "name",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/apis/v1beta1/{namespace}/workflows/{name}/pods/{podName}/containers/{containerName}/logs": {
"get": {
"operationId": "GetWorkflowLogs",
"responses": {
"200": {
"description": "A successful response.(streaming responses)",
"schema": {
"$ref": "#/x-stream-definitions/apiLogEntry"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "name",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "podName",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "containerName",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/apis/v1beta1/{namespace}/workflows/{name}/pods/{podName}/metrics": {
"get": {
"operationId": "GetWorkflowMetrics",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/apiGetWorkflowMetricsResponse"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "name",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "podName",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/apis/v1beta1/{namespace}/workflows/{name}/resubmit": {
"put": {
"operationId": "ResubmitWorkflow",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/apiWorkflow"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "name",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/apis/v1beta1/{namespace}/workflows/{name}/terminate": {
"put": {
"operationId": "TerminateWorkflow",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"properties": {}
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "name",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/apis/v1beta1/{namespace}/workflows/{name}/watch": {
"get": {
"operationId": "WatchWorkflow",
"responses": {
"200": {
"description": "A successful response.(streaming responses)",
"schema": {
"$ref": "#/x-stream-definitions/apiWorkflow"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "name",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
}
},
@@ -571,7 +573,7 @@
}
}
},
"apiGetWorkflowMetricsResponse": {
"apiGetWorkflowExecutionMetricsResponse": {
"type": "object",
"properties": {
"metrics": {
@@ -582,6 +584,33 @@
}
}
},
"apiListWorkflowExecutionsResponse": {
"type": "object",
"properties": {
"count": {
"type": "integer",
"format": "int32"
},
"workflowExecutions": {
"type": "array",
"items": {
"$ref": "#/definitions/apiWorkflowExecution"
}
},
"page": {
"type": "integer",
"format": "int32"
},
"pages": {
"type": "integer",
"format": "int32"
},
"totalCount": {
"type": "integer",
"format": "int32"
}
}
},
"apiListWorkflowTemplateVersionsResponse": {
"type": "object",
"properties": {
@@ -612,33 +641,6 @@
}
}
},
"apiListWorkflowsResponse": {
"type": "object",
"properties": {
"count": {
"type": "integer",
"format": "int32"
},
"workflows": {
"type": "array",
"items": {
"$ref": "#/definitions/apiWorkflow"
}
},
"page": {
"type": "integer",
"format": "int32"
},
"pages": {
"type": "integer",
"format": "int32"
},
"totalCount": {
"type": "integer",
"format": "int32"
}
}
},
"apiLogEntry": {
"type": "object",
"properties": {
@@ -665,7 +667,7 @@
}
}
},
"apiWorkflow": {
"apiWorkflowExecution": {
"type": "object",
"properties": {
"createdAt": {
@@ -692,7 +694,7 @@
"parameters": {
"type": "array",
"items": {
"$ref": "#/definitions/apiWorkflowParameter"
"$ref": "#/definitions/apiWorkflowExecutionParameter"
}
},
"workflowTemplate": {
@@ -700,7 +702,7 @@
}
}
},
"apiWorkflowParameter": {
"apiWorkflowExecutionParameter": {
"type": "object",
"properties": {
"name": {
@@ -791,17 +793,17 @@
},
"title": "Stream result of apiLogEntry"
},
"apiWorkflow": {
"apiWorkflowExecution": {
"type": "object",
"properties": {
"result": {
"$ref": "#/definitions/apiWorkflow"
"$ref": "#/definitions/apiWorkflowExecution"
},
"error": {
"$ref": "#/definitions/runtimeStreamError"
}
},
"title": "Stream result of apiWorkflow"
"title": "Stream result of apiWorkflowExecution"
}
}
}

View File

@@ -60,31 +60,31 @@ func (wt *WorkflowTemplate) GenerateUID() (string, error) {
}
const (
WorfklowPending WorkflowPhase = "Pending"
WorfklowRunning WorkflowPhase = "Running"
WorfklowSucceeded WorkflowPhase = "Succeeded"
WorfklowSkipped WorkflowPhase = "Skipped"
WorfklowFailed WorkflowPhase = "Failed"
WorfklowError WorkflowPhase = "Error"
WorfklowPending WorkflowExecutionPhase = "Pending"
WorfklowRunning WorkflowExecutionPhase = "Running"
WorfklowSucceeded WorkflowExecutionPhase = "Succeeded"
WorfklowSkipped WorkflowExecutionPhase = "Skipped"
WorfklowFailed WorkflowExecutionPhase = "Failed"
WorfklowError WorkflowExecutionPhase = "Error"
)
type WorkflowPhase string
type WorkflowExecutionPhase string
type Workflow struct {
type WorkflowExecution struct {
ID uint64
CreatedAt time.Time `db:"created_at"`
UID string
Name string
GenerateName string
Parameters []WorkflowParameter
Parameters []WorkflowExecutionParameter
Manifest string
Phase WorkflowPhase
Phase WorkflowExecutionPhase
StartedAt time.Time
FinishedAt time.Time
WorkflowTemplate *WorkflowTemplate
}
type WorkflowParameter struct {
type WorkflowExecutionParameter struct {
Name string
Value *string
}
@@ -93,11 +93,11 @@ type ListOptions = metav1.ListOptions
type PodGCStrategy = wfv1.PodGCStrategy
type WorkflowOptions struct {
type WorkflowExecutionOptions struct {
Name string
GenerateName string
Entrypoint string
Parameters []WorkflowParameter
Parameters []WorkflowExecutionParameter
ServiceAccount string
Labels *map[string]string
ListOptions *ListOptions

View File

@@ -38,12 +38,12 @@ var (
workflowTemplateVersionLabelKey = "onepanel.io/workflow-template-version"
)
func typeWorkflow(wf *wfv1.Workflow) (workflow *Workflow) {
func typeWorkflow(wf *wfv1.Workflow) (workflow *WorkflowExecution) {
manifest, err := json.Marshal(wf)
if err != nil {
return
}
workflow = &Workflow{
workflow = &WorkflowExecution{
UID: string(wf.UID),
CreatedAt: wf.CreationTimestamp.UTC(),
Name: wf.Name,
@@ -71,7 +71,7 @@ func unmarshalWorkflows(wfBytes []byte, strict bool) (wfs []wfv1.Workflow, err e
return
}
func (c *Client) injectAutomatedFields(namespace string, wf *wfv1.Workflow, opts *WorkflowOptions) (err error) {
func (c *Client) injectAutomatedFields(namespace string, wf *wfv1.Workflow, opts *WorkflowExecutionOptions) (err error) {
if opts.PodGCStrategy == nil {
if wf.Spec.PodGC == nil {
//TODO - Load this data from onepanel config-map or secret
@@ -167,9 +167,9 @@ func (c *Client) injectAutomatedFields(namespace string, wf *wfv1.Workflow, opts
return
}
func (c *Client) create(namespace string, wf *wfv1.Workflow, opts *WorkflowOptions) (createdWorkflow *wfv1.Workflow, err error) {
func (c *Client) create(namespace string, wf *wfv1.Workflow, opts *WorkflowExecutionOptions) (createdWorkflow *wfv1.Workflow, err error) {
if opts == nil {
opts = &WorkflowOptions{}
opts = &WorkflowExecutionOptions{}
}
if opts.Name != "" {
@@ -220,7 +220,7 @@ func (c *Client) create(namespace string, wf *wfv1.Workflow, opts *WorkflowOptio
return
}
func (c *Client) ValidateWorkflow(namespace string, manifest []byte) (err error) {
func (c *Client) ValidateWorkflowExecution(namespace string, manifest []byte) (err error) {
workflows, err := unmarshalWorkflows(manifest, true)
if err != nil {
return
@@ -228,7 +228,7 @@ func (c *Client) ValidateWorkflow(namespace string, manifest []byte) (err error)
wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(c.ArgoprojV1alpha1().WorkflowTemplates(namespace))
for _, wf := range workflows {
c.injectAutomatedFields(namespace, &wf, &WorkflowOptions{})
c.injectAutomatedFields(namespace, &wf, &WorkflowExecutionOptions{})
err = validate.ValidateWorkflow(wftmplGetter, &wf, validate.ValidateOpts{})
if err != nil {
return
@@ -238,7 +238,7 @@ func (c *Client) ValidateWorkflow(namespace string, manifest []byte) (err error)
return
}
func (c *Client) CreateWorkflow(namespace string, workflow *Workflow) (*Workflow, error) {
func (c *Client) CreateWorkflowExecution(namespace string, workflow *WorkflowExecution) (*WorkflowExecution, error) {
workflowTemplate, err := c.GetWorkflowTemplate(namespace, workflow.WorkflowTemplate.UID, workflow.WorkflowTemplate.Version)
if err != nil {
log.WithFields(log.Fields{
@@ -250,11 +250,11 @@ func (c *Client) CreateWorkflow(namespace string, workflow *Workflow) (*Workflow
}
// TODO: Need to pull system parameters from k8s config/secret here, example: HOST
opts := &WorkflowOptions{}
opts := &WorkflowExecutionOptions{}
re, _ := regexp.Compile(`[^a-zA-Z0-9-]{1,}`)
opts.GenerateName = strings.ToLower(re.ReplaceAllString(workflowTemplate.Name, `-`)) + "-"
for _, param := range workflow.Parameters {
opts.Parameters = append(opts.Parameters, WorkflowParameter{
opts.Parameters = append(opts.Parameters, WorkflowExecutionParameter{
Name: param.Name,
Value: param.Value,
})
@@ -299,7 +299,7 @@ func (c *Client) CreateWorkflow(namespace string, workflow *Workflow) (*Workflow
return workflow, nil
}
func (c *Client) GetWorkflow(namespace, name string) (workflow *Workflow, err error) {
func (c *Client) GetWorkflowExecution(namespace, name string) (workflow *WorkflowExecution, err error) {
wf, err := c.ArgoprojV1alpha1().Workflows(namespace).Get(name, metav1.GetOptions{})
if err != nil {
log.WithFields(log.Fields{
@@ -344,11 +344,11 @@ func (c *Client) GetWorkflow(namespace, name string) (workflow *Workflow, err er
}).Error("Invalid status.")
return nil, util.NewUserError(codes.InvalidArgument, "Invalid status.")
}
workflow = &Workflow{
workflow = &WorkflowExecution{
UID: string(wf.UID),
CreatedAt: wf.CreationTimestamp.UTC(),
Name: wf.Name,
Phase: WorkflowPhase(wf.Status.Phase),
Phase: WorkflowExecutionPhase(wf.Status.Phase),
StartedAt: wf.Status.StartedAt.UTC(),
FinishedAt: wf.Status.FinishedAt.UTC(),
Manifest: string(manifest),
@@ -358,8 +358,8 @@ func (c *Client) GetWorkflow(namespace, name string) (workflow *Workflow, err er
return
}
func (c *Client) ListWorkflows(namespace, workflowTemplateUID, workflowTemplateVersion string) (workflows []*Workflow, err error) {
opts := &WorkflowOptions{}
func (c *Client) ListWorkflowExecutions(namespace, workflowTemplateUID, workflowTemplateVersion string) (workflows []*WorkflowExecution, err error) {
opts := &WorkflowExecutionOptions{}
if workflowTemplateUID != "" {
labelSelect := fmt.Sprintf("%s=%s", workflowTemplateUIDLabelKey, workflowTemplateUID)
@@ -391,10 +391,10 @@ func (c *Client) ListWorkflows(namespace, workflowTemplateUID, workflowTemplateV
})
for _, wf := range wfs {
workflows = append(workflows, &Workflow{
workflows = append(workflows, &WorkflowExecution{
Name: wf.ObjectMeta.Name,
UID: string(wf.ObjectMeta.UID),
Phase: WorkflowPhase(wf.Status.Phase),
Phase: WorkflowExecutionPhase(wf.Status.Phase),
StartedAt: wf.Status.StartedAt.UTC(),
FinishedAt: wf.Status.FinishedAt.UTC(),
CreatedAt: wf.CreationTimestamp.UTC(),
@@ -404,8 +404,8 @@ func (c *Client) ListWorkflows(namespace, workflowTemplateUID, workflowTemplateV
return
}
func (c *Client) WatchWorkflow(namespace, name string) (<-chan *Workflow, error) {
_, err := c.GetWorkflow(namespace, name)
func (c *Client) WatchWorkflowExecution(namespace, name string) (<-chan *WorkflowExecution, error) {
_, err := c.GetWorkflowExecution(namespace, name)
if err != nil {
log.WithFields(log.Fields{
"Namespace": namespace,
@@ -429,7 +429,7 @@ func (c *Client) WatchWorkflow(namespace, name string) (<-chan *Workflow, error)
}
var workflow *wfv1.Workflow
workflowWatcher := make(chan *Workflow)
workflowWatcher := make(chan *WorkflowExecution)
ticker := time.NewTicker(time.Second)
go func() {
for {
@@ -452,7 +452,7 @@ func (c *Client) WatchWorkflow(namespace, name string) (<-chan *Workflow, error)
}).Error("Error with trying to JSON Marshal workflow.Status.")
continue
}
workflowWatcher <- &Workflow{
workflowWatcher <- &WorkflowExecution{
UID: string(workflow.UID),
Name: workflow.Name,
Manifest: string(manifest),
@@ -469,7 +469,7 @@ func (c *Client) WatchWorkflow(namespace, name string) (<-chan *Workflow, error)
return workflowWatcher, nil
}
func (c *Client) GetWorkflowLogs(namespace, name, podName, containerName string) (<-chan *LogEntry, error) {
func (c *Client) GetWorkflowExecutionLogs(namespace, name, podName, containerName string) (<-chan *LogEntry, error) {
wf, err := c.ArgoprojV1alpha1().Workflows(namespace).Get(name, metav1.GetOptions{})
if err != nil {
log.WithFields(log.Fields{
@@ -564,8 +564,8 @@ func (c *Client) GetWorkflowLogs(namespace, name, podName, containerName string)
return logWatcher, err
}
func (c *Client) GetWorkflowMetrics(namespace, name, podName string) (metrics []*Metric, err error) {
_, err = c.GetWorkflow(namespace, name)
func (c *Client) GetWorkflowExecutionMetrics(namespace, name, podName string) (metrics []*Metric, err error) {
_, err = c.GetWorkflowExecution(namespace, name)
if err != nil {
return nil, util.NewUserError(codes.NotFound, "Workflow not found.")
}
@@ -633,7 +633,7 @@ func (c *Client) GetWorkflowMetrics(namespace, name, podName string) (metrics []
return
}
func (c *Client) RetryWorkflow(namespace, name string) (workflow *Workflow, err error) {
func (c *Client) RetryWorkflowExecution(namespace, name string) (workflow *WorkflowExecution, err error) {
wf, err := c.ArgoprojV1alpha1().Workflows(namespace).Get(name, metav1.GetOptions{})
if err != nil {
return
@@ -646,7 +646,7 @@ func (c *Client) RetryWorkflow(namespace, name string) (workflow *Workflow, err
return
}
func (c *Client) ResubmitWorkflow(namespace, name string) (workflow *Workflow, err error) {
func (c *Client) ResubmitWorkflowExecution(namespace, name string) (workflow *WorkflowExecution, err error) {
wf, err := c.ArgoprojV1alpha1().Workflows(namespace).Get(name, metav1.GetOptions{})
if err != nil {
return
@@ -667,7 +667,7 @@ func (c *Client) ResubmitWorkflow(namespace, name string) (workflow *Workflow, e
return
}
func (c *Client) ResumeWorkflow(namespace, name string) (workflow *Workflow, err error) {
func (c *Client) ResumeWorkflowExecution(namespace, name string) (workflow *WorkflowExecution, err error) {
err = argoutil.ResumeWorkflow(c.ArgoprojV1alpha1().Workflows(namespace), name)
if err != nil {
return
@@ -680,13 +680,13 @@ func (c *Client) ResumeWorkflow(namespace, name string) (workflow *Workflow, err
return
}
func (c *Client) SuspendWorkflow(namespace, name string) (err error) {
func (c *Client) SuspendWorkflowExecution(namespace, name string) (err error) {
err = argoutil.SuspendWorkflow(c.ArgoprojV1alpha1().Workflows(namespace), name)
return
}
func (c *Client) TerminateWorkflow(namespace, name string) (err error) {
func (c *Client) TerminateWorkflowExecution(namespace, name string) (err error) {
err = argoutil.TerminateWorkflow(c.ArgoprojV1alpha1().Workflows(namespace), name)
return

View File

@@ -214,7 +214,7 @@ func (c *Client) archiveWorkflowTemplate(namespace, uid string) (bool, error) {
func (c *Client) CreateWorkflowTemplate(namespace string, workflowTemplate *WorkflowTemplate) (*WorkflowTemplate, error) {
// validate workflow template
if err := c.ValidateWorkflow(namespace, workflowTemplate.GetManifestBytes()); err != nil {
if err := c.ValidateWorkflowExecution(namespace, workflowTemplate.GetManifestBytes()); err != nil {
log.WithFields(log.Fields{
"Namespace": namespace,
"WorkflowTemplate": workflowTemplate,
@@ -238,7 +238,7 @@ func (c *Client) CreateWorkflowTemplate(namespace string, workflowTemplate *Work
func (c *Client) CreateWorkflowTemplateVersion(namespace string, workflowTemplate *WorkflowTemplate) (*WorkflowTemplate, error) {
// validate workflow template
if err := c.ValidateWorkflow(namespace, workflowTemplate.GetManifestBytes()); err != nil {
if err := c.ValidateWorkflowExecution(namespace, workflowTemplate.GetManifestBytes()); err != nil {
log.WithFields(log.Fields{
"Namespace": namespace,
"WorkflowTemplate": workflowTemplate,
@@ -274,7 +274,7 @@ func (c *Client) CreateWorkflowTemplateVersion(namespace string, workflowTemplat
func (c *Client) UpdateWorkflowTemplateVersion(namespace string, workflowTemplate *WorkflowTemplate) (*WorkflowTemplate, error) {
// validate workflow template
if err := c.ValidateWorkflow(namespace, workflowTemplate.GetManifestBytes()); err != nil {
if err := c.ValidateWorkflowExecution(namespace, workflowTemplate.GetManifestBytes()); err != nil {
log.WithFields(log.Fields{
"Namespace": namespace,
"WorkflowTemplate": workflowTemplate,

View File

@@ -19,8 +19,8 @@ func NewWorkflowServer() *WorkflowServer {
return &WorkflowServer{}
}
func apiWorkflow(wf *v1.Workflow) (workflow *api.Workflow) {
workflow = &api.Workflow{
func apiWorkflowExecution(wf *v1.WorkflowExecution) (workflow *api.WorkflowExecution) {
workflow = &api.WorkflowExecution{
CreatedAt: wf.CreatedAt.Format(time.RFC3339),
Name: wf.Name,
Uid: wf.UID,
@@ -57,64 +57,64 @@ func apiWorkflowTemplate(wft *v1.WorkflowTemplate) *api.WorkflowTemplate {
}
}
func (s *WorkflowServer) CreateWorkflow(ctx context.Context, req *api.CreateWorkflowRequest) (*api.Workflow, error) {
func (s *WorkflowServer) CreateWorkflowExecution(ctx context.Context, req *api.CreateWorkflowExecutionRequest) (*api.WorkflowExecution, error) {
client := ctx.Value("kubeClient").(*v1.Client)
allowed, err := auth.IsAuthorized(client, req.Namespace, "create", "argoproj.io", "workflows", "")
if err != nil || !allowed {
return nil, err
}
workflow := &v1.Workflow{
workflow := &v1.WorkflowExecution{
WorkflowTemplate: &v1.WorkflowTemplate{
UID: req.Workflow.WorkflowTemplate.Uid,
Version: req.Workflow.WorkflowTemplate.Version,
UID: req.WorkflowExecution.WorkflowTemplate.Uid,
Version: req.WorkflowExecution.WorkflowTemplate.Version,
},
}
for _, param := range req.Workflow.Parameters {
workflow.Parameters = append(workflow.Parameters, v1.WorkflowParameter{
for _, param := range req.WorkflowExecution.Parameters {
workflow.Parameters = append(workflow.Parameters, v1.WorkflowExecutionParameter{
Name: param.Name,
Value: ptr.String(param.Value),
})
}
wf, err := client.CreateWorkflow(req.Namespace, workflow)
wf, err := client.CreateWorkflowExecution(req.Namespace, workflow)
if err != nil {
if errors.As(err, &userError) {
return nil, userError.GRPCError()
}
}
return apiWorkflow(wf), nil
return apiWorkflowExecution(wf), nil
}
func (s *WorkflowServer) GetWorkflow(ctx context.Context, req *api.GetWorkflowRequest) (*api.Workflow, error) {
func (s *WorkflowServer) GetWorkflowExecution(ctx context.Context, req *api.GetWorkflowExecutionRequest) (*api.WorkflowExecution, error) {
client := ctx.Value("kubeClient").(*v1.Client)
allowed, err := auth.IsAuthorized(client, req.Namespace, "get", "argoproj.io", "workflows", req.Name)
if err != nil || !allowed {
return nil, err
}
wf, err := client.GetWorkflow(req.Namespace, req.Name)
wf, err := client.GetWorkflowExecution(req.Namespace, req.Name)
if errors.As(err, &userError) {
return nil, userError.GRPCError()
}
return apiWorkflow(wf), nil
return apiWorkflowExecution(wf), nil
}
func (s *WorkflowServer) WatchWorkflow(req *api.WatchWorkflowRequest, stream api.WorkflowService_WatchWorkflowServer) error {
func (s *WorkflowServer) WatchWorkflowExecution(req *api.WatchWorkflowExecutionRequest, stream api.WorkflowService_WatchWorkflowExecutionServer) error {
client := stream.Context().Value("kubeClient").(*v1.Client)
allowed, err := auth.IsAuthorized(client, req.Namespace, "get", "argoproj.io", "workflows", req.Name)
if err != nil || !allowed {
return err
}
watcher, err := client.WatchWorkflow(req.Namespace, req.Name)
watcher, err := client.WatchWorkflowExecution(req.Namespace, req.Name)
if errors.As(err, &userError) {
return userError.GRPCError()
}
wf := &v1.Workflow{}
wf := &v1.WorkflowExecution{}
ticker := time.NewTicker(time.Second)
for {
select {
@@ -125,7 +125,7 @@ func (s *WorkflowServer) WatchWorkflow(req *api.WatchWorkflowRequest, stream api
if wf == nil {
break
}
if err := stream.Send(apiWorkflow(wf)); err != nil {
if err := stream.Send(apiWorkflowExecution(wf)); err != nil {
return err
}
}
@@ -133,14 +133,14 @@ func (s *WorkflowServer) WatchWorkflow(req *api.WatchWorkflowRequest, stream api
return nil
}
func (s *WorkflowServer) GetWorkflowLogs(req *api.GetWorkflowLogsRequest, stream api.WorkflowService_GetWorkflowLogsServer) error {
func (s *WorkflowServer) GetWorkflowExecutionLogs(req *api.GetWorkflowExecutionLogsRequest, stream api.WorkflowService_GetWorkflowExecutionLogsServer) error {
client := stream.Context().Value("kubeClient").(*v1.Client)
allowed, err := auth.IsAuthorized(client, req.Namespace, "get", "argoproj.io", "workflows", req.Name)
if err != nil || !allowed {
return err
}
watcher, err := client.GetWorkflowLogs(req.Namespace, req.Name, req.PodName, req.ContainerName)
watcher, err := client.GetWorkflowExecutionLogs(req.Namespace, req.Name, req.PodName, req.ContainerName)
if errors.As(err, &userError) {
return userError.GRPCError()
}
@@ -167,14 +167,14 @@ func (s *WorkflowServer) GetWorkflowLogs(req *api.GetWorkflowLogsRequest, stream
return nil
}
func (s *WorkflowServer) GetWorkflowMetrics(ctx context.Context, req *api.GetWorkflowMetricsRequest) (*api.GetWorkflowMetricsResponse, error) {
func (s *WorkflowServer) GetWorkflowExecutionMetrics(ctx context.Context, req *api.GetWorkflowExecutionMetricsRequest) (*api.GetWorkflowExecutionMetricsResponse, error) {
client := ctx.Value("kubeClient").(*v1.Client)
allowed, err := auth.IsAuthorized(client, req.Namespace, "get", "argoproj.io", "workflows", req.Name)
if err != nil || !allowed {
return nil, err
}
metrics, err := client.GetWorkflowMetrics(req.Namespace, req.Name, req.PodName)
metrics, err := client.GetWorkflowExecutionMetrics(req.Namespace, req.Name, req.PodName)
if errors.As(err, &userError) {
return nil, userError.GRPCError()
}
@@ -188,10 +188,10 @@ func (s *WorkflowServer) GetWorkflowMetrics(ctx context.Context, req *api.GetWor
})
}
return &api.GetWorkflowMetricsResponse{Metrics: apiMetrics}, nil
return &api.GetWorkflowExecutionMetricsResponse{Metrics: apiMetrics}, nil
}
func (s *WorkflowServer) ListWorkflows(ctx context.Context, req *api.ListWorkflowsRequest) (*api.ListWorkflowsResponse, error) {
func (s *WorkflowServer) ListWorkflowExecutions(ctx context.Context, req *api.ListWorkflowExecutionsRequest) (*api.ListWorkflowExecutionsResponse, error) {
client := ctx.Value("kubeClient").(*v1.Client)
allowed, err := auth.IsAuthorized(client, req.Namespace, "list", "argoproj.io", "workflows", "")
if err != nil || !allowed {
@@ -202,17 +202,17 @@ func (s *WorkflowServer) ListWorkflows(ctx context.Context, req *api.ListWorkflo
req.PageSize = 15
}
workflows, err := client.ListWorkflows(req.Namespace, req.WorkflowTemplateUid, req.WorkflowTemplateVersion)
workflows, err := client.ListWorkflowExecutions(req.Namespace, req.WorkflowTemplateUid, req.WorkflowTemplateVersion)
if errors.As(err, &userError) {
return nil, userError.GRPCError()
}
var apiWorkflows []*api.Workflow
var apiWorkflowExecutions []*api.WorkflowExecution
for _, wf := range workflows {
apiWorkflows = append(apiWorkflows, apiWorkflow(wf))
apiWorkflowExecutions = append(apiWorkflowExecutions, apiWorkflowExecution(wf))
}
pages := int32(math.Ceil(float64(len(apiWorkflows)) / float64(req.PageSize)))
pages := int32(math.Ceil(float64(len(apiWorkflowExecutions)) / float64(req.PageSize)))
if req.Page > pages {
req.Page = pages
}
@@ -223,42 +223,42 @@ func (s *WorkflowServer) ListWorkflows(ctx context.Context, req *api.ListWorkflo
start := (req.Page - 1) * req.PageSize
end := start + req.PageSize
if end >= int32(len(apiWorkflows)) {
end = int32(len(apiWorkflows))
if end >= int32(len(apiWorkflowExecutions)) {
end = int32(len(apiWorkflowExecutions))
}
return &api.ListWorkflowsResponse{
return &api.ListWorkflowExecutionsResponse{
Count: end - start,
Workflows: apiWorkflows[start:end],
WorkflowExecutions: apiWorkflowExecutions[start:end],
Page: req.Page,
Pages: pages,
TotalCount: int32(len(apiWorkflows)),
TotalCount: int32(len(apiWorkflowExecutions)),
}, nil
}
func (s *WorkflowServer) ResubmitWorkflow(ctx context.Context, req *api.ResubmitWorkflowRequest) (*api.Workflow, error) {
func (s *WorkflowServer) ResubmitWorkflowExecution(ctx context.Context, req *api.ResubmitWorkflowExecutionRequest) (*api.WorkflowExecution, error) {
client := ctx.Value("kubeClient").(*v1.Client)
allowed, err := auth.IsAuthorized(client, req.Namespace, "create", "argoproj.io", "workflows", req.Name)
if err != nil || !allowed {
return nil, err
}
wf, err := client.ResubmitWorkflow(req.Namespace, req.Name)
wf, err := client.ResubmitWorkflowExecution(req.Namespace, req.Name)
if errors.As(err, &userError) {
return nil, userError.GRPCError()
}
return apiWorkflow(wf), nil
return apiWorkflowExecution(wf), nil
}
func (s *WorkflowServer) TerminateWorkflow(ctx context.Context, req *api.TerminateWorkflowRequest) (*empty.Empty, error) {
func (s *WorkflowServer) TerminateWorkflowExecution(ctx context.Context, req *api.TerminateWorkflowExecutionRequest) (*empty.Empty, error) {
client := ctx.Value("kubeClient").(*v1.Client)
allowed, err := auth.IsAuthorized(client, req.Namespace, "update", "argoproj.io", "workflows", "")
if err != nil || !allowed {
return nil, err
}
err = client.TerminateWorkflow(req.Namespace, req.Name)
err = client.TerminateWorkflowExecution(req.Namespace, req.Name)
if errors.As(err, &userError) {
return nil, userError.GRPCError()
}