Skip to content

Commit

Permalink
Merge pull request kubernetes#5081 from vmarmol/put
Browse files Browse the repository at this point in the history
Specified that PUT is a replace and not an update.
  • Loading branch information
bgrant0607 committed Mar 5, 2015
2 parents aea9876 + 5d919d6 commit 58a9045
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/api-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions pkg/apiserver/api_installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 58a9045

Please sign in to comment.