From f1e03f3dbf6dae0d28c9e1d00bb20f3db42ca68f Mon Sep 17 00:00:00 2001 From: Kevin Benton Date: Wed, 24 May 2017 12:31:35 -0700 Subject: [PATCH] Fix API ref with regards to OR queries Neutron supports OR queries and has for a significant amount of time. Change-Id: I40cb0814f34833f33aad74ee4cc54ca753983e05 --- api-ref/source/v2/intro.inc | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/api-ref/source/v2/intro.inc b/api-ref/source/v2/intro.inc index aa604d99e..0fec7ca2f 100644 --- a/api-ref/source/v2/intro.inc +++ b/api-ref/source/v2/intro.inc @@ -125,18 +125,30 @@ For example, the following request returns all networks named ``foobar``: GET /v2.0/networks?name=foobar -When you specify multiple filters, the Networking API v2.0 returns only objects -that meet all filtering criteria. The operation applies an AND condition among -the filters. +When you specify multiple filters using different fields, the Networking API +v2.0 returns only objects that meet all filtering criteria. The operation +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 ---- -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 call. The Networking API v2.0 has a mechanism to limit the set of attributes returned. For example, return ``id``.