We have recently added version control capabilities to our system, we are having hard time modeling these capabilities in a RESTful way.
The system works as follows, when it's configured in "version-control" mode, before making modification to an entity one must check it out first (a private copy is created for that user). After modifying the local copy the user can then check it in to commit the changes or undo the check out to discard the changes.
We are debating what is the right approach to model the "check-in", "check-out", "get-version" and "undo check-out" operations.
so lets say we have a resource (named my-resource)
http://my-system/my-resources/{id}
and we want to add version control capabilities on top of it, we are arguing between the two following approaches:
Operation oriented
Check In: POST on http://my-system/my-resources/{id}/check-in
Check-Out: POST on http://my-system/my-resources/{id}/check-out
Get Version: GET http://my-system/my-resources/{id}/versions/{version-id}
Undo Check-Out: POST on http://my-system/my-resources/{id}/undo-check-out
Resource Oriented
Check In: POST on http://my-system/my-resources/{id}/versions
Check-Out: POST on http://my-system/my-resources/{id}/check-out
Get Version: GET http://my-system/my-resources/{id}/versions/{version-id}
Undo Check-Out: DELETE on http://my-system/my-resources/{id}/check-out
What do you think? Do you have a suggestion how to model these operations? Are you familiar with similar public APIs to consult with?