add ListWorkflowTemplates

This commit is contained in:
rushtehrani
2019-12-19 11:15:53 -08:00
parent bdcd517135
commit 3d5aeccaa1
9 changed files with 397 additions and 83 deletions

View File

@@ -163,3 +163,20 @@ func (s *WorkflowServer) ListWorkflowTemplateVersions(ctx context.Context, req *
WorkflowTemplates: workflowTemplates,
}, nil
}
func (s *WorkflowServer) ListWorkflowTemplates(ctx context.Context, req *api.ListWorkflowTemplatesRequest) (*api.ListWorkflowTemplatesResponse, error) {
workflowTemplates, err := s.resourceManager.ListWorkflowTemplates(req.Namespace)
if errors.As(err, &userError) {
return nil, userError.GRPCError()
}
apiWorkflowTemplates := []*api.WorkflowTemplate{}
for _, wtv := range workflowTemplates {
apiWorkflowTemplates = append(apiWorkflowTemplates, apiWorkflowTemplate(wtv))
}
return &api.ListWorkflowTemplatesResponse{
Count: int32(len(apiWorkflowTemplates)),
WorkflowTemplates: apiWorkflowTemplates,
}, nil
}