From 96cc7144893309141a0537dfc40608e428ce944d Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Fri, 14 Jul 2017 10:41:06 -0400 Subject: [PATCH 1/2] Update smart inventory acceptance --- docs/inventory_refresh.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/inventory_refresh.md b/docs/inventory_refresh.md index ae58cf9c7b..88064261dd 100644 --- a/docs/inventory_refresh.md +++ b/docs/inventory_refresh.md @@ -99,14 +99,18 @@ hosts with a name containing "nyc". ### Acceptance Critera When verifying acceptance we should ensure the following statements are true: +`` * `Inventory` has a new field named `kind` that defaults to empty and can only be set to `smart`. * `Inventory` has a new field named `host_filter` to empty and can only be set to a valid _SmartFilter_ string. -* `Inventory` with a `host_filter` set and a `kind` of `smart` will have -a `hosts` list reflecting the results of searching `/api/v2/hosts` with the same +* `Inventory` with a `host_filter` set and a `kind` of `smart`: + * `hosts` list reflecting the results of searching `/api/v2/hosts` with the same search that is set in the `host_filter`. + * Not allow creation of Hosts + * Not allow creation of Groups + * Not allow creation of Inventory Sources ### API Concerns There are no breaking or backwards incompatible changes for this feature. From fe03181d4e91c55194550662800e0b94c6b9229b Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Fri, 14 Jul 2017 10:43:25 -0400 Subject: [PATCH 2/2] update acceptance for /host/:id/smart_inventories --- docs/inventory_refresh.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/inventory_refresh.md b/docs/inventory_refresh.md index 88064261dd..77cd0509ee 100644 --- a/docs/inventory_refresh.md +++ b/docs/inventory_refresh.md @@ -53,9 +53,12 @@ is the combination that makes a _Smart Inventory_. * `Host` model has a new field called `smart_inventories`. This field uses the `SmartInventoryMemberships` lookup table to provide a set of all of the _Smart Inventory_ a host is a part of. The memberships -are generated by the `update_host_smart_inventory_memberships` task. This task is called when the view for -`/api/v2/hosts/:id/smart_inventories` is materialized. NOTE: This task is only run if the -`AWX_REBUILD_SMART_MEMBERSHIP` is set to True. It defaults to False. +are generated by the `update_host_smart_inventory_memberships` task. The task is launched when: + * New Host is added. + * Existing Host is changed (update/delete). + * New Smart Inventory is added. + * Existing Smart Inventory is changed (update/delete). + * NOTE: This task is only run if the `AWX_REBUILD_SMART_MEMBERSHIP` is set to True. It defaults to False. ### Smart Filter (host_filter) The `SmartFilter` class handles our translation of the smart search string. We store the