Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PUT /guests/{userid}/disks sounds like it violates RFC 7231 #572

Open
johnarwe opened this issue Dec 30, 2021 · 3 comments
Open

PUT /guests/{userid}/disks sounds like it violates RFC 7231 #572

johnarwe opened this issue Dec 30, 2021 · 3 comments

Comments

@johnarwe
Copy link
Member

PUT /guests/{userid}/disks says

Configure additional disks for a guest

and the request representation makes it look like it is modifying certain properties of one or more, but not necessarily all, of the guests already-existing disks (probably created earlier in time via POST on the same resource, but possibly also via other means like via the guest's creation request). Is this what's going on?

The problem with that behavior is that partial modifications (contrasted with complete replacements) of the request URI conflict with RFC 7231's requirements on HTTP PUT, specifically

The fundamental difference between the POST and PUT methods is highlighted by the different intent for the enclosed representation. The target resource in a POST request is intended to handle the enclosed representation according to the resource's own semantics, whereas the enclosed representation in a PUT request is defined as replacing the state of the target resource. Hence, the intent of PUT is idempotent and visible to intermediaries, even though the exact effect is only known by the origin server.

@jichenjc
Copy link
Collaborator

you are right PATCH might be more accurate one but this is what it is now
maybe we can create a PATCH for same function like PUT and overtime we can deprecate the PUT

@Bischoff
Copy link
Contributor

Bischoff commented Jan 2, 2024

I vote for changing it to PATCH too.

@jichenjc
Copy link
Collaborator

jichenjc commented Jan 3, 2024

right, I fully agree , the reason is simple, with no expertise when we start feilong journey, we refer to openstack nova/cinder implementation and they don't have PATCH and other RFC recommended REST API .. so we only realize this later when almost everything done.. the plan might be support PATCH/PUT concurrently (as we have other code rely on this PUT) if PATCH is needed or better align with RFC..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants