From f3b0cf39750f455f33d2e259690ce9050cd05236 Mon Sep 17 00:00:00 2001 From: Eric Fried Date: Mon, 5 Feb 2018 10:27:24 -0600 Subject: [PATCH] placement doc: Conflict caveat for DELETE APIs Since the DELETE /resource_providers/{u}/inventories and .../traits APIs don't have a way to accept generation, they're not "threadsafe" in the sense of multiple client threads managing traits/inventories for the same provider. This change adds a note to the documentation for these APIs to this effect, suggesting the use of PUT with empty traits/inventories instead. Change-Id: Icfd79cc1f5a912131845a22b4fe900147b19f934 Closes-Bug: #1746373 --- placement-api-ref/source/inventories.inc | 6 ++++++ placement-api-ref/source/resource_provider_traits.inc | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/placement-api-ref/source/inventories.inc b/placement-api-ref/source/inventories.inc index cfbba286e7a8..4d5eb2bac19f 100644 --- a/placement-api-ref/source/inventories.inc +++ b/placement-api-ref/source/inventories.inc @@ -115,6 +115,12 @@ Normal Response Codes: 204 Error response codes: itemNotFound(404), conflict(409) +.. note:: Since this request does not accept the resource provider generation, + it is not safe to use when multiple threads are managing inventories + for a single provider. In such situations, use the + ``PUT /resource_providers/{uuid}/inventories`` API with an empty + ``inventories`` dict. + Request ------- diff --git a/placement-api-ref/source/resource_provider_traits.inc b/placement-api-ref/source/resource_provider_traits.inc index 74bb20c4b6ac..73a491ac82fe 100644 --- a/placement-api-ref/source/resource_provider_traits.inc +++ b/placement-api-ref/source/resource_provider_traits.inc @@ -102,6 +102,12 @@ Error response codes: itemNotFound(404), conflict(409) * `409 Conflict` if the provider's traits are updated by another thread while attempting the operation. +.. note:: Since this request does not accept the resource provider generation, + it is not safe to use when multiple threads are managing traits for + a single provider. In such situations, use the + ``PUT /resource_providers/{uuid}/traits`` API with an empty + ``traits`` list. + Request -------