-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
52a50ec
commit 7a07d5c
Showing
9 changed files
with
522 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
packages/kn-plugin-workflow/pkg/specs/testdata/flink-openapi-json.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "Flink JobManager REST API", | ||
"contact": { | ||
"email": "[email protected]" | ||
}, | ||
"license": { | ||
"name": "Apache 2.0", | ||
"url": "https://www.apache.org/licenses/LICENSE-2.0.html" | ||
}, | ||
"version": "v1/1.20-SNAPSHOT" | ||
}, | ||
"paths": { | ||
"/jars": { | ||
"get": { | ||
"description": "Returns a list of all jars previously uploaded via '/jars/upload'.", | ||
"operationId": "getJarList", | ||
"responses": { | ||
"200": { | ||
"description": "The request was successful." | ||
} | ||
} | ||
} | ||
}, | ||
"/jars/{jarid}/run": { | ||
"post": { | ||
"description": "Submits a job for execution.", | ||
"operationId": "submitJobFromJar", | ||
"parameters": [ | ||
{ | ||
"name": "jarid", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "The request was successful." | ||
} | ||
} | ||
} | ||
}, | ||
"/jobs/{jobid}": { | ||
"get": { | ||
"description": "Returns details of a job.", | ||
"operationId": "getJobDetails", | ||
"parameters": [ | ||
{ | ||
"name": "jobid", | ||
"in": "path", | ||
"description": "32-character hexadecimal string value that identifies a job.", | ||
"required": true | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "The request was successful." | ||
} | ||
} | ||
}, | ||
"patch": { | ||
"description": "Terminates a job.", | ||
"operationId": "cancelJob", | ||
"parameters": [ | ||
{ | ||
"name": "jobid", | ||
"in": "path", | ||
"description": "32-character hexadecimal string value that identifies a job.", | ||
"required": true | ||
}, | ||
{ | ||
"name": "mode", | ||
"in": "query", | ||
"description": "String value that specifies the termination mode. The only supported value is: \"cancel\".", | ||
"required": false, | ||
"style": "form" | ||
} | ||
], | ||
"responses": { | ||
"202": { | ||
"description": "The request was successful." | ||
} | ||
} | ||
} | ||
}, | ||
"/jars/upload": { | ||
"post": { | ||
"description": "Uploads a jar.", | ||
"operationId": "uploadJar", | ||
"requestBody": { | ||
"content": { | ||
"application/x-java-archive": { | ||
"schema": { | ||
"type": "string", | ||
"format": "binary" | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "The request was successful." | ||
} | ||
} | ||
} | ||
}, | ||
"/test": { | ||
"get": { | ||
"description": "Test endpoint", | ||
"operationId": "test", | ||
"responses": { | ||
"200": { | ||
"description": "The request was successful." | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
packages/kn-plugin-workflow/pkg/specs/testdata/subflow-mySpecsDir.sw.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
id: fraudhandling | ||
name: Fraud Handling | ||
expressionLang: jsonpath | ||
start: FraudHandling | ||
version: "1.0" | ||
events: | ||
- kind: produced | ||
name: FraudEvaluation | ||
type: fraudEvaluation | ||
source: fraudEvaluation | ||
functions: | ||
- name: getFlinkJobs | ||
operation: mySpecsDir/flink-openapi.yaml#getJarList | ||
- name: runFlinkJob | ||
operation: mySpecsDir/flink-openapi.yaml#submitJobFromJar | ||
states: | ||
- name: FraudHandling | ||
type: switch | ||
dataConditions: | ||
- condition: "{{ $.[?(@.total > 1000)] }}" | ||
transition: FraudVerificationNeeded | ||
- condition: "{{ $.[?(@.total <= 1000)] }}" | ||
end: true | ||
- name: FraudVerificationNeeded | ||
type: inject | ||
data: | ||
fraudEvaluation: true | ||
end: | ||
produceEvents: | ||
- eventRef: FraudEvaluation |
Oops, something went wrong.