[Feature][API] New restful API for workflow and schedule #11912
[Feature][API] New restful API for workflow and schedule #11912caishunfeng merged 13 commits intoapache:devfrom
Conversation
5c04f8f to
52e5dc4
Compare
|
This PR is not equal to refactored exists API as #10257 do, we also separate existing |
52e5dc4 to
971ce05
Compare
...-api/src/test/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionServiceTest.java
Fixed
Show fixed
Hide fixed
...-api/src/test/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionServiceTest.java
Fixed
Show fixed
Hide fixed
Codecov Report
@@ Coverage Diff @@
## dev #11912 +/- ##
============================================
+ Coverage 38.69% 39.07% +0.37%
- Complexity 4010 4082 +72
============================================
Files 1001 1010 +9
Lines 37422 37696 +274
Branches 4262 4326 +64
============================================
+ Hits 14480 14728 +248
+ Misses 21295 21281 -14
- Partials 1647 1687 +40
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
CURD for workflow and schedule, different with exists API, this new restful api only operate single resource in each request, and return the latest. For example, previous workflow should also need to post tasks definition and tasks relation definition, but this patch will allow you to create workflow without task relate information
fix the warning code
cb52a01 to
c5ce4ce
Compare
|
fix conflict from adding log in #11782 |
|
PTAL if you have time @caishunfeng @SbloodyS |
...duler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ScheduleV2Controller.java
Outdated
Show resolved
Hide resolved
...er-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleCreateRequest.java
Show resolved
Hide resolved
...er-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleUpdateRequest.java
Outdated
Show resolved
Hide resolved
| * @param workflowCreateRequest the new workflow object will be created | ||
| * @return New ProcessDefinition object created just now | ||
| */ | ||
| ProcessDefinition createProcessDefinitionV2(User loginUser, WorkflowCreateRequest workflowCreateRequest); |
There was a problem hiding this comment.
What's the different between v1 and v2? Maybe v2 it's not a good guide for developers if v1 can not be replaced with v2.
There was a problem hiding this comment.
v1 is for currently API(operate workflow and task and task relation object), and V2 is only operate workflow object. V2 is mainly for RESTful api, which we only change one single object instand of too many object
There was a problem hiding this comment.
Will we use v2 uniformly in the future? including UI or support restful api or pyds?
There was a problem hiding this comment.
I hope we can do that, and in that moment, maybe it it the best time to migrate python api into separate repository
...duler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowV2Controller.java
Outdated
Show resolved
Hide resolved
...duler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowV2Controller.java
Outdated
Show resolved
Hide resolved
...duler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowV2Controller.java
Outdated
Show resolved
Hide resolved
...duler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowV2Controller.java
Outdated
Show resolved
Hide resolved
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/ResourceResponse.java
Outdated
Show resolved
Hide resolved
...er-api/src/main/java/org/apache/dolphinscheduler/api/dto/schedule/ScheduleCreateRequest.java
Show resolved
Hide resolved
...ler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/SchedulerServiceImpl.java
Outdated
Show resolved
Hide resolved
…/api/controller/ScheduleV2Controller.java Co-authored-by: caishunfeng <caishunfeng2021@gmail.com>
99b6c39
|
we still have discuss in #11912 (comment) and #11912 (comment) |
from createProcessDefinitionV2 to createSingleProcessDefinition from updateProcessDefinitionV2 to updateSingleProcessDefinition
|
Kudos, SonarCloud Quality Gate passed! |
|
Thanks @zhongjiajie |
* [feat] New restful API for workflow and schedule CURD for workflow and schedule, different with exists API, this new restful api only operate single resource in each request, and return the latest. For example, previous workflow should also need to post tasks definition and tasks relation definition, but this patch will allow you to create workflow without task relate information * use checkProjectAndAuthThrowException, and fix CI error * Update dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ScheduleV2Controller.java * change method name from createProcessDefinitionV2 to createSingleProcessDefinition from updateProcessDefinitionV2 to updateSingleProcessDefinition Co-authored-by: caishunfeng <caishunfeng2021@gmail.com>








CURD for workflow and schedule, different with exists
API, this new restful api only operate single resource
in each request, and return the latest. For example,
previous workflow should also need to post tasks definition
and tasks relation definition, but this patch will allow
you to create workflow without task relate information