Specified that PUT is a replace and not an update.

Fixes #3112.
pull/6/head
Victor Marmol 2015-03-04 17:02:42 -08:00
parent 4f12f4fe03
commit 5d919d6935
2 changed files with 3 additions and 3 deletions

View File

@ -88,7 +88,7 @@ When a new version of an object is POSTed or PUT, the "spec" is updated and avai
The PUT and POST verbs on objects will ignore the "status" values. Otherwise, PUT expects the whole object to be specified. Therefore, if a field is omitted it is assumed that the client wants to clear that field's value.
Modification of just part of an object may be achieved by GETting the resource, modifying part of the spec, labels, or annotations, and then PUTting it back. See [concurrency control](#concurrency-control-and-consistency), below, regarding read-modify-write consistency when using this pattern. Some objects may expose alternative resource representations that allow mutation of the status, or performing custom actions on the object.
The PUT verb does not accept partial updates. Modification of just part of an object may be achieved by GETting the resource, modifying part of the spec, labels, or annotations, and then PUTting it back. See [concurrency control](#concurrency-control-and-consistency), below, regarding read-modify-write consistency when using this pattern. Some objects may expose alternative resource representations that allow mutation of the status, or performing custom actions on the object.
All objects that represent a physical resource whose state may vary from the user's desired intent SHOULD have a "spec" and a "status". Objects whose state cannot vary from the user's desired intent MAY have only "spec", and MAY rename "spec" to a more appropriate name.

View File

@ -270,8 +270,8 @@ func (a *APIInstaller) registerResourceHandlers(path string, storage RESTStorage
case "PUT": // Update a resource.
route := ws.PUT(action.Path).To(UpdateResource(updater, ctxFn, action.Namer, codec, resource, admit)).
Filter(m).
Doc("update the specified " + kind).
Operation("update" + kind).
Doc("replace the specified " + kind).
Operation("replace" + kind).
Reads(versionedObject)
addParams(route, action.Params)
ws.Route(route)