You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@streampark.apache.org by "lvshaokang (via GitHub)" <gi...@apache.org> on 2023/04/04 02:49:12 UTC

[GitHub] [incubator-streampark] lvshaokang opened a new issue, #2565: [DISCUSSION] refactor v2 api use RESTful API

lvshaokang opened a new issue, #2565:
URL: https://github.com/apache/incubator-streampark/issues/2565

   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   
   
   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-streampark/streampark/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues.
   
   
   ### Describe the proposal
   
   # AlertController
   
   |   |               before                |                  after                  |
   |---|-------------------------------------|-----------------------------------------|
   |   | [POST] /flink/alert/add             | [POST] /alert-configs/                  |
   |   | [POST] /flink/alert/exists          | [GET] /alert-configs/{config-id}/verify |
   |   | [POST] /flink/alert/update          | [PUT] /alert-configs/{config-id}        |
   |   | [POST] /flink/alert/get             | [GET] /alert-configs/{config-id}        |
   |   | [POST] /flink/alert/list            | [GET] /alert-configs/                   |
   |   | [POST] /flink/alert/listWithOutPage | [GET] /alert-configs/                   |
   |   | [DELETE] /flink/alert/delete        | [DELETE] /alert-configs/{config-id}     |
   |   | [POST] /flink/alert/send            | [POST] /alert-configs/{config-id}/send  |
   
   # ApplicationBuildPipelineController
   
   |   |          before           |                        after                        |
   |---|---------------------------|-----------------------------------------------------|
   |   | [POST] /flink/pipe/build  | [POST] /flink/applications/{app-id}/release         |
   |   | [POST] /flink/pipe/detail | [GET] /flink/applications/{app-id}/release/pipeline |
   
   # ApplicationBuildPipelineController
   
   |   |                before                | after                                                                                             |
   |---|--------------------------------------|---------------------------------------------------------------------------------------------------|
   |   | [POST] /flink/app/get                | [GET] /flink/applications/{app-id}                                                                |
   |   | [POST] /flink/app/create             | [POST] /flink/applications/                                                                       |
   |   | [POST] /flink/app/copy               | [POST] /flink/applications/{app-id}/copy                                                          |
   |   | [POST] /flink/app/update             | [PUT] /flink/applications/{app-id}                                                                |
   |   | [POST] /flink/app/dashboard          | [POST] /team/{team-id}/flink/applications/dashboard </br>or /flink/applications/dashboard?team-id= |
   |   | [POST] /flink/app/list               | [GET] /flink/applications/                                                                        |
   |   | [POST] /flink/app/mapping            | [POST] /flink/applications/mapping                                                                |
   |   | [POST] /flink/app/revoke             | [POST] /flink/applications/{app-id}/revoke                                                        |
   |   | [POST] /flink/app/start              | [POST] /flink/applications/{app-id}/start                                                         |
   |   | [POST] /flink/app/cancel             | [POST] /flink/applications/{app-id}/cancel                                                        |
   |   | [POST] /flink/app/clean              | [POST] -                                                                                          |
   |   | [POST] /flink/app/forcedStop         | [POST] /flink/applications/{app-id}/force-stop                                                    |
   |   | [POST] /flink/app/yarn               | [GET]  /flink/applications/{app-id}/yarn-proxy                                                    |
   |   | [POST] /flink/app/name               | [GET] /flink/applications/{app-id}/yarn-name                                                      |
   |   | [POST] /flink/app/checkName          | [GET] /flink/applications/{app-id}/status                                                         |
   |   | [POST] /flink/app/readConf           | [GET] /flink/applications/{app-id}/conf                                                           |
   |   | [POST] /flink/app/main               | [GET] /flink/applications/{app-id}/main-class                                                     |
   |   | [POST] /flink/app/rollback           | -                                                                                                 |
   |   | [POST] /flink/app/backups            | [GET] /flink/applications/backups                                                                 |
   |   | [POST] /flink/app/optionlog          | [GET] /flink/applications/{app-id}/option-logs                                                    |
   |   | [POST] /flink/app/delete             | [DELETE] /flink/applications/{app-id}                                                             |
   |   | [POST] /flink/app/deletebak          | [DELETE] /flink/applications/backups/{back-id}                                                    |
   |   | [POST] /flink/app/checkjar           | -                                                                                                 |
   |   | [POST] /flink/app/upload             | [POST]  /flink/applications/upload                                                                |
   |   | [POST] /flink/app/verifySchema       | -                                                                                                 |
   |   | [POST] /flink/app/checkSavepointPath | [POST] /flink/applications/{app-id}/savepoint-path                                                |
   |   | [POST] /flink/app/k8sStartLog        | [GET]  /flink/applications/{app-id}/k8s-start-logs                                                |
   
   # ApplicationHistoryController
   
   |   |                  before                   |                  after                  |
   |---|-------------------------------------------|-----------------------------------------|
   |   | [POST] /flink/history/uploadJars          | [GET] /histories/jars                   |
   |   | [POST] /flink/history/k8sNamespaces       | [GET] /histories/k8s-namespaces         |
   |   | [POST] /flink/history/sessionClusterIds   | [GET] /histories/session-clusters       |
   |   | [POST] /flink/history/flinkBaseImages     | [GET] /histories/flink-base-images      |
   |   | [POST] /flink/history/flinkPodTemplates   | [GET] /histories/flink-pod-templates    |
   |   | [POST] /flink/history/flinkJmPodTemplates | [GET] /histories/flink-jm-pod-templates |
   |   | [POST] /flink/history/flinkTmPodTemplates | [GET] /histories/flink-tm-pod-templates |
   
   # ConfigController
   
   |   |              before              |                       after                        |
   |---|----------------------------------|----------------------------------------------------|
   |   | [POST] /flink/conf/get           | [GET] /configs/flink/{config-id}                   |
   |   | [POST] /flink/conf/template      | [GET] /configs/flink/conf-template                 |
   |   | [POST] /flink/conf/list          | [GET] /flink/applications/{app-id}/configs         |
   |   | [POST] /flink/conf/history       | [GET] /flink/applications/{app-id}/configs/history |
   |   | [POST] /flink/conf/delete        | [DELETE] /configs/flink/{config-id}                |
   |   | [POST] /flink/conf/sysHadoopConf | [GET] /configs/system/hadoop-configs               |
   
   # ExternalLinkController
   
   |   |              before               |                  after                  |
   |---|-----------------------------------|-----------------------------------------|
   |   | [POST] /flink/externalLink/list   | [GET] /flink/external-links             |
   |   | [POST] /flink/externalLink/render | [POST] /flink/external-links/render     |
   |   | [POST] /flink/externalLink/create | [POST] /flink/external-links            |
   |   | [POST] /flink/externalLink/update | [PUT] /flink/external-links/{link-id}   |
   |   | [POST] /flink/externalLink/delete | [DELETE] /flink/external-links/{link-id |
   
   # FlinkClusterController
   
   |   |             before              |                       after                       |
   |---|---------------------------------|---------------------------------------------------|
   |   | [POST] /flink/cluster/list      | [GET] /flink/clusters                             |
   |   | [POST] /flink/cluster/remoteUrl | [GET] /flink/clusters/{cluster-id}/remote-address |
   |   | [POST] /flink/cluster/check     | [GET] /flink/clusters/{cluster-id}/status         |
   |   | [POST] /flink/cluster/create    | [POST] /flink/clusters                            |
   |   | [POST] /flink/cluster/update    | [PUT] /flink/clusters/{cluster-id}                |
   |   | [POST] /flink/cluster/get       | [GET] /flink/clusters/{cluster-id}                |
   |   | [POST] /flink/cluster/start     | [POST] /flink/clusters/{cluster-id}/start         |
   |   | [POST] /flink/cluster/shutdown  | [POST] /flink/clusters/{cluster-id}/shutdown      |
   |   | [POST] /flink/cluster/delete    | [DELETE] /flink/clusters/{cluster-id}             |
   
   # FlinkEnvController
   
   |   |          before           |                  after                  |
   |---|---------------------------|-----------------------------------------|
   |   | [POST] /flink/env/list    | [GET] /flink/environments/              |
   |   | [POST] /flink/env/exists  | [GET] /flink/environments/verify        |
   |   | [POST] /flink/env/create  | [POST] /flink/environments              |
   |   | [POST] /flink/env/get     | [GET] /flink/environments/{env-id}      |
   |   | [POST] /flink/env/sync    | [PUT] /flink/environments/{env-id}/sync |
   |   | [POST] /flink/env/update  | [PUT] /flink/environments/{env-id}      |
   |   | [POST] /flink/env/default | [PATCH] /flink/environments/{env-id}    |
   
   # FlinkPodTemplateController
   
   |   |                 before                 |                      after                      |
   |---|----------------------------------------|-------------------------------------------------|
   |   | [POST] /flink/podtmpl/sysHosts         | [GET]  /flink/pod-templates/hosts               |
   |   | [POST] /flink/podtmpl/init             | [GET]  /flink/pod-templates/init                |
   |   | [POST] /flink/podtmpl/compHostAlias    | [POST] /flink/pod-templates/host-alias/complete |
   |   | [POST] /flink/podtmpl/extractHostAlias | [POST] /flink/pod-templates/host-alias/extract  |
   |   | [POST] /flink/podtmpl/previewHostAlias | [POST] /flink/pod-templates/host-alias/preview  |
   
   # FlinkSqlController
   
   |   |            before             |                     after                      |
   |---|-------------------------------|------------------------------------------------|
   |   | [POST] /flink/sql/verify      | [POST] /flink/sql/verify                       |
   |   | [POST] /flink/sql/list        | [GET]  /flink/applications/{app-id}/sql        |
   |   | [POST] /flink/sql/delete      | [DELETE] /flink/sql/{sql-id}                   |
   |   | [POST] /flink/sql/get         | [GET] /flink/sql?id=1,2                        |
   |   | [POST] /flink/sql/history     | [GET] /flink/applications/{app-id}/sql/history |
   |   | [POST] /flink/sql/sqlComplete | [POST] /flink/sql/complete                     |
   
   # ProjectController
   
   |   |             before             | after                                                        |
   |---|--------------------------------|--------------------------------------------------------------|
   |   | [POST] /flink/project/create   | [POST] /projects                                             |
   |   | [POST] /flink/project/update   | [PUT]  /projects/{project-id}                                |
   |   | [POST] /flink/project/get      | [GET] /projects/{project-id}                                 |
   |   | [POST] /flink/project/build    | [POST] /projects/{project-id}/build                          |
   |   | [POST] /flink/project/buildlog | [GET] /projects/{project-id}/build-logs                      |
   |   | [POST] /flink/project/list     | [GET] /projects                                              |
   |   | [POST] /flink/project/branches | [GET] /projects/{project-id}/git/branches                    |
   |   | [POST] /flink/project/delete   | [DELETE] /projects/{project-id}                              |
   |   | [POST] /flink/project/gitcheck | [POST]  /projects/{project-id}/git/auth                      |
   |   | [POST] /flink/project/exists   | [POST] /projects/{project-id}/verify                         |
   |   | [POST] /flink/project/modules  | [GET] /projects/{project-id}/modules                         |
   |   | [POST] /flink/project/jars     | [GET] /projects/{project-id}/jars                            |
   |   | [POST] /flink/project/listconf | [GET] /projects/{project-id}/configurations                  |
   |   | [POST] /flink/project/select   | [GET] /teams/{team-id}/projects </br> or /projects?team-id=? |
   
   # SavePointController
   
   |   |             before              |                         after                         |
   |---|---------------------------------|-------------------------------------------------------|
   |   | [POST] /flink/savepoint/latest  | [GET] /flink/applications/{app-id}/savepoints/latest  |
   |   | [POST] /flink/savepoint/history | [GET] /flink/applications/{app-id}/savepoints/history |
   |   | [POST] /flink/savepoint/delete  | [DELETE] /savepoints/{savepoint-id}                   |
   |   | [POST] /flink/savepoint/trigger | [POST] /flink/applications/{app-id}/savepoints        |
   
   # SettingController
   
   |   |              before              |               after                |
   |---|----------------------------------|------------------------------------|
   |   | [POST] /flink/setting/all        | [GET] /settings                    |
   |   | [POST] /flink/setting/get        | [GET] /settings/{setting-key}      |
   |   | [POST] /flink/setting/weburl     | [GET] /settings/streampark/address |
   |   | [POST] /flink/setting/update     | [PUT] /settings/{setting-key}      |
   |   | [PUT] /flink/setting/checkHadoop | [GET] /settings/hadoop/status      |
   
   # VariableController
   
   |   |            before             |               after               |
   |---|-------------------------------|-----------------------------------|
   |   | [POST] /variable/page         | [GET] /variables                  |
   |   | [POST] /variable/list         | [GET] /variables                  |
   |   | [POST] /variable/dependApps   | [GET] /projects/{project-id}      |
   |   | [POST] /variable/post         | [POST] /variables/                |
   |   | [PUT] /variable/update        | [PUT] /variables/{variable-id}    |
   |   | [POST] /variable/showOriginal | [GET] /variables/{variable-id}    |
   |   | [DELETE] /variable/delete     | [DELETE] /variables/{variable-id} |
   |   | [POST] /variable/check/code   | [GET] /variables/validate         |
   
   # AccessTokenController
   
   |   |        before        |               after               |
   |---|----------------------|-----------------------------------|
   |   | [POST] /token/create | [POST] /tokens                    |
   |   | [POST] /token/check  | [GET] /tokens/current/status      |
   |   | [POST] /token/list   | [GET] /tokens                     |
   |   | [POST] /token/toggle | [PATCH] /tokens/{token-id}/toggle |
   |   | [POST] /token/delete | [DELETE] /tokens/{token-id}       |
   |   | [POST] /token/curl   | -                                 |
   
   # MemberController
   
   # MenuController
   
   # PassportController
   
   # RoleController
   
   # TeamController
   
   # UserController
   
   
   
   ### Task list
   
   TODO
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] lvshaokang commented on issue #2565: [DISCUSSION] refactor v2 api use RESTful API

