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 2020/07/10 02:25:16 UTC

[GitHub] [incubator-apisix] DHB-liuhong opened a new issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

DHB-liuhong opened a new issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823


   ### Issue description
   apisix 1.4 can not patch upstream nodes configure
   
   ### Environment
   [root@ceph68 ~]# curl -i http://127.0.0.1:9080/apisix/admin/routes/1
   HTTP/1.1 200 OK
   Date: Fri, 10 Jul 2020 02:31:30 GMT
   Content-Type: text/plain; charset=utf-8
   Transfer-Encoding: chunked
   Connection: keep-alive
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   Access-Control-Expose-Headers: *
   Access-Control-Max-Age: 3600
   Server: APISIX web server
   
   {"node":{"value":{"priority":0,"methods":["PUT","GET","POST","DELETE","PATCH","HEAD","OPTIONS","CONNECT","TRACE"],"uri":"\/*","plugins":{"prometheus":{}},"upstream":{"nodes":{"192.168.3.39:8080":10,"192.168.3.39:8081":10,"192.168.3.39:8082":10,"192.168.3.39:8083":10,"192.168.3.39:8084":10},"hash_on":"vars","type":"roundrobin"}},"createdIndex":40,"key":"\/apisix\/routes\/1","modifiedIndex":40},"action":"get"}
   
   [root@ceph68 ~]# curl -i -X PATCH http://127.0.0.1:9080/apisix/admin/routes/1/upstream/nodes -d '{ "192.168.3.40:8080": 10,"192.168.3.40:8081": 10,"192.168.3.40:8082": 10,"192.168.3.40:8083": 10,"192.168.3.40:8084": 10 }'
   HTTP/1.1 400 Bad Request
   Date: Fri, 10 Jul 2020 02:31:33 GMT
   Content-Type: text/plain; charset=utf-8
   Transfer-Encoding: chunked
   Connection: keep-alive
   Access-Control-Allow-Origin: *
   Access-Control-Allow-Credentials: true
   Access-Control-Expose-Headers: *
   Access-Control-Max-Age: 3600
   Server: APISIX web server
   
   {"error_msg":"invalid configuration: additional properties forbidden, found 192.168.3.40:8082"}
   
   * apisix version (cmd: `apisix version`):  1.4
   * OS: centos 7.6
   


----------------------------------------------------------------
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] [incubator-apisix] membphis commented on issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823#issuecomment-656464671


   @nic-chen do you have time to look at this 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.

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



[GitHub] [incubator-apisix] membphis closed issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
membphis closed issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823


   


----------------------------------------------------------------
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] [incubator-apisix] DHB-liuhong edited a comment on issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
DHB-liuhong edited a comment on issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823#issuecomment-657326709


   I personally think this new type is not friendly to use.  why should we set the attribute value to null to remove. 
   eg:"methods": ["GET", null, null, null, null, null, null, null, null]


----------------------------------------------------------------
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] [incubator-apisix] membphis commented on issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823#issuecomment-657584999


   > for example: PATCH 127.0.0.1/apisix/admin/routes/1/uri -d {'index.html'}
   
   @moonming  I think you provide a wrong example, the correct one should be like this:
   
   > PATCH 127.0.0.1/apisix/admin/routes/1/uri -d '"index.html"'
   
   ```
   {
       "uri": "index.html"
   }
   ```


----------------------------------------------------------------
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] [incubator-apisix] DHB-liuhong commented on issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
DHB-liuhong commented on issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823#issuecomment-656445255


   please, can you tell me What tools do you use for debugging. thanks.


----------------------------------------------------------------
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] [incubator-apisix] moonming commented on issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
moonming commented on issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823#issuecomment-657245676


   I think resource name should mapped to a URL path, and resource is
   contained in the HTTP request body.
   for example: PATCH 127.0.0.1/apisix/admin/routes/1/uri -d {'index.html'}
   
   Thanks,
   Ming Wen
   Twitter: _WenMing
   
   
   琚致远 <no...@github.com> 于2020年7月12日周日 下午11:35写道:
   
   > Why not use standard RESTful API? I prefer this style:
   >
   > PATCH http://127.0.0.1:9080/apisix/admin/routes/1 -d {a: b}
   >
   > —
   > You are receiving this because you commented.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/incubator-apisix/issues/1823#issuecomment-657238287>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AGJZBK3I32UMMWYKATSG7VTR3HJ3JANCNFSM4OWFETUQ>
   > .
   >
   


