The Images API v2 has been using PATCH to update an image record for quite a 
long time now.  We pretty much follow the IETF docs.  Here's how it's 

And here's the info about the media type used for the request body:

Not surprisingly, we feel that this is the correct way to implement PATCH!


From: Amit Gandhi []
Sent: Friday, December 12, 2014 3:17 PM
To: OpenStack Development Mailing List (not for usage questions)
Subject: [openstack-dev] [api] Usage of the PATCH verb


We are currently using PATCH in the Poppy API to update existing resources.  
However, we have recently had some discussions on how this should have been 

I would like to get the advise of the Openstack Community and the API working 
group on how PATCH semantics should work.

The following RFC documents [1][2] (and a blog post [3]) advise the using PATCH 
as the following:

2.1.  A Simple PATCH Example

   PATCH /file.txt HTTP/1.1
   Content-Type: application/example
   If-Match: "e0023aa4e"
   Content-Length: 100

{ "op": "test", "path": "/a/b/c", "value": "foo" },
{ "op": "remove", "path": "/a/b/c" },
{ "op": "add", "path": "/a/b/c", "value": [ "foo", "bar" ] },
{ "op": "replace", "path": "/a/b/c", "value": 42 },
{ "op": "move", "from": "/a/b/c", "path": "/a/b/d" },
{ "op": "copy", "from": "/a/b/d", "path": "/a/b/e" }

Basically, the changes consist of an operation, the path in the json object to 
modify, and the new value.

The way we currently have it implemented is to submit just the changes, and the 
server applies the change to the resource.  This means passing entire lists to 
change etc.

I would like to hear some feedback from others on how PATCH should be 


Amit Gandhi
- Rackspace


OpenStack-dev mailing list

Reply via email to