Posted by "lvshaokang (via GitHub)" <gi...@apache.org>.
lvshaokang commented on issue #2565:
URL: https://github.com/apache/incubator-streampark/issues/2565#issuecomment-1499278797

   > @lvshaokang @wolfboys We should change post data with json instead of form. With this issue merged ,I will carry on replace `enum` type issue.
   
   @GOODBOY008 Right. Some controller methods is redundant, but for one or two fields of the method whether to also use json entity, may need to consider it. Some times we can use path variable or query variable to pass parameters, like, 
   [DELETE] /alert-configs/{config-id}
   [GET] /alert-configs?a=b&c=d


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] GOODBOY008 commented on issue #2565: [DISCUSSION] refactor v2 api use RESTful API

Posted by "GOODBOY008 (via GitHub)" <gi...@apache.org>.
GOODBOY008 commented on issue #2565:
URL: https://github.com/apache/incubator-streampark/issues/2565#issuecomment-1496831129

   @lvshaokang @wolfboys We should change post data with json instead of form. With this issue merged ,I will carry on  replace `enum` type issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] wolfboys commented on issue #2565: [DISCUSSION] refactor v2 api use RESTful API

Posted by "wolfboys (via GitHub)" <gi...@apache.org>.
wolfboys commented on issue #2565:
URL: https://github.com/apache/incubator-streampark/issues/2565#issuecomment-1495394893

   Great proposal, some resturls, we need to discuss


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] GOODBOY008 commented on issue #2565: [DISCUSSION] refactor v2 api use RESTful API

