Add/remove/replace locations from an image

This patch modifies the PATCH /v2/images/{id} API call. Clients can add,
remove and replace locations from the set of multiple locations
associated with a given image ID in the following way:

PATCH /images/1234
[{"op": "add", "path": "/locations/-",
  "value": {"url": "scheme3://path3", "metadata": {}}}]
PATCH /images/1234
[{"op": "add", "path": "/locations/1",
  "value": {"url": "scheme4://path4", "metadata": {}}}]
PATCH /images/1234
[{"op": "remove", "path": "/locations/2"}]
PATCH /images/1234
[{"op": "replace", "path": "/locations", "value": []}]
PATCH /images/5678
[{"op": "replace", "path": "/locations",
  "value": [{"url": "scheme5://path5", "metadata": {}},
            {"url": "scheme6://path6", "metadata": {}}]}]

Glance will check location correctness when client adding, and will
remove the image content from the store when client remove a location.

Implement bp: multiple-image-locations
docimpact

Change-Id: I845646fde22e18be27929b5ec70ef8041b6fa733
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Merge "Add/remove/replace locations from an image"