)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2043a19b80909ec9876e84bd27852626f1e4fb9e","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Add a section to the api-ref describing the error codes that some"},{"line_number":10,"context_line":"responses produce."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Note in the contributor docs that this shoul be updated when one is"},{"line_number":13,"context_line":"added."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"The reshaper docs is adjusted so a ref can be made to it from the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f79a3b5_3a17875a","line":12,"range":{"start_line":12,"start_character":39,"end_line":12,"end_character":44},"updated":"2018-12-13 13:44:08.000000000","message":"nit:should","commit_id":"47d5c15b567a07178799033cd6aaff916feb1c58"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"cbdd066958346e84da6e8f6be6dc7be4079b476c","unresolved":false,"context_lines":[{"line_number":13,"context_line":"added."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"The reshaper docs is adjusted so a ref can be made to it from the"},{"line_number":16,"context_line":"errors. The impliciit link to the header that would be the norm there"},{"line_number":17,"context_line":"doesn\u0027t work as there are two headers named \"Reshaper\"."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I89bbd383ba102fdd707ccc9f2fc973c6dd841fa8"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3f79a3b5_def66760","line":16,"range":{"start_line":16,"start_character":12,"end_line":16,"end_character":21},"updated":"2018-12-13 17:25:43.000000000","message":"nit: implicit","commit_id":"76bb437c5b65a4363ec5bb2d6f8371ae70d495c7"}],"api-ref/source/errors.inc":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2043a19b80909ec9876e84bd27852626f1e4fb9e","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"**Error Code**"},{"line_number":17,"context_line":"    Responses will include a ``code`` attribute in the ``JSON`` body.  These"},{"line_number":18,"context_line":"    are documented below. Where a response does not use a specific code"},{"line_number":19,"context_line":"    ``placement.undefined_code`` is present."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"**Detail Message**"},{"line_number":22,"context_line":"    A textual description of the error condition, in a ``detail`` attribute."}],"source_content_type":"text/x-c++src","patch_set":1,"id":"3f79a3b5_935c6f1c","line":19,"range":{"start_line":18,"start_character":25,"end_line":19,"end_character":44},"updated":"2018-12-13 13:44:08.000000000","message":"I\u0027m not sure this is the case. \nFor example \n\nGET /placement/resource_providers/\u003cnonexistent uuid\u003e\nreturns a response body without ``code`` attribute:\n\nRESP BODY: {\"errors\": [{\"status\": 404, \"request_id\": \"req-b3e92c0d-3eee-49c3-af03-357e12cafc67\", \"detail\": \"The resource could not be found.\\n\\n No resource provider with uuid f1cf5e95-e944-4c87-b740-934b1ff49657 found  \", \"title\": \"Not Found\"}]}\n\n--- later ---\n\nIn general I cannot generate an error response that contains the ``code`` field:\n\ncurl -g -i -X PUT http://100.109.0.10/placement/resource_providers/479cac8b-4711-41e8-b042-8ccdca71da49/inventories -H \"Accept: application/json\" -H \"Content-Type: application/json\" -H \"OpenStack-API-Version: placement 1.17\" -H \"User-Agent: openstacksdk/0.19.0 keystoneauth1/3.11.1 python-requests/2.20.1 CPython/2.7.15rc1\" -H \"X-Auth-Token: gAAAAABcEl_EYJiiRbU00IiHmeNCPJuf631NXqk47IvXnF6asZ0ZLI0b3UZVlp40PUjerjj6zciJvlvLqOpwF-n6J2dp7ieWZkVBQTpjMWnB-ca5Az2ehQOOTuAP76zWvI7EHGtWRGShrS4o-APgwB2f8p6Kf2lz_VD0XPHjOOvr6jzhNo-0TFU\" -d \u0027{\"resource_provider_generation\": 1, \"inventories\": {}}\u0027\n\nResponse:\n{\"errors\": [{\"status\": 409, \"request_id\": \"req-26dbc457-3c13-4c2e-94f3-fb3e45b0a05a\", \"detail\": \"There was a conflict when trying to complete your request.\\n\\n resource provider generation conflict  \", \"title\": \"Conflict\"}]}\n\nBut based on the code [1] there should be a \u0027placement.concurrent_update\u0027 in the response.\n\n[1] https://github.com/openstack/placement/blob/3d33ed668c1612d6409ce3f7035b15e60cdbeac3/placement/handlers/inventory.py#L363","commit_id":"47d5c15b567a07178799033cd6aaff916feb1c58"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2043a19b80909ec9876e84bd27852626f1e4fb9e","unresolved":false,"context_lines":[{"line_number":22,"context_line":"    A textual description of the error condition, in a ``detail`` attribute."},{"line_number":23,"context_line":"    The value is usually the message associated with whatever exception"},{"line_number":24,"context_line":"    happened within the service."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Error Codes"},{"line_number":27,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-c++src","patch_set":1,"id":"3f79a3b5_092352ab","line":25,"updated":"2018-12-13 13:44:08.000000000","message":"Another possible inconsistency:\n\ncurl -g -i -X GET http://100.109.0.10/placement/resource_providers/479cac8b-4711-41e8-b042-8ccdca71da49\n\n{\"error\": {\"message\": \"The request you have made requires authentication.\", \"code\": 401, \"title\": \"Unauthorized\"}}\n\nHere the body has a totally different schema than in the normal case","commit_id":"47d5c15b567a07178799033cd6aaff916feb1c58"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"cbdd066958346e84da6e8f6be6dc7be4079b476c","unresolved":false,"context_lines":[{"line_number":42,"context_line":"     - An attempt has been made to remove or shrink inventory that has capacity"},{"line_number":43,"context_line":"       in use."},{"line_number":44,"context_line":"   * - ``placement.concurrent_update``"},{"line_number":45,"context_line":"     - Another operation has concurrently made an operation involving this same"},{"line_number":46,"context_line":"       resource and the expected state is different. The current state should"},{"line_number":47,"context_line":"       be retrieved to determine if the desired operation should continue."},{"line_number":48,"context_line":"   * - ``placement.duplicate_name``"},{"line_number":49,"context_line":"     - A resource of this type already exists with the same name, and duplicate"}],"source_content_type":"text/x-c++src","patch_set":3,"id":"3f79a3b5_5ec25703","line":46,"range":{"start_line":45,"start_character":70,"end_line":46,"end_character":15},"updated":"2018-12-13 17:25:43.000000000","message":"Updating consumer we can get this code if the consumer is changed but also if one of the resource providers the consumer allocates from are changed. So sometimes it is not the \u0027same resource\u0027 that is changed.","commit_id":"76bb437c5b65a4363ec5bb2d6f8371ae70d495c7"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"86e42949962cd404f74875b7ae6e85b0f2c2214d","unresolved":false,"context_lines":[{"line_number":42,"context_line":"     - An attempt has been made to remove or shrink inventory that has capacity"},{"line_number":43,"context_line":"       in use."},{"line_number":44,"context_line":"   * - ``placement.concurrent_update``"},{"line_number":45,"context_line":"     - Another operation has concurrently made an operation involving this same"},{"line_number":46,"context_line":"       resource and the expected state is different. The current state should"},{"line_number":47,"context_line":"       be retrieved to determine if the desired operation should continue."},{"line_number":48,"context_line":"   * - ``placement.duplicate_name``"},{"line_number":49,"context_line":"     - A resource of this type already exists with the same name, and duplicate"}],"source_content_type":"text/x-c++src","patch_set":3,"id":"3f79a3b5_0fea3d0c","line":46,"range":{"start_line":45,"start_character":70,"end_line":46,"end_character":15},"in_reply_to":"3f79a3b5_5ec25703","updated":"2018-12-17 13:14:56.000000000","message":"I was trying to convey that with \"involving\" but yeah, I didn\u0027t quite nail it, will try something else.","commit_id":"76bb437c5b65a4363ec5bb2d6f8371ae70d495c7"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"cbdd066958346e84da6e8f6be6dc7be4079b476c","unresolved":false,"context_lines":[{"line_number":44,"context_line":"   * - ``placement.concurrent_update``"},{"line_number":45,"context_line":"     - Another operation has concurrently made an operation involving this same"},{"line_number":46,"context_line":"       resource and the expected state is different. The current state should"},{"line_number":47,"context_line":"       be retrieved to determine if the desired operation should continue."},{"line_number":48,"context_line":"   * - ``placement.duplicate_name``"},{"line_number":49,"context_line":"     - A resource of this type already exists with the same name, and duplicate"},{"line_number":50,"context_line":"       names are not allowed."}],"source_content_type":"text/x-c++src","patch_set":3,"id":"3f79a3b5_fe51e366","line":47,"range":{"start_line":47,"start_character":58,"end_line":47,"end_character":74},"updated":"2018-12-13 17:25:43.000000000","message":"\u0027should be retried\u0027?","commit_id":"76bb437c5b65a4363ec5bb2d6f8371ae70d495c7"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"09f98df3387cad3825f726af3794c30cda5dfe70","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"The defined errors are:"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":".. list-table::"},{"line_number":40,"context_line":"   :header-rows: 1"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"   * - Code"}],"source_content_type":"text/x-c++src","patch_set":4,"id":"ffd0ebdf_a74a877d","line":39,"updated":"2019-01-04 03:01:07.000000000","message":"nit: It would be better to add \u0027:widths: 35 65\u0027","commit_id":"16b29024c255ecdf34e8fa1a88613646c8810bce"}],"api-ref/source/index.rst":[{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"0721dc4d8a957d1935004c10253c36e44eb2f202","unresolved":false,"context_lines":[{"line_number":12,"context_line":"header for APIs sending data payloads in the request body (i.e. ``PUT`` and"},{"line_number":13,"context_line":"``POST``) must be set to ``application/json`` unless otherwise noted."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":".. rest_expand_all::"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"3f79a3b5_87d0b4c9","line":15,"updated":"2018-12-13 04:45:21.000000000","message":"nit: Unnecessary change.","commit_id":"47d5c15b567a07178799033cd6aaff916feb1c58"}],"doc/source/contributor/index.rst":[{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"0721dc4d8a957d1935004c10253c36e44eb2f202","unresolved":false,"context_lines":[{"line_number":252,"context_line":"          changes in a patch that is separate from and prior to the HTTP API"},{"line_number":253,"context_line":"          change."},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"If a handler needs to return an error response, with the advent of `Placement"},{"line_number":256,"context_line":"API Error Handling`_, it is possible to include a code in the JSON error"},{"line_number":257,"context_line":"response.  This can be used to distinguish different errors with the same HTTP"},{"line_number":258,"context_line":"response status code (a common case is a generation conflict versus an"},{"line_number":259,"context_line":"inventory in use conflict). Error codes are simple namespaced strings (e.g.,"},{"line_number":260,"context_line":"``placement.inventory.inuse``) for which symbols are maintained in"},{"line_number":261,"context_line":"``placement.errors``. Adding a symbol to a response is done"},{"line_number":262,"context_line":"by using the ``comment`` kwarg to a WebOb exception, like this::"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"    except exception.InventoryInUse as exc:"},{"line_number":265,"context_line":"        raise webob.exc.HTTPConflict("},{"line_number":266,"context_line":"            _(\u0027update conflict: %(error)s\u0027) % {\u0027error\u0027: exc},"},{"line_number":267,"context_line":"            comment\u003derrors.INVENTORY_INUSE)"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"Code that adds newly raised exceptions should include an error code. Find"},{"line_number":270,"context_line":"additional guidelines on use in the docs for ``placement.errors``."},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"Testing of handler code is described in the next section."},{"line_number":273,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"3f79a3b5_e7e408aa","line":270,"range":{"start_line":255,"start_character":0,"end_line":270,"end_character":66},"updated":"2018-12-13 04:45:21.000000000","message":"Probably the description in the API reference should be mentioned (or add the link).","commit_id":"47d5c15b567a07178799033cd6aaff916feb1c58"}]}