Posted by "GOODBOY008 (via GitHub)" <gi...@apache.org>.
GOODBOY008 commented on issue #2565:
URL: https://github.com/apache/incubator-streampark/issues/2565#issuecomment-1499875185

   > Like this front end pass only one param,but back end receive with `Application` entity is too heavy and make us confused. So we should discuss use `DTO` instead of `entity` to pass params. ![229964842-85a4b442-bee5-4dc9-97f1-4c1e1e134322](https://user-images.githubusercontent.com/13617900/229970990-4304eecd-8e82-41f4-9f5b-f9da9755327a.png) ![229964850-e5b2ceb7-3bdd-440c-a496-eb6e6e55feb0](https://user-images.githubusercontent.com/13617900/229970986-b97aec18-fd9b-4fdd-9a7e-ca2bb0b81788.png)
   
   @lvshaokang According to the specific conditions , we should think different :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] GOODBOY008 commented on issue #2565: [DISCUSSION] refactor v2 api use RESTful API

Posted by "GOODBOY008 (via GitHub)" <gi...@apache.org>.
GOODBOY008 commented on issue #2565:
URL: https://github.com/apache/incubator-streampark/issues/2565#issuecomment-1496857430

   Like this front end pass only one param,but back end receive with `Application` entity is too heavy and make us confused. So we should discuss use `DTO` instead of `entity` to pass params.
   ![229964842-85a4b442-bee5-4dc9-97f1-4c1e1e134322](https://user-images.githubusercontent.com/13617900/229970990-4304eecd-8e82-41f4-9f5b-f9da9755327a.png)
   ![229964850-e5b2ceb7-3bdd-440c-a496-eb6e6e55feb0](https://user-images.githubusercontent.com/13617900/229970986-b97aec18-fd9b-4fdd-9a7e-ca2bb0b81788.png)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-streampark] GOODBOY008 commented on issue #2565: [DISCUSSION] refactor v2 api use RESTful API

Posted by "GOODBOY008 (via GitHub)" <gi...@apache.org>.
GOODBOY008 commented on issue #2565:
URL: https://github.com/apache/incubator-streampark/issues/2565#issuecomment-1498373065

   Backend controller add param validation , most of endpionts are missing param validation.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@streampark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org