Hi all,

Please disregard the email below since I used the wrong template. Sorry about 
that. The email with the same content was re-sent in a new thread 
http://lists.openstack.org/pipermail/openstack-dev/2018-March/128022.html .

Best regards,

From: Hongbin Lu
Sent: March-07-18 4:02 PM
To: OpenStack Development Mailing List (not for usage questions) 
Subject: [api-wg][api][neutron] How to handle invalid query parameters

Hi all,

This is a follow-up for the discussion in Dublin PTG about how Neutron API 
server should handle invalid query parameter [1]. According to the feedback, I 
sent this ML to seek advice from API-WG in this regards.

As a brief recap, we were discussing how Neutron API server should behave if 
invalid query parameters were inputted. Per my understanding, the general 
consensus is to make Neutron API server behave consistently with other 
OpenStack projects. The question for API-WG is if there is any guideline to 
clarify how OpenStack projects should handle invalid query parameters. Query 
parameters are various across different projects but it seems most projects 
support these four categories of query parameters: sorting, pagination, 
filtering, and fields selection. I saw API-WG provided a guideline to define 
how to handle valid parameters of these categories [2], but it doesn’t seem to 
define how to handle invalid parameters.

I wonder if API-WG could clarify it. For example, if users provide an invalid 
filter on listing the resources, should the API server ignore the invalid 
filter and return a successful response? Or it should return an error response? 
Below is a list of specific scenarios and examples to consider:

1. Invalid sorting. For example:

  GET "/v2.0/networks?sort_dir=desc&sort_key=<invalid_field>"
  GET "/v2.0/networks?sort_dir=<invalid_sort_dir>&sort_key=xxx"

2. Invalid pagination. For example:

  GET "/v2.0/networks?limit=<invalid_limit>&marker=xxx"
  GET "/v2.0/networks?limit=1&marker=<invalid_marker>"

3. Invalid filter. For example:

GET "/v2.0/networks?<invalid_field>=xxx"
GET "/v2.0/networks?xxx=<invalid_value>"

4. Invalid field. For example:

  GET "/v2.0/networks?fields=<invalid_field>"

Best regards,

[1] https://bugs.launchpad.net/neutron/+bug/1749820

华为技术有限公司 Huawei Technologies Co., Ltd.

This e-mail and its attachments contain confidential information from HUAWEI, 
is intended only for the person or entity whose address is listed above. Any 
use of the
information contained herein in any way (including, but not limited to, total 
or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify 
the sender by
phone or email immediately and delete it!

OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe

Reply via email to