Merge "Fix API ref with regards to OR queries"

This commit is contained in:
Jenkins 2017-05-24 19:46:01 +00:00 committed by Gerrit Code Review
commit 1ebbeaaefe
1 changed files with 20 additions and 8 deletions

View File

@ -125,18 +125,30 @@ For example, the following request returns all networks named ``foobar``:
GET /v2.0/networks?name=foobar GET /v2.0/networks?name=foobar
When you specify multiple filters, the Networking API v2.0 returns only objects When you specify multiple filters using different fields, the Networking API
that meet all filtering criteria. The operation applies an AND condition among v2.0 returns only objects that meet all filtering criteria. The operation
the filters. applies an AND condition among different filter fields.
OpenStack Networking offers an OR mechanism for filters by repeating the field
with the different OR criteria. For example, to find all networks named
``foobar`` OR ``bizbaz``:
.. code::
GET /v2.0/networks?name=foobar&name=bizbaz
ORs and ANDs can be combined. For example, if you want all networks with
admin_state_up=True and shared=True and named 'foobar' or 'bizbaz':
.. code::
GET /v2.0/networks?name=foobar&name=bizbaz&admin_state_up=True&shared=True
Note Note
---- ----
OpenStack Networking does not offer an OR mechanism for filters.
Alternatively, you can issue a distinct request for each filter and build a
response set from the received responses on the client-side.
By default, OpenStack Networking returns all attributes for any show or list By default, OpenStack Networking returns all attributes for any show or list
call. The Networking API v2.0 has a mechanism to limit the set of attributes call. The Networking API v2.0 has a mechanism to limit the set of attributes
returned. For example, return ``id``. returned. For example, return ``id``.