Skip to content

Commit

Permalink
feat: add resubmit API for archived workflows. Fixes #7909 (#8079)
Browse files Browse the repository at this point in the history
Signed-off-by: Dillen Padhiar <dpadhiar99@gmail.com>
  • Loading branch information
dpadhiar authored Mar 9, 2022
1 parent 707cf83 commit 437b376
Show file tree
Hide file tree
Showing 16 changed files with 1,228 additions and 38 deletions.
17 changes: 17 additions & 0 deletions api/jsonschema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6578,6 +6578,23 @@
],
"type": "object"
},
"io.argoproj.workflow.v1alpha1.ResubmitArchivedWorkflowRequest": {
"properties": {
"memoized": {
"type": "boolean"
},
"name": {
"type": "string"
},
"namespace": {
"type": "string"
},
"uid": {
"type": "string"
}
},
"type": "object"
},
"io.argoproj.workflow.v1alpha1.RetryAffinity": {
"description": "RetryAffinity prevents running steps on the same host.",
"properties": {
Expand Down
55 changes: 55 additions & 0 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,44 @@
}
}
},
"/api/v1/archived-workflows/{uid}/resubmit": {
"put": {
"tags": [
"ArchivedWorkflowService"
],
"operationId": "ArchivedWorkflowService_ResubmitArchivedWorkflow",
"parameters": [
{
"type": "string",
"name": "uid",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.ResubmitArchivedWorkflowRequest"
}
}
],
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.Workflow"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/grpc.gateway.runtime.Error"
}
}
}
}
},
"/api/v1/cluster-workflow-templates": {
"get": {
"tags": [
Expand Down Expand Up @@ -10840,6 +10878,23 @@
}
}
},
"io.argoproj.workflow.v1alpha1.ResubmitArchivedWorkflowRequest": {
"type": "object",
"properties": {
"memoized": {
"type": "boolean"
},
"name": {
"type": "string"
},
"namespace": {
"type": "string"
},
"uid": {
"type": "string"
}
}
},
"io.argoproj.workflow.v1alpha1.RetryAffinity": {
"description": "RetryAffinity prevents running steps on the same host.",
"type": "object",
Expand Down
5 changes: 5 additions & 0 deletions pkg/apiclient/http1/archived-workflows-service-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,8 @@ func (h ArchivedWorkflowsServiceClient) ListArchivedWorkflowLabelValues(_ contex
out := &wfv1.LabelValues{}
return out, h.Get(in, out, "/api/v1/archived-workflows-label-values")
}

func (h ArchivedWorkflowsServiceClient) ResubmitArchivedWorkflow(_ context.Context, in *workflowarchivepkg.ResubmitArchivedWorkflowRequest, _ ...grpc.CallOption) (*wfv1.Workflow, error) {
out := &wfv1.Workflow{}
return out, h.Put(in, out, "/api/v1/archived-workflows/{uid}/resubmit")
}
441 changes: 403 additions & 38 deletions pkg/apiclient/workflowarchive/workflow-archive.pb.go

Large diffs are not rendered by default.

117 changes: 117 additions & 0 deletions pkg/apiclient/workflowarchive/workflow-archive.pb.gw.go

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

12 changes: 12 additions & 0 deletions pkg/apiclient/workflowarchive/workflow-archive.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ message ListArchivedWorkflowLabelKeysRequest {
message ListArchivedWorkflowLabelValuesRequest {
k8s.io.apimachinery.pkg.apis.meta.v1.ListOptions listOptions = 1;
}
message ResubmitArchivedWorkflowRequest {
string uid = 1;
string name = 2;
string namespace = 3;
bool memoized = 4;
}

service ArchivedWorkflowService {
rpc ListArchivedWorkflows (ListArchivedWorkflowsRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.WorkflowList) {
Expand All @@ -41,4 +47,10 @@ service ArchivedWorkflowService {
rpc ListArchivedWorkflowLabelValues (ListArchivedWorkflowLabelValuesRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.LabelValues) {
option (google.api.http).get = "/api/v1/archived-workflows-label-values";
}
rpc ResubmitArchivedWorkflow (ResubmitArchivedWorkflowRequest) returns (github.com.argoproj.argo_workflows.v3.pkg.apis.workflow.v1alpha1.Workflow) {
option (google.api.http) = {
put: "/api/v1/archived-workflows/{uid}/resubmit"
body: "*"
};
}
}
64 changes: 64 additions & 0 deletions sdks/java/client/docs/ArchivedWorkflowServiceApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Method | HTTP request | Description
[**archivedWorkflowServiceListArchivedWorkflowLabelKeys**](ArchivedWorkflowServiceApi.md#archivedWorkflowServiceListArchivedWorkflowLabelKeys) | **GET** /api/v1/archived-workflows-label-keys |
[**archivedWorkflowServiceListArchivedWorkflowLabelValues**](ArchivedWorkflowServiceApi.md#archivedWorkflowServiceListArchivedWorkflowLabelValues) | **GET** /api/v1/archived-workflows-label-values |
[**archivedWorkflowServiceListArchivedWorkflows**](ArchivedWorkflowServiceApi.md#archivedWorkflowServiceListArchivedWorkflows) | **GET** /api/v1/archived-workflows |
[**archivedWorkflowServiceResubmitArchivedWorkflow**](ArchivedWorkflowServiceApi.md#archivedWorkflowServiceResubmitArchivedWorkflow) | **PUT** /api/v1/archived-workflows/{uid}/resubmit |


<a name="archivedWorkflowServiceDeleteArchivedWorkflow"></a>
Expand Down Expand Up @@ -346,3 +347,66 @@ No authorization required
**200** | A successful response. | - |
**0** | An unexpected error response. | - |

<a name="archivedWorkflowServiceResubmitArchivedWorkflow"></a>
# **archivedWorkflowServiceResubmitArchivedWorkflow**
> IoArgoprojWorkflowV1alpha1Workflow archivedWorkflowServiceResubmitArchivedWorkflow(uid, body)


### Example
```java
// Import classes:
import io.argoproj.workflow.ApiClient;
import io.argoproj.workflow.ApiException;
import io.argoproj.workflow.Configuration;
import io.argoproj.workflow.models.*;
import io.argoproj.workflow.apis.ArchivedWorkflowServiceApi;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost:2746");

ArchivedWorkflowServiceApi apiInstance = new ArchivedWorkflowServiceApi(defaultClient);
String uid = "uid_example"; // String |
IoArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest body = new IoArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest(); // IoArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest |
try {
IoArgoprojWorkflowV1alpha1Workflow result = apiInstance.archivedWorkflowServiceResubmitArchivedWorkflow(uid, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ArchivedWorkflowServiceApi#archivedWorkflowServiceResubmitArchivedWorkflow");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**uid** | **String**| |
**body** | [**IoArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest**](IoArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest.md)| |

### Return type

[**IoArgoprojWorkflowV1alpha1Workflow**](IoArgoprojWorkflowV1alpha1Workflow.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | A successful response. | - |
**0** | An unexpected error response. | - |

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@


# IoArgoprojWorkflowV1alpha1ResubmitArchivedWorkflowRequest


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**memoized** | **Boolean** | | [optional]
**name** | **String** | | [optional]
**namespace** | **String** | | [optional]
**uid** | **String** | | [optional]



Loading

0 comments on commit 437b376

Please sign in to comment.