)]}'
{"specs/newton/approved/generic-resource-pools.rst":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"07e85ea0f8dd45213c2e814b52e144903a9b141b","unresolved":false,"context_lines":[{"line_number":794,"context_line":"        \"VCPU\": 2,"},{"line_number":795,"context_line":"        \"MEMORY_MB\": 1024"},{"line_number":796,"context_line":"      }"},{"line_number":797,"context_line":"    }"},{"line_number":798,"context_line":""},{"line_number":799,"context_line":"The body of the request must match the following JSONSchema document::"},{"line_number":800,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"1aa78d24_913f18b3","line":797,"updated":"2016-07-07 14:03:49.000000000","message":"You\u0027ve got a mismatch here between the url in the header (which has no resource class) and the url here in the example and the body in the example. The body matches the header url.\n\nBased on the discussions we\u0027ve had about a set_allocations method I assume the body and header url are closer to correct.\n\nIf that\u0027s the case, what should the response code be when the body includes an allocation for a resource class for which there is no inventory?\n\nDepending on how this conflict and that question are resolved the response codes below will need some adjustment.","commit_id":"dd41a72ab1bd64fa6306a216482c2f2f77abbaf7"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9f103f7339a8d0ae576d6459f224a14e0a314c8c","unresolved":false,"context_lines":[{"line_number":794,"context_line":"        \"VCPU\": 2,"},{"line_number":795,"context_line":"        \"MEMORY_MB\": 1024"},{"line_number":796,"context_line":"      }"},{"line_number":797,"context_line":"    }"},{"line_number":798,"context_line":""},{"line_number":799,"context_line":"The body of the request must match the following JSONSchema document::"},{"line_number":800,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"1aa78d24_a399297b","line":797,"in_reply_to":"1aa78d24_913f18b3","updated":"2016-07-07 14:31:41.000000000","message":"Done","commit_id":"dd41a72ab1bd64fa6306a216482c2f2f77abbaf7"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"07e85ea0f8dd45213c2e814b52e144903a9b141b","unresolved":false,"context_lines":[{"line_number":820,"context_line":"* `204 No Content` if the allocation record is successfully created"},{"line_number":821,"context_line":"* `404 Not Found` if the resource provider identified by `{uuid}` was"},{"line_number":822,"context_line":"  not found or if `{resource_class}` is an unknown resource class"},{"line_number":823,"context_line":"* `400 Bad Request` for bad or invalid synta"},{"line_number":824,"context_line":"* `409 Conflict` if there is already an allocation record for the specified"},{"line_number":825,"context_line":"  consumer and resource class against the specified resource provider."},{"line_number":826,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"1aa78d24_e61fc4b4","line":823,"updated":"2016-07-07 14:03:49.000000000","message":"syntax","commit_id":"dd41a72ab1bd64fa6306a216482c2f2f77abbaf7"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9f103f7339a8d0ae576d6459f224a14e0a314c8c","unresolved":false,"context_lines":[{"line_number":820,"context_line":"* `204 No Content` if the allocation record is successfully created"},{"line_number":821,"context_line":"* `404 Not Found` if the resource provider identified by `{uuid}` was"},{"line_number":822,"context_line":"  not found or if `{resource_class}` is an unknown resource class"},{"line_number":823,"context_line":"* `400 Bad Request` for bad or invalid synta"},{"line_number":824,"context_line":"* `409 Conflict` if there is already an allocation record for the specified"},{"line_number":825,"context_line":"  consumer and resource class against the specified resource provider."},{"line_number":826,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"1aa78d24_e38df131","line":823,"in_reply_to":"1aa78d24_e61fc4b4","updated":"2016-07-07 14:31:41.000000000","message":"Done","commit_id":"dd41a72ab1bd64fa6306a216482c2f2f77abbaf7"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"07e85ea0f8dd45213c2e814b52e144903a9b141b","unresolved":false,"context_lines":[{"line_number":840,"context_line":"* `204 No Content` if the allocation record is successfully removed"},{"line_number":841,"context_line":"* `404 Not Found` if the resource provider identified by `{uuid}` was not found"},{"line_number":842,"context_line":"  or if there is no associated allocation recordis for `{consumer_uuid}`"},{"line_number":843,"context_line":"* `400 Bad Request` for bad or invalid syntax"},{"line_number":844,"context_line":""},{"line_number":845,"context_line":"Security impact"},{"line_number":846,"context_line":"---------------"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1aa78d24_e6198423","line":843,"updated":"2016-07-07 14:03:49.000000000","message":"With an empty body, what kind of invalid syntax are we expecting? 404 covers anything from the URL, doesn\u0027t it?","commit_id":"dd41a72ab1bd64fa6306a216482c2f2f77abbaf7"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9f103f7339a8d0ae576d6459f224a14e0a314c8c","unresolved":false,"context_lines":[{"line_number":840,"context_line":"* `204 No Content` if the allocation record is successfully removed"},{"line_number":841,"context_line":"* `404 Not Found` if the resource provider identified by `{uuid}` was not found"},{"line_number":842,"context_line":"  or if there is no associated allocation recordis for `{consumer_uuid}`"},{"line_number":843,"context_line":"* `400 Bad Request` for bad or invalid syntax"},{"line_number":844,"context_line":""},{"line_number":845,"context_line":"Security impact"},{"line_number":846,"context_line":"---------------"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1aa78d24_0392bd4b","line":843,"in_reply_to":"1aa78d24_e6198423","updated":"2016-07-07 14:31:41.000000000","message":"Done","commit_id":"dd41a72ab1bd64fa6306a216482c2f2f77abbaf7"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"07e85ea0f8dd45213c2e814b52e144903a9b141b","unresolved":false,"context_lines":[{"line_number":921,"context_line":""},{"line_number":922,"context_line":"* Create database models and migrations for new `resource_provider_aggregates`"},{"line_number":923,"context_line":"  table."},{"line_number":924,"context_line":"* Create `nova.objects` models for `ResourceOrovider`"},{"line_number":925,"context_line":"* Create REST API controllers for resource provider querying and handling"},{"line_number":926,"context_line":"* Modify resource tracker to pull information on aggregates the compute node is"},{"line_number":927,"context_line":"  associated with and the resource providers available for those aggregates. If the"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1aa78d24_a6eadcd8","line":924,"updated":"2016-07-07 14:03:49.000000000","message":"ResourceProvider","commit_id":"dd41a72ab1bd64fa6306a216482c2f2f77abbaf7"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9f103f7339a8d0ae576d6459f224a14e0a314c8c","unresolved":false,"context_lines":[{"line_number":921,"context_line":""},{"line_number":922,"context_line":"* Create database models and migrations for new `resource_provider_aggregates`"},{"line_number":923,"context_line":"  table."},{"line_number":924,"context_line":"* Create `nova.objects` models for `ResourceOrovider`"},{"line_number":925,"context_line":"* Create REST API controllers for resource provider querying and handling"},{"line_number":926,"context_line":"* Modify resource tracker to pull information on aggregates the compute node is"},{"line_number":927,"context_line":"  associated with and the resource providers available for those aggregates. If the"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1aa78d24_a3a769a5","line":924,"in_reply_to":"1aa78d24_a6eadcd8","updated":"2016-07-07 14:31:41.000000000","message":"Done","commit_id":"dd41a72ab1bd64fa6306a216482c2f2f77abbaf7"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"f1f233fdde8b66e29b416f948e3ec62f0f17fd93","unresolved":false,"context_lines":[{"line_number":819,"context_line":""},{"line_number":820,"context_line":"* `204 No Content` if the allocation record is successfully created"},{"line_number":821,"context_line":"* `404 Not Found` if the resource provider identified by `{uuid}` was"},{"line_number":822,"context_line":"  not found or if `{resource_class}` is an unknown resource class"},{"line_number":823,"context_line":"* `400 Bad Request` for bad or invalid syntax"},{"line_number":824,"context_line":"* `409 Conflict` if there is already an allocation record for the specified"},{"line_number":825,"context_line":"  consumer and resource class against the specified resource provider."}],"source_content_type":"text/x-rst","patch_set":4,"id":"1aa78d24_56112151","line":822,"updated":"2016-07-07 14:38:07.000000000","message":"There\u0027s no longer a {resource_class} in the url. And my question from before still stands:\n\nWhat should the response code be when the body includes an allocation for a resource class for which there is no inventory? 400 or 409 both kinda make sense.","commit_id":"3d975c9142d8ea76fed0f37ddadc4791c9aaca6c"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"0cf8b8845c2c2b2e3672822a79967c08c7520462","unresolved":false,"context_lines":[{"line_number":813,"context_line":"            \"allocations\""},{"line_number":814,"context_line":"        ],"},{"line_number":815,"context_line":"        \"additionalProperties\": False"},{"line_number":816,"context_line":"    }"},{"line_number":817,"context_line":""},{"line_number":818,"context_line":"The returned HTTP response code will be one of the following:"},{"line_number":819,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"1aa78d24_352c02ab","line":816,"updated":"2016-07-08 17:40:51.000000000","message":"nit, in case there\u0027s another one and we want the spec to comprehensive, the jsonschema is:\n\n    {\"type\": \"object\",\n      \"properties\": {\n        \"allocations\": {\n          \"type\": \"object\",\n          \"patternProperties\": {\n            \"^[A-Z_]+$\": {\"type\": \"integer\"}\n          }\n        }\n      },\n      \"required\": [\"allocations\"],\n      \"additionalProperties\": false\n    }","commit_id":"5840b89808e24e0401deab0b058bd3a14673070d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"815ca5826f5f0c1fa54c06bcb776d76c26c0ad6d","unresolved":false,"context_lines":[{"line_number":813,"context_line":"            \"allocations\""},{"line_number":814,"context_line":"        ],"},{"line_number":815,"context_line":"        \"additionalProperties\": False"},{"line_number":816,"context_line":"    }"},{"line_number":817,"context_line":""},{"line_number":818,"context_line":"The returned HTTP response code will be one of the following:"},{"line_number":819,"context_line":""}],"source_content_type":"text/x-rst","patch_set":5,"id":"1aa78d24_ca599890","line":816,"in_reply_to":"1aa78d24_352c02ab","updated":"2016-07-08 18:48:46.000000000","message":"the allocations objects needs \u0027\"additionalProperties\": False\u0027","commit_id":"5840b89808e24e0401deab0b058bd3a14673070d"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"dab07da92a1c9d2ab8a5b4ff024f31f1a6eba3c0","unresolved":false,"context_lines":[{"line_number":789,"context_line":""},{"line_number":790,"context_line":"Example::"},{"line_number":791,"context_line":""},{"line_number":792,"context_line":"    PUT /allocations/9a82ff67-26e2-4d0a-a7e1-746788a85646"},{"line_number":793,"context_line":"    {"},{"line_number":794,"context_line":"      \"allocations\": {"},{"line_number":795,"context_line":"        \"fa84d9e3-ab3b-4240-8eee-e8f1138b3423\": {"}],"source_content_type":"text/x-rst","patch_set":6,"id":"dada55a8_1eda58e8","line":792,"range":{"start_line":792,"start_character":21,"end_line":792,"end_character":57},"updated":"2016-07-20 17:48:39.000000000","message":"I assume consumer_id \u003d\u003d instance_uuid \n\nOkay with me.","commit_id":"aa004cc59c28ea034cfaab8c91d3d5a93ab70ee1"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"562b5e256d15bdac377151a5dfc154033ac137ea","unresolved":false,"context_lines":[{"line_number":789,"context_line":""},{"line_number":790,"context_line":"Example::"},{"line_number":791,"context_line":""},{"line_number":792,"context_line":"    PUT /allocations/9a82ff67-26e2-4d0a-a7e1-746788a85646"},{"line_number":793,"context_line":"    {"},{"line_number":794,"context_line":"      \"allocations\": {"},{"line_number":795,"context_line":"        \"fa84d9e3-ab3b-4240-8eee-e8f1138b3423\": {"}],"source_content_type":"text/x-rst","patch_set":6,"id":"dada55a8_4de9c0e5","line":792,"in_reply_to":"dada55a8_1eda58e8","updated":"2016-07-20 19:30:33.000000000","message":"In the most common case, the consumer_uuid will be an instance_uuid but by giving it a different name here we keep it clear that it could be something else.","commit_id":"aa004cc59c28ea034cfaab8c91d3d5a93ab70ee1"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"dab07da92a1c9d2ab8a5b4ff024f31f1a6eba3c0","unresolved":false,"context_lines":[{"line_number":792,"context_line":"    PUT /allocations/9a82ff67-26e2-4d0a-a7e1-746788a85646"},{"line_number":793,"context_line":"    {"},{"line_number":794,"context_line":"      \"allocations\": {"},{"line_number":795,"context_line":"        \"fa84d9e3-ab3b-4240-8eee-e8f1138b3423\": {"},{"line_number":796,"context_line":"          \"DISK_GB\": 10"},{"line_number":797,"context_line":"        },"},{"line_number":798,"context_line":"        \"7dd1cd8a-4058-4f58-a24a-e38a5f4d563e\": {"}],"source_content_type":"text/x-rst","patch_set":6,"id":"dada55a8_61fe55af","line":795,"range":{"start_line":795,"start_character":9,"end_line":795,"end_character":47},"updated":"2016-07-20 17:48:39.000000000","message":"I\u0027m not a Mr. API so I leave others opiniating about that, but it seems to me that we\u0027re keying our body args with attributes that we know of, and not being dynamic like here the RP UUID.\n\neg. I wonder if it should rather be :\n\n        \"allocations\" : [\n            {\n                \"rp_uuid\" : \"fa84d9e3-ab3b-4240-8eee-e8f1138b3423\",\n                \"resource_class\" : \"DISK_GB\",\n                \"amount\": 10\n            },\n            {\n                \"rp_uuid\" : \"7dd1cd8a-4058-4f58-a24a-e38a5f4d563e\",\n                \"resource_class\" : \"VCPU\",\n                \"amount\": 2\n            },\n            {\n                \"rp_uuid\" : \"7dd1cd8a-4058-4f58-a24a-e38a5f4d563e\",\n                \"resource_class\" : \"MEMORY_MB\",\n                \"amount\": 1024\n            }\n\n        ]\n\nAlso, should we constraint the resource_class enum in the parameter type, or should we be free-form and then return a HTTP40x if the resource_class is not existing?","commit_id":"aa004cc59c28ea034cfaab8c91d3d5a93ab70ee1"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ae98018f89f0f0a3f64c3fd60cfd8c91982ef740","unresolved":false,"context_lines":[{"line_number":792,"context_line":"    PUT /allocations/9a82ff67-26e2-4d0a-a7e1-746788a85646"},{"line_number":793,"context_line":"    {"},{"line_number":794,"context_line":"      \"allocations\": {"},{"line_number":795,"context_line":"        \"fa84d9e3-ab3b-4240-8eee-e8f1138b3423\": {"},{"line_number":796,"context_line":"          \"DISK_GB\": 10"},{"line_number":797,"context_line":"        },"},{"line_number":798,"context_line":"        \"7dd1cd8a-4058-4f58-a24a-e38a5f4d563e\": {"}],"source_content_type":"text/x-rst","patch_set":6,"id":"bacf61ea_09f8f7e4","line":795,"updated":"2016-07-27 20:40:53.000000000","message":"Yeah, it might be good to have a more future-proof request payload schema. You never know, we may want to pass things like user_id and/or project_id in the future...\n\nI changed the proposed request payload to be like this:\n\n {\n   \"allocations\": [\n     {\n       \"resource_provider\": {\n         \"uuid\": \u003cRP1_UUID\u003e\n       },\n       \"resources\": {\n         \"VCPU\": 2,\n         \"MEMORY_MB\": 1024         \n       }\n     },\n     {\n       \"resource_provider\": {\n         \"uuid\": \u003cRP2_UUID\u003e\n       },\n       \"resources\": {\n         \"DISK_GB\": 1024\n       }\n     }\n   ]\n }\n\nI\u0027ll update the amendment proposal accordingly.","commit_id":"aa004cc59c28ea034cfaab8c91d3d5a93ab70ee1"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8012e86f2dfcd297fcf75f6d73e9ec6437287d28","unresolved":false,"context_lines":[{"line_number":792,"context_line":"    PUT /allocations/9a82ff67-26e2-4d0a-a7e1-746788a85646"},{"line_number":793,"context_line":"    {"},{"line_number":794,"context_line":"      \"allocations\": {"},{"line_number":795,"context_line":"        \"fa84d9e3-ab3b-4240-8eee-e8f1138b3423\": {"},{"line_number":796,"context_line":"          \"DISK_GB\": 10"},{"line_number":797,"context_line":"        },"},{"line_number":798,"context_line":"        \"7dd1cd8a-4058-4f58-a24a-e38a5f4d563e\": {"}],"source_content_type":"text/x-rst","patch_set":6,"id":"dada55a8_035679cd","line":795,"in_reply_to":"dada55a8_2d01ec38","updated":"2016-07-20 19:58:14.000000000","message":"So, there are 2 distinct points here: \n- #1 I leave others opiniating on the request body format in between your proposal and mine, because like I said, I\u0027m not expert but I\u0027m following the existing patterns I saw. While I understand the reasoning behind a dict keyed by a RP UUID, I\u0027m just thinking a flat list of allocations seems quite easier to programmatically provide and also have a better JSONSchema describing what is an allocation. \n\n- #2 Sure, HTTP400 is for free with arguments that don\u0027t match the parameter type. Here, I\u0027m wondering whether we should fail fast at the API level by verifying the semantics and make sure that resource_class exists. When looking at the other API resources said in that spec, it seems we\u0027re in favor of that, so okay to me.","commit_id":"aa004cc59c28ea034cfaab8c91d3d5a93ab70ee1"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"562b5e256d15bdac377151a5dfc154033ac137ea","unresolved":false,"context_lines":[{"line_number":792,"context_line":"    PUT /allocations/9a82ff67-26e2-4d0a-a7e1-746788a85646"},{"line_number":793,"context_line":"    {"},{"line_number":794,"context_line":"      \"allocations\": {"},{"line_number":795,"context_line":"        \"fa84d9e3-ab3b-4240-8eee-e8f1138b3423\": {"},{"line_number":796,"context_line":"          \"DISK_GB\": 10"},{"line_number":797,"context_line":"        },"},{"line_number":798,"context_line":"        \"7dd1cd8a-4058-4f58-a24a-e38a5f4d563e\": {"}],"source_content_type":"text/x-rst","patch_set":6,"id":"dada55a8_2d01ec38","line":795,"in_reply_to":"dada55a8_61fe55af","updated":"2016-07-20 19:30:33.000000000","message":"The initial reason I didn\u0027t do a list of \"objects\" with an \"rp_uuid\" key is because an allocation is strongly associated with a resource provider and the dict structure enforces that.\n\nHowever, perhaps more importantly, if there is a set of allocations to a resource provider with more than one resource class we need to make it both semantically and technically clear and easy that it will be written to the persistence layer in one go where the generation of the resource provider is updated just once. A dict keyed by resource provider represents that more clearly. From my standpoint we don\u0027t want more than one object being the same resource provider.\n\nThe resource class value is jsonschema checked to be uppercase letters and numbers (I got the schema slightly wrong below) and will 400 if the syntax is invalid. It will also 400 if the syntax is bad (the resource class does not exist).","commit_id":"aa004cc59c28ea034cfaab8c91d3d5a93ab70ee1"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"dab07da92a1c9d2ab8a5b4ff024f31f1a6eba3c0","unresolved":false,"context_lines":[{"line_number":817,"context_line":"              \"^[0-9a-fA-F-]+$\": {"},{"line_number":818,"context_line":"                \"type\": \"object\","},{"line_number":819,"context_line":"                \"patternProperties\": {"},{"line_number":820,"context_line":"                  \"^[A-Z_]+$\": {\"type\": \"integer\"}"},{"line_number":821,"context_line":"                }"},{"line_number":822,"context_line":"              }"},{"line_number":823,"context_line":"            },"}],"source_content_type":"text/x-rst","patch_set":6,"id":"dada55a8_1e6c1834","line":820,"range":{"start_line":820,"start_character":41,"end_line":820,"end_character":48},"updated":"2016-07-20 17:48:39.000000000","message":"So, for the moment, an integer is good by me, and given we should have dynamic-resource-pools for complex resource types, I think it\u0027s okay.\nAnyway, given we will have microversions in place, if we think that we need to have something other than an integer, then it would be possible to modify it in the future.","commit_id":"aa004cc59c28ea034cfaab8c91d3d5a93ab70ee1"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"562b5e256d15bdac377151a5dfc154033ac137ea","unresolved":false,"context_lines":[{"line_number":817,"context_line":"              \"^[0-9a-fA-F-]+$\": {"},{"line_number":818,"context_line":"                \"type\": \"object\","},{"line_number":819,"context_line":"                \"patternProperties\": {"},{"line_number":820,"context_line":"                  \"^[A-Z_]+$\": {\"type\": \"integer\"}"},{"line_number":821,"context_line":"                }"},{"line_number":822,"context_line":"              }"},{"line_number":823,"context_line":"            },"}],"source_content_type":"text/x-rst","patch_set":6,"id":"dada55a8_6818f275","line":820,"in_reply_to":"dada55a8_1e6c1834","updated":"2016-07-20 19:30:33.000000000","message":"Being an integer is part of the basic concept of inventories and allocations. The Inventory describes a whole number quantity of a type of resource from you can have a whole number quantity.","commit_id":"aa004cc59c28ea034cfaab8c91d3d5a93ab70ee1"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8012e86f2dfcd297fcf75f6d73e9ec6437287d28","unresolved":false,"context_lines":[{"line_number":817,"context_line":"              \"^[0-9a-fA-F-]+$\": {"},{"line_number":818,"context_line":"                \"type\": \"object\","},{"line_number":819,"context_line":"                \"patternProperties\": {"},{"line_number":820,"context_line":"                  \"^[A-Z_]+$\": {\"type\": \"integer\"}"},{"line_number":821,"context_line":"                }"},{"line_number":822,"context_line":"              }"},{"line_number":823,"context_line":"            },"}],"source_content_type":"text/x-rst","patch_set":6,"id":"dada55a8_a3320da5","line":820,"in_reply_to":"dada55a8_6818f275","updated":"2016-07-20 19:58:14.000000000","message":"Sure, was just providing a comment for mentioning that I thought about that not being a problem, thanks to the dynamic-resource-classes.","commit_id":"aa004cc59c28ea034cfaab8c91d3d5a93ab70ee1"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"dab07da92a1c9d2ab8a5b4ff024f31f1a6eba3c0","unresolved":false,"context_lines":[{"line_number":831,"context_line":"The returned HTTP response code will be one of the following:"},{"line_number":832,"context_line":""},{"line_number":833,"context_line":"* `204 No Content` if the allocation record is successfully created"},{"line_number":834,"context_line":"* `400 Bad Request` for bad or invalid syntax"},{"line_number":835,"context_line":"* `409 Conflict` if there is already an allocation record for the specified"},{"line_number":836,"context_line":"  consumer against a specified resource provider. We don\u0027t support updating a"},{"line_number":837,"context_line":"  set of allocation records for a consumer. The allocation records for a"}],"source_content_type":"text/x-rst","patch_set":6,"id":"dada55a8_d40b8122","line":834,"range":{"start_line":834,"start_character":25,"end_line":834,"end_character":45},"updated":"2016-07-20 17:48:39.000000000","message":"which could include also invalid resource classes, nope ?","commit_id":"aa004cc59c28ea034cfaab8c91d3d5a93ab70ee1"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8012e86f2dfcd297fcf75f6d73e9ec6437287d28","unresolved":false,"context_lines":[{"line_number":831,"context_line":"The returned HTTP response code will be one of the following:"},{"line_number":832,"context_line":""},{"line_number":833,"context_line":"* `204 No Content` if the allocation record is successfully created"},{"line_number":834,"context_line":"* `400 Bad Request` for bad or invalid syntax"},{"line_number":835,"context_line":"* `409 Conflict` if there is already an allocation record for the specified"},{"line_number":836,"context_line":"  consumer against a specified resource provider. We don\u0027t support updating a"},{"line_number":837,"context_line":"  set of allocation records for a consumer. The allocation records for a"}],"source_content_type":"text/x-rst","patch_set":6,"id":"dada55a8_8318a91f","line":834,"in_reply_to":"dada55a8_48436e42","updated":"2016-07-20 19:58:14.000000000","message":"Yeah, I replied to that, I\u0027m okay with that.","commit_id":"aa004cc59c28ea034cfaab8c91d3d5a93ab70ee1"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"562b5e256d15bdac377151a5dfc154033ac137ea","unresolved":false,"context_lines":[{"line_number":831,"context_line":"The returned HTTP response code will be one of the following:"},{"line_number":832,"context_line":""},{"line_number":833,"context_line":"* `204 No Content` if the allocation record is successfully created"},{"line_number":834,"context_line":"* `400 Bad Request` for bad or invalid syntax"},{"line_number":835,"context_line":"* `409 Conflict` if there is already an allocation record for the specified"},{"line_number":836,"context_line":"  consumer against a specified resource provider. We don\u0027t support updating a"},{"line_number":837,"context_line":"  set of allocation records for a consumer. The allocation records for a"}],"source_content_type":"text/x-rst","patch_set":6,"id":"dada55a8_48436e42","line":834,"in_reply_to":"dada55a8_d40b8122","updated":"2016-07-20 19:30:33.000000000","message":"Yes, see my comments above, I can add some text to expand like that here if that makes sense?","commit_id":"aa004cc59c28ea034cfaab8c91d3d5a93ab70ee1"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ae98018f89f0f0a3f64c3fd60cfd8c91982ef740","unresolved":false,"context_lines":[{"line_number":835,"context_line":"* `409 Conflict` if there is already an allocation record for the specified"},{"line_number":836,"context_line":"  consumer against a specified resource provider. We don\u0027t support updating a"},{"line_number":837,"context_line":"  set of allocation records for a consumer. The allocation records for a"},{"line_number":838,"context_line":"  consumer must be deleted and a new set added."},{"line_number":839,"context_line":""},{"line_number":840,"context_line":"  A `409 Conflict` will also be returned if there is no available"},{"line_number":841,"context_line":"  inventory in any of the specified resource classes."}],"source_content_type":"text/x-rst","patch_set":6,"id":"bacf61ea_69dd3370","line":838,"updated":"2016-07-27 20:40:53.000000000","message":"@alaski: Yeah, I hadn\u0027t thought about the resize to same provider issue. I suppose we can handle it in the immediate future as a DELETE and then PUT with the new allocation amounts (and a PUT with the old allocation amounts if the first PUT fails for inventory exceeded) and just accept the race condition for now. Later, we can think about adding an UPDATE-like call for this scenario.","commit_id":"aa004cc59c28ea034cfaab8c91d3d5a93ab70ee1"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"a8e92355fb69e4cacf852c7a000f46f64d8f17f7","unresolved":false,"context_lines":[{"line_number":835,"context_line":"* `409 Conflict` if there is already an allocation record for the specified"},{"line_number":836,"context_line":"  consumer against a specified resource provider. We don\u0027t support updating a"},{"line_number":837,"context_line":"  set of allocation records for a consumer. The allocation records for a"},{"line_number":838,"context_line":"  consumer must be deleted and a new set added."},{"line_number":839,"context_line":""},{"line_number":840,"context_line":"  A `409 Conflict` will also be returned if there is no available"},{"line_number":841,"context_line":"  inventory in any of the specified resource classes."}],"source_content_type":"text/x-rst","patch_set":6,"id":"1aa78d24_a285f6cf","line":838,"updated":"2016-07-12 04:28:09.000000000","message":"Requiring this workflow introduces/(perpetuates?) a race condition where an instance could be consuming resources but have no entry recording that. This could happen if a resize occurs and the old and new allocation would be against the same resource provider, like with shared storage.","commit_id":"aa004cc59c28ea034cfaab8c91d3d5a93ab70ee1"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"40cae63908cce94e440329100c2485946f8560e1","unresolved":false,"context_lines":[{"line_number":835,"context_line":"* `409 Conflict` if there is already an allocation record for the specified"},{"line_number":836,"context_line":"  consumer against a specified resource provider. We don\u0027t support updating a"},{"line_number":837,"context_line":"  set of allocation records for a consumer. The allocation records for a"},{"line_number":838,"context_line":"  consumer must be deleted and a new set added."},{"line_number":839,"context_line":""},{"line_number":840,"context_line":"  A `409 Conflict` will also be returned if there is no available"},{"line_number":841,"context_line":"  inventory in any of the specified resource classes."}],"source_content_type":"text/x-rst","patch_set":6,"id":"dada55a8_a7ca4f6c","line":838,"in_reply_to":"1aa78d24_a285f6cf","updated":"2016-07-19 23:29:25.000000000","message":"Why aren\u0027t updates supported? Is there a programmatic issue, or is it just to support a cleaner design?","commit_id":"aa004cc59c28ea034cfaab8c91d3d5a93ab70ee1"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"562b5e256d15bdac377151a5dfc154033ac137ea","unresolved":false,"context_lines":[{"line_number":835,"context_line":"* `409 Conflict` if there is already an allocation record for the specified"},{"line_number":836,"context_line":"  consumer against a specified resource provider. We don\u0027t support updating a"},{"line_number":837,"context_line":"  set of allocation records for a consumer. The allocation records for a"},{"line_number":838,"context_line":"  consumer must be deleted and a new set added."},{"line_number":839,"context_line":""},{"line_number":840,"context_line":"  A `409 Conflict` will also be returned if there is no available"},{"line_number":841,"context_line":"  inventory in any of the specified resource classes."}],"source_content_type":"text/x-rst","patch_set":6,"id":"dada55a8_c8759e98","line":838,"in_reply_to":"dada55a8_a7ca4f6c","updated":"2016-07-20 19:30:33.000000000","message":"I\u0027ll leave this to Jay to explain as he\u0027s probably got the most complete and correct answer.","commit_id":"aa004cc59c28ea034cfaab8c91d3d5a93ab70ee1"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"3b1a66aaebf0d2db9e2a864f393da601e8341f62","unresolved":false,"context_lines":[{"line_number":810,"context_line":"          }"},{"line_number":811,"context_line":"        }"},{"line_number":812,"context_line":"      }"},{"line_number":813,"context_line":"    }"},{"line_number":814,"context_line":""},{"line_number":815,"context_line":".. note::"},{"line_number":816,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"bacf61ea_df1dd8be","line":813,"updated":"2016-07-28 09:00:31.000000000","message":"While I agree with the pragmatism in \"You never know, we may want to pass things like user_id and/or project_id in the future...\" I think doing that will actually weaken the conceptual clarity and simplicity of both the API and the data structures on the back end. Since keeping those data structures limited is one of the main reasons for having resource providers, being strict and intentionally limiting right from the start is a valuable constraint that will keep the desire for unfettered future expansion[1] in check.\n\nI\u0027m not -1 on this by any stretch, but if anyone shares my concerns in this area it might be worth a bit more discussion before we commit.\n\n[1] Something which we as humans have a tendency to overindulge.","commit_id":"d3ef1c9eca813795a1bb1987179a31a788fc46cf"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"3b1a66aaebf0d2db9e2a864f393da601e8341f62","unresolved":false,"context_lines":[{"line_number":847,"context_line":"                      }"},{"line_number":848,"context_line":"                    },"},{"line_number":849,"context_line":"                    \"additionalProperties\": false"},{"line_number":850,"context_line":"                  }"},{"line_number":851,"context_line":"                }"},{"line_number":852,"context_line":"              },"},{"line_number":853,"context_line":"              \"additionalProperties\": false,"}],"source_content_type":"text/x-rst","patch_set":7,"id":"bacf61ea_9f6fe091","line":850,"updated":"2016-07-28 09:00:31.000000000","message":"For the resources chunk I reckon you want something like:\n\n    \"resources\": {\n      \"type\": \"object\",\n      \"patternProperties\": {\n        \"^[0-9a-zA-Z_]+$\": {\"type\": \"integer\"}\n       },\n      \"additionalProperties\": false\n    }\n\nWhat\u0027s there still has a uuid in it and is doubly nested.","commit_id":"d3ef1c9eca813795a1bb1987179a31a788fc46cf"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"3b1a66aaebf0d2db9e2a864f393da601e8341f62","unresolved":false,"context_lines":[{"line_number":855,"context_line":"                \"resource_providers\","},{"line_number":856,"context_line":"                \"resources\""},{"line_number":857,"context_line":"              ]"},{"line_number":858,"context_line":"            }               "},{"line_number":859,"context_line":"          }"},{"line_number":860,"context_line":"        },"},{"line_number":861,"context_line":"        \"required\": [\"allocations\"],"}],"source_content_type":"text/x-rst","patch_set":7,"id":"bacf61ea_84add733","line":858,"updated":"2016-07-28 09:00:31.000000000","message":"nit","commit_id":"d3ef1c9eca813795a1bb1987179a31a788fc46cf"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"bd53a4a8278fd1e72582da4620dae827e5d45299","unresolved":false,"context_lines":[{"line_number":938,"context_line":"  set of allocation records for a consumer. The allocation records for a"},{"line_number":939,"context_line":"  consumer must be deleted and a new set added."},{"line_number":940,"context_line":""},{"line_number":941,"context_line":"  A `409 Conflict` will also be returned if there is no available inventory in"},{"line_number":942,"context_line":"  any of the resource providers for any specified resource classes."},{"line_number":943,"context_line":""},{"line_number":944,"context_line":"`DELETE /allocations/{consumer_uuid}`"},{"line_number":945,"context_line":"***************************************************************"}],"source_content_type":"text/x-rst","patch_set":8,"id":"bacf61ea_4c2ebdfb","line":942,"range":{"start_line":941,"start_character":2,"end_line":942,"end_character":67},"updated":"2016-08-01 17:18:25.000000000","message":"Sounds more like 410 than 409 in that case, although \"gone\" is defined[1] to indicate, that the webpage is \"gone forever\", nevertheless it might be good candidate to inform the client, that this particular resource is unavailable for unknown period of time. Moreover, it can be easily distinguish from already existing record for specific allocation (409) without looking for the returned payload.\n\nAlternatively, 404 can be used in this case with meaning \"currently we don\u0027t have requested inventory to be put in allocation\".\n\n[1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html","commit_id":"d58f6cb1546762ce8dc1bc20a81af805a56f1043"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"317143d2286c47adad2606a1b2791685dc36dacb","unresolved":false,"context_lines":[{"line_number":939,"context_line":"  consumer must be deleted and a new set added."},{"line_number":940,"context_line":""},{"line_number":941,"context_line":"  A `409 Conflict` will also be returned if there is no available inventory in"},{"line_number":942,"context_line":"  any of the resource providers for any specified resource classes."},{"line_number":943,"context_line":""},{"line_number":944,"context_line":"`DELETE /allocations/{consumer_uuid}`"},{"line_number":945,"context_line":"***************************************************************"}],"source_content_type":"text/x-rst","patch_set":8,"id":"bacf61ea_a1f67b5a","line":942,"in_reply_to":"bacf61ea_218e442e","updated":"2016-08-05 12:55:47.000000000","message":"@Chris The reason behind my comments is to have way to distinguish between those two conflict cases. One way to do this is to use different return codes for those cases, the other to provide message which will explain why we have a conflict or both. I guess the message explaining type of conflict could be the way.","commit_id":"d58f6cb1546762ce8dc1bc20a81af805a56f1043"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"c2f17e07f58f479493450384ee5c3d3ceecdf1a3","unresolved":false,"context_lines":[{"line_number":938,"context_line":"  set of allocation records for a consumer. The allocation records for a"},{"line_number":939,"context_line":"  consumer must be deleted and a new set added."},{"line_number":940,"context_line":""},{"line_number":941,"context_line":"  A `409 Conflict` will also be returned if there is no available inventory in"},{"line_number":942,"context_line":"  any of the resource providers for any specified resource classes."},{"line_number":943,"context_line":""},{"line_number":944,"context_line":"`DELETE /allocations/{consumer_uuid}`"},{"line_number":945,"context_line":"***************************************************************"}],"source_content_type":"text/x-rst","patch_set":8,"id":"bacf61ea_f53a8d97","line":942,"range":{"start_line":941,"start_character":2,"end_line":942,"end_character":67},"in_reply_to":"bacf61ea_4c2ebdfb","updated":"2016-08-02 19:35:22.000000000","message":"I don\u0027t think that 410 is at all appropriate. It is a conflict because the resource provider has already been selected, and the expectation is that there is sufficient inventory to satisfy the claim. The only time that that wouldn\u0027t be true is a race condition, where the same resource provider has been selected more than once for different requests. 409 is consistent with that scenario.","commit_id":"d58f6cb1546762ce8dc1bc20a81af805a56f1043"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"aa5650419d5e947e1b99600bef02dbd094ba1e93","unresolved":false,"context_lines":[{"line_number":939,"context_line":"  consumer must be deleted and a new set added."},{"line_number":940,"context_line":""},{"line_number":941,"context_line":"  A `409 Conflict` will also be returned if there is no available inventory in"},{"line_number":942,"context_line":"  any of the resource providers for any specified resource classes."},{"line_number":943,"context_line":""},{"line_number":944,"context_line":"`DELETE /allocations/{consumer_uuid}`"},{"line_number":945,"context_line":"***************************************************************"}],"source_content_type":"text/x-rst","patch_set":8,"id":"bacf61ea_218e442e","line":942,"in_reply_to":"bacf61ea_5fb448d0","updated":"2016-08-04 13:39:47.000000000","message":"404 or 410 would only make sense if the URI identified some inventory. It doesn\u0027t. It identifies some allocations against some inventories. In the case where those allocations want to be against some inventories the representation in the body of the request is in conflict with the state on the server. Thus 409.\n\nYou\u0027re right, however, that it would be best if the error response included sufficient information to note which type of conflict was happening.","commit_id":"d58f6cb1546762ce8dc1bc20a81af805a56f1043"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a1cae3ebe42f2db01302868febdaceb5e0316023","unresolved":false,"context_lines":[{"line_number":939,"context_line":"  consumer must be deleted and a new set added."},{"line_number":940,"context_line":""},{"line_number":941,"context_line":"  A `409 Conflict` will also be returned if there is no available inventory in"},{"line_number":942,"context_line":"  any of the resource providers for any specified resource classes."},{"line_number":943,"context_line":""},{"line_number":944,"context_line":"`DELETE /allocations/{consumer_uuid}`"},{"line_number":945,"context_line":"***************************************************************"}],"source_content_type":"text/x-rst","patch_set":8,"id":"bacf61ea_c35570fa","line":942,"in_reply_to":"bacf61ea_a1f67b5a","updated":"2016-08-05 14:00:07.000000000","message":"Yeah, I understand that, but using 404 or 410 would violate HTTP so the message is going to need to be the way.","commit_id":"d58f6cb1546762ce8dc1bc20a81af805a56f1043"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"6e87b71a569b34e6bcbbe51114bbd5c14eb5a44f","unresolved":false,"context_lines":[{"line_number":938,"context_line":"  set of allocation records for a consumer. The allocation records for a"},{"line_number":939,"context_line":"  consumer must be deleted and a new set added."},{"line_number":940,"context_line":""},{"line_number":941,"context_line":"  A `409 Conflict` will also be returned if there is no available inventory in"},{"line_number":942,"context_line":"  any of the resource providers for any specified resource classes."},{"line_number":943,"context_line":""},{"line_number":944,"context_line":"`DELETE /allocations/{consumer_uuid}`"},{"line_number":945,"context_line":"***************************************************************"}],"source_content_type":"text/x-rst","patch_set":8,"id":"bacf61ea_5fb448d0","line":942,"range":{"start_line":941,"start_character":2,"end_line":942,"end_character":67},"in_reply_to":"bacf61ea_f53a8d97","updated":"2016-08-03 06:40:23.000000000","message":"Ed, I got your point. Still, IMHO 404 can be used instead 409 in this particular case, since there is no conflict, just lack of resources. This is contrary to the first case, where there already is some of the resources allocated from certain resource providers.\n\nAnyway, I\u0027m not insist on either code, I was curious if it makes sense to split those two cases.\n\nI was also wondering, if there is appropriate message sent in the response with the reason of the conflict? It might be important from client (consumer of this API) perspective what\u0027s the conflict root cause, if we leave 409 for both cases.","commit_id":"d58f6cb1546762ce8dc1bc20a81af805a56f1043"}]}
