From c658eef7aebc07eea278acfcc25804a565cfd094 Mon Sep 17 00:00:00 2001 From: Henry Nash Date: Tue, 27 Aug 2013 16:13:35 +0100 Subject: [PATCH] Support inexact filtering on attributes Being able to specify inexact filters on attributes is an important part of ensuring the size of collections returned by list API calls is minimized DocImpact Partially implements bp filtering-backend-support Change-Id: If81f6644217f121afeed00b867f369ec257e63b3 --- .../v3/src/markdown/identity-api-v3.md | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/openstack-identity-api/v3/src/markdown/identity-api-v3.md b/openstack-identity-api/v3/src/markdown/identity-api-v3.md index c6cceb7f..a4c6b326 100644 --- a/openstack-identity-api/v3/src/markdown/identity-api-v3.md +++ b/openstack-identity-api/v3/src/markdown/identity-api-v3.md @@ -18,6 +18,7 @@ These features are not yet considered stable (expected January 2014). validation. - Introduced a region resource for constructing a hierarchical container of groups of service endpoints +- Inexact filtering is supported on string attributes What's New in Version 3.1 ------------------------- @@ -269,6 +270,11 @@ with one or more attribute/value pairs: GET /entities?name={entity_name}&enabled={entity_enabled} +If multiple filters are specified in a query, then all filters must match for +an entity to be included in the response. The values specified in a filter +must be of the same type as the attribute, and in the case of strings are +limited to the same maximum length as the attribute. + The response is a subset of the full collection: 200 OK @@ -292,6 +298,45 @@ The response is a subset of the full collection: } } +*New in version 3.2* String attributes may also be filtered using inexact +patterns, for example: + + GET /entities?name__startswith={initial_characters_of_entity_name} + +The following inexact suffixes are supported: + +- `__startswith` + + Matches if the attribute starts with the characters specified, with the + comparison being case-sensitive. + +- `__istartswith` + + Matches if the attribute starts with the characters specified, with the + comparison being case-insensitive. + +- `__endswith` + + Matches if the attribute ends with the characters specified, with the + comparison being case-sensitive. + +- `__iendswith` + + Matches if the attribute ends with the characters specified, with the + comparison being case-insensitive. + +- `__contains` + + Matches if the attribute contains the characters specified, with the + comparison being case-sensitive. + +- `__icontains` + + Matches if the attribute contains the characters specified, with the + comparison being case-insensitive. + +Inexact filters specified for non-string attributes will be ignored. + #### Get an Entity Request a specific entity by ID: