You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/01/12 15:03:45 UTC

[GitHub] [apisix-dashboard] imjoey opened a new pull request #1277: Return after create

imjoey opened a new pull request #1277:
URL: https://github.com/apache/apisix-dashboard/pull/1277


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [ ] Bugfix
   - [x] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   
   - Related issues
   
   Fixes https://github.com/apache/apisix-dashboard/issues/1154 .
   
   ___
   ### New feature or improvement
   - Describe the details and related test reports.
   
   As mentioned in #1154 , when creating an object via `POST` method in manager-api, there is no way to refer to that new object for API caller. This PR is going to additionally return all the object data stored in etcd back. See the following example:
   
   Request sent to manager-api:
   
   ```
   $ curl http://127.0.0.1:9000/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -H 'Authorization:auth-token' -X POST -d '{"uri": "/get","methods": ["GET"],"upstream": {"type": "roundrobin","nodes": {"httpbin.org:443": 1}},"plugins": {"proxy-rewrite": {"uri": "\/get","scheme": "https"},"key-auth": {},"response-rewrite": {"status_code": 200,"body": "{\"code\": 200, \"msg\": \"success\"}"}}}'
   ```
   
   Response back to API caller:
   ```
   {"code":0,"message":"","data":{"id":"337109164457198464","create_time":1610462319,"update_time":1610462319,"uri":"/get","methods":["GET"],"plugins":{"key-auth":{},"proxy-rewrite":{"scheme":"https","uri":"/get"},"response-rewrite":{"body":"{\"code\": 200, \"msg\": \"success\"}","status_code":200}},"upstream":{"nodes":{"httpbin.org:443":1},"type":"roundrobin"},"status":1},"request_id":"f9520603-528a-4494-9934-5620788f2ec2"
   ```
   
   


----------------------------------------------------------------
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.

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



[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1277: feat: return back the data just created via POST method in manager API

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1277:
URL: https://github.com/apache/apisix-dashboard/pull/1277#issuecomment-760757820


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1277?src=pr&el=h1) Report
   > Merging [#1277](https://codecov.io/gh/apache/apisix-dashboard/pull/1277?src=pr&el=desc) (21b615b) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/b9a0227f30ac3f2bf843ab01f37e240a8bd30730?el=desc) (b9a0227) will **increase** coverage by `0.04%`.
   > The diff coverage is `56.52%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1277/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1277?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1277      +/-   ##
   ==========================================
   + Coverage   42.83%   42.87%   +0.04%     
   ==========================================
     Files          31       31              
     Lines        1940     1945       +5     
   ==========================================
   + Hits          831      834       +3     
   - Misses        999     1001       +2     
     Partials      110      110              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1277?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/store/store\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1277/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVfbW9jay5nbw==) | `0.00% <0.00%> (ø)` | |
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1277/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `78.88% <50.00%> (-1.12%)` | :arrow_down: |
   | [api/internal/handler/route/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1277/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGUvcm91dGUuZ28=) | `46.49% <60.00%> (+0.23%)` | :arrow_up: |
   | [api/internal/handler/service/service.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1277/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2VydmljZS9zZXJ2aWNlLmdv) | `27.83% <66.66%> (+0.75%)` | :arrow_up: |
   | [api/internal/handler/ssl/ssl.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1277/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc3NsL3NzbC5nbw==) | `29.60% <66.66%> (+0.39%)` | :arrow_up: |
   | [api/internal/handler/upstream/upstream.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1277/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvdXBzdHJlYW0vdXBzdHJlYW0uZ28=) | `20.16% <66.66%> (+0.67%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1277?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1277?src=pr&el=footer). Last update [b9a0227...21b615b](https://codecov.io/gh/apache/apisix-dashboard/pull/1277?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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



[GitHub] [apisix-dashboard] juzhiyuan merged pull request #1277: feat: return back the data just created via POST method in manager API

Posted by GitBox <gi...@apache.org>.
juzhiyuan merged pull request #1277:
URL: https://github.com/apache/apisix-dashboard/pull/1277


   


----------------------------------------------------------------
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.

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



[GitHub] [apisix-dashboard] starsz commented on pull request #1277: feat: return back the data just created via POST method in manager API

Posted by GitBox <gi...@apache.org>.
starsz commented on pull request #1277:
URL: https://github.com/apache/apisix-dashboard/pull/1277#issuecomment-761733865


   @imjoey Thanks a lot.


----------------------------------------------------------------
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.

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



[GitHub] [apisix-dashboard] codecov-io commented on pull request #1277: feat: return back the data just created via POST method in manager API

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #1277:
URL: https://github.com/apache/apisix-dashboard/pull/1277#issuecomment-760757820


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1277?src=pr&el=h1) Report
   > Merging [#1277](https://codecov.io/gh/apache/apisix-dashboard/pull/1277?src=pr&el=desc) (f4d12a4) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/b9a0227f30ac3f2bf843ab01f37e240a8bd30730?el=desc) (b9a0227) will **increase** coverage by `0.04%`.
   > The diff coverage is `56.52%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1277/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1277?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1277      +/-   ##
   ==========================================
   + Coverage   42.83%   42.87%   +0.04%     
   ==========================================
     Files          31       31              
     Lines        1940     1945       +5     
   ==========================================
   + Hits          831      834       +3     
   - Misses        999     1001       +2     
     Partials      110      110              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1277?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/store/store\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1277/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVfbW9jay5nbw==) | `0.00% <0.00%> (ø)` | |
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1277/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `78.88% <50.00%> (-1.12%)` | :arrow_down: |
   | [api/internal/handler/route/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1277/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvcm91dGUvcm91dGUuZ28=) | `46.49% <60.00%> (+0.23%)` | :arrow_up: |
   | [api/internal/handler/service/service.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1277/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2VydmljZS9zZXJ2aWNlLmdv) | `27.83% <66.66%> (+0.75%)` | :arrow_up: |
   | [api/internal/handler/ssl/ssl.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1277/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc3NsL3NzbC5nbw==) | `29.60% <66.66%> (+0.39%)` | :arrow_up: |
   | [api/internal/handler/upstream/upstream.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1277/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvdXBzdHJlYW0vdXBzdHJlYW0uZ28=) | `20.16% <66.66%> (+0.67%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1277?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1277?src=pr&el=footer). Last update [b9a0227...f4d12a4](https://codecov.io/gh/apache/apisix-dashboard/pull/1277?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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



[GitHub] [apisix-dashboard] imjoey commented on pull request #1277: feat: return back the data just created via POST method in manager API

Posted by GitBox <gi...@apache.org>.
imjoey commented on pull request #1277:
URL: https://github.com/apache/apisix-dashboard/pull/1277#issuecomment-760961564


   ping @juzhiyuan @starsz @nic-chen . PTAL. Much appreciated.


----------------------------------------------------------------
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.

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