Skip to content

Commit

Permalink
fix: Rename Submittable API endpoint to submit (argoproj#2778)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarabala1979 committed Apr 22, 2020
1 parent 69333a8 commit 43d9eeb
Show file tree
Hide file tree
Showing 10 changed files with 156 additions and 156 deletions.
8 changes: 4 additions & 4 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1172,12 +1172,12 @@
}
}
},
"/api/v1/workflows/{namespace}/submit-from": {
"/api/v1/workflows/{namespace}/submit": {
"post": {
"tags": [
"WorkflowService"
],
"operationId": "SubmitFrom",
"operationId": "SubmitWorkflow",
"parameters": [
{
"type": "string",
Expand All @@ -1190,7 +1190,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.WorkflowSubmitFromRequest"
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.WorkflowSubmitRequest"
}
}
],
Expand Down Expand Up @@ -6272,7 +6272,7 @@
}
}
},
"io.argoproj.workflow.v1alpha1.WorkflowSubmitFromRequest": {
"io.argoproj.workflow.v1alpha1.WorkflowSubmitRequest": {
"type": "object",
"properties": {
"createOptions": {
Expand Down
2 changes: 1 addition & 1 deletion cmd/argo/commands/submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func submitWorkflowFromResource(resourceIdentifier string, submitOpts *wfv1.Subm

validateOptions([]wfv1.Workflow{tempwf}, submitOpts, cliOpts)

created, err := apiClient.NewWorkflowServiceClient().SubmitFrom(ctx, &workflowpkg.WorkflowSubmitFromRequest{
created, err := apiClient.NewWorkflowServiceClient().SubmitWorkflow(ctx, &workflowpkg.WorkflowSubmitRequest{
Namespace: namespace,
ResourceKind: kind,
ResourceName: name,
Expand Down
4 changes: 2 additions & 2 deletions pkg/apiclient/argo-kube-workflow-service-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ func (c argoKubeWorkflowServiceClient) PodLogs(ctx context.Context, req *workflo
return intermediary, nil
}

func (c argoKubeWorkflowServiceClient) SubmitFrom(ctx context.Context, req *workflowpkg.WorkflowSubmitFromRequest, opts ...grpc.CallOption) (*v1alpha1.Workflow, error) {
return c.delegate.SubmitFrom(ctx, req)
func (c argoKubeWorkflowServiceClient) SubmitWorkflow(ctx context.Context, req *workflowpkg.WorkflowSubmitRequest, opts ...grpc.CallOption) (*v1alpha1.Workflow, error) {
return c.delegate.SubmitWorkflow(ctx, req)
}
242 changes: 121 additions & 121 deletions pkg/apiclient/workflow/workflow.pb.go

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions pkg/apiclient/workflow/workflow.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/apiclient/workflow/workflow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ message WorkflowLintRequest {
}


message WorkflowSubmitFromRequest{
message WorkflowSubmitRequest{
string namespace = 1;
string resourceKind = 2;
string resourceName = 3;
Expand Down Expand Up @@ -194,9 +194,9 @@ service WorkflowService {
option (google.api.http).get = "/api/v1/workflows/{namespace}/{name}/{podName}/log";
}

rpc SubmitFrom (WorkflowSubmitFromRequest) returns (github.com.argoproj.argo.pkg.apis.workflow.v1alpha1.Workflow) {
rpc SubmitWorkflow (WorkflowSubmitRequest) returns (github.com.argoproj.argo.pkg.apis.workflow.v1alpha1.Workflow) {
option (google.api.http) = {
post: "/api/v1/workflows/{namespace}/submit-from"
post: "/api/v1/workflows/{namespace}/submit"
body: "*"
};
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/apiclient/workflow/workflow.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@
]
}
},
"/api/v1/workflows/{namespace}/submit-from": {
"/api/v1/workflows/{namespace}/submit": {
"post": {
"operationId": "SubmitFrom",
"operationId": "SubmitWorkflow",
"responses": {
"200": {
"description": "A successful response.",
Expand All @@ -272,7 +272,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/workflow.WorkflowSubmitFromRequest"
"$ref": "#/definitions/workflow.WorkflowSubmitRequest"
}
}
],
Expand Down Expand Up @@ -5068,7 +5068,7 @@
}
}
},
"workflow.WorkflowSubmitFromRequest": {
"workflow.WorkflowSubmitRequest": {
"type": "object",
"properties": {
"namespace": {
Expand Down
2 changes: 1 addition & 1 deletion server/workflow/workflow_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func (s *workflowServer) validateInstanceID(wf *v1alpha1.Workflow) bool {
return false
}

func (s *workflowServer) SubmitFrom(ctx context.Context, req *workflowpkg.WorkflowSubmitFromRequest) (*v1alpha1.Workflow, error) {
func (s *workflowServer) SubmitWorkflow(ctx context.Context, req *workflowpkg.WorkflowSubmitRequest) (*v1alpha1.Workflow, error) {
wfClient := auth.GetWfClient(ctx)
var wf *v1alpha1.Workflow
switch req.ResourceKind {
Expand Down
6 changes: 3 additions & 3 deletions server/workflow/workflow_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ func TestSubmitWorkflowFromResource(t *testing.T) {

server, ctx := getWorkflowServer()
t.Run("SubmitFromWorkflowTemplate", func(t *testing.T) {
wf, err := server.SubmitFrom(ctx, &workflowpkg.WorkflowSubmitFromRequest{
wf, err := server.SubmitWorkflow(ctx, &workflowpkg.WorkflowSubmitRequest{
Namespace: "workflows",
ResourceKind: "workflowtemplate",
ResourceName: "workflow-template-whalesay-template",
Expand All @@ -706,7 +706,7 @@ func TestSubmitWorkflowFromResource(t *testing.T) {
}
})
t.Run("SubmitFromCronWorkflow", func(t *testing.T) {
wf, err := server.SubmitFrom(ctx, &workflowpkg.WorkflowSubmitFromRequest{
wf, err := server.SubmitWorkflow(ctx, &workflowpkg.WorkflowSubmitRequest{
Namespace: "workflows",
ResourceKind: "cronworkflow",
ResourceName: "hello-world",
Expand All @@ -716,7 +716,7 @@ func TestSubmitWorkflowFromResource(t *testing.T) {
}
})
t.Run("SubmitFromClusterWorkflowTemplate", func(t *testing.T) {
wf, err := server.SubmitFrom(ctx, &workflowpkg.WorkflowSubmitFromRequest{
wf, err := server.SubmitWorkflow(ctx, &workflowpkg.WorkflowSubmitRequest{
Namespace: "workflows",
ResourceKind: "ClusterWorkflowTemplate",
ResourceName: "cluster-workflow-template-whalesay-template",
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/argo_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ func (s *ArgoServerSuite) TestSumbitWorkflowFromResource() {
})

s.Run("SubmitWFT", func() {
s.e(s.T()).POST("/api/v1/workflows/argo/submit-from").
s.e(s.T()).POST("/api/v1/workflows/argo/submit").
WithBytes([]byte(`{
"resourceKind": "WorkflowTemplate",
"resourceName": "test"
Expand Down Expand Up @@ -1176,7 +1176,7 @@ func (s *ArgoServerSuite) TestSumbitWorkflowFromResource() {
Status(200)
})
s.Run("SubmitWFT", func() {
s.e(s.T()).POST("/api/v1/workflows/argo/submit-from").
s.e(s.T()).POST("/api/v1/workflows/argo/submit").
WithBytes([]byte(`{
"resourceKind": "cronworkflow",
"resourceName": "test"
Expand Down Expand Up @@ -1213,7 +1213,7 @@ func (s *ArgoServerSuite) TestSumbitWorkflowFromResource() {
})

s.Run("SubmitCWFT", func() {
s.e(s.T()).POST("/api/v1/workflows/argo/submit-from").
s.e(s.T()).POST("/api/v1/workflows/argo/submit").
WithBytes([]byte(`{
"resourceKind": "ClusterWorkflowTemplate",
"resourceName": "test"
Expand Down

0 comments on commit 43d9eeb

Please sign in to comment.