----------------------------------------------------------------
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] [incubator-apisix] membphis commented on issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823#issuecomment-657593919


   Welcome to discuss on this mailing list.
   
   https://lists.apache.org/thread.html/r616d11a2d3c9cfcd20a9ab09715ed62f65ddc8dc682697bba87d6f57%40%3Cdev.apisix.apache.org%3E
   
   


----------------------------------------------------------------
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] [incubator-apisix] DHB-liuhong edited a comment on issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
DHB-liuhong edited a comment on issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823#issuecomment-657326709


   I personally think this new type is not friendly to use.  why should we set the attribute value to null to remove. 
   eg:"methods": ["GET", null, null, null, null, null, null, null, null]
   thanks


----------------------------------------------------------------
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] [incubator-apisix] membphis edited a comment on issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
membphis edited a comment on issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823#issuecomment-657224665


   I can accept both styles. `style 1` is better for humans. `style 2` is better for robots.
   
   ```
   {
       "sub_path": {xxxx}
       ... ...
   }
   ```
   
   ```
   # style 1: sub path
   curl -X PATCH http://xxxxx/routes/1/sub_path -d {xxxx}
   
   # style 2: path
   curl -X PATCH http://xxxxx/routes/1 -d {sub_path: {xxxx}}
   ```


----------------------------------------------------------------
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] [incubator-apisix] nic-chen commented on issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823#issuecomment-656545369


   @DHB-liuhong 
   
   The PATCH method has modified the calling format, in your example, it should be like this:
   
   curl -i -X PATCH http://127.0.0.1:9080/apisix/admin/routes/1 -d '{"upstream":{"nodes":{"192.168.3.39:8080":10,"192.168.3.39:8081":10,"192.168.3.39:8082":10,"192.168.3.39:8083":10,"192.168.3.39:8084":10}}}'
   
   
   the detail see:
   [https://github.com/apache/incubator-apisix/pull/1609](https://github.com/apache/incubator-apisix/pull/1609)
   
   


----------------------------------------------------------------
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] [incubator-apisix] moonming commented on issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
moonming commented on issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823#issuecomment-657219283


   > @DHB-liuhong
   > 
   > The PATCH method has modified the calling format, in your example, it should be like this:
   > 
   > curl -i -X PATCH http://127.0.0.1:9080/apisix/admin/routes/1 -d '{"upstream":{"nodes":{"192.168.3.39:8080":10,"192.168.3.39:8081":10,"192.168.3.39:8082":10,"192.168.3.39:8083":10,"192.168.3.39:8084":10}}}'
   > 
   > the detail see:
   > #1609
   
   I think @DHB-liuhong is the right way. 
   Why change to the https://github.com/apache/incubator-apisix/pull/1609? @membphis @nic-chen 


----------------------------------------------------------------
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] [incubator-apisix] membphis commented on issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823#issuecomment-656465015


   > please, can you tell me What tools do you use for debugging. thanks.
   
   I am a log debugger, mainly use `core.log`


----------------------------------------------------------------
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] [incubator-apisix] membphis commented on issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823#issuecomment-657592989


   > I personally think this new type is not friendly to use. why should we set the attribute value to null to remove.
   > eg:"methods": ["GET", null, null, null, null, null, null, null, null]
   > thanks
   
   agree, we need to easier way for this case


----------------------------------------------------------------
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] [incubator-apisix] juzhiyuan commented on issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823#issuecomment-657238287


   Why not use standard RESTful API? I prefer this style:
   
   ```
   PATCH http://127.0.0.1:9080/apisix/admin/routes/1 -d {a: b}
   ```
   


----------------------------------------------------------------
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] [incubator-apisix] nic-chen commented on issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823#issuecomment-656502813


   > @nic-chen do you have time to look at this issue?
   
   OK


----------------------------------------------------------------
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] [incubator-apisix] membphis commented on issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
membphis commented on issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823#issuecomment-657224665


   I can accept both styles. 
   
   ```
   {
       "sub_path": {xxxx}
       ... ...
   }
   ```
   
   ```
   # style 1: sub path
   curl -X PATCH http://xxxxx/routes/1/sub_path -d {xxxx}
   
   # style 2: path
   curl -X PATCH http://xxxxx/routes/1 -d {sub_path: {xxxx}}
   ```


----------------------------------------------------------------
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] [incubator-apisix] DHB-liuhong commented on issue #1823: request help: apisix 1.4 can not patch upstream nodes configure

Posted by GitBox <gi...@apache.org>.
DHB-liuhong commented on issue #1823:
URL: https://github.com/apache/incubator-apisix/issues/1823#issuecomment-657326709


   I personally think this new type is not friendly to use


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