Let's say I have a REST interface with a resource called Jobs which have Properties. I'd have an interface that looks like this:
GET|POST|PUT|DELETE /jobs/:id
GET|POST|PUT|DELETE /jobs/:jobId/properties/:id
Now, let's assume that I want to execute that I want to execute that job. Executions aren't really resources. They are essentially commands that you want to tell the server to act upon Jobs.
What is the best interface from a REST perspective to do this? Options I have come up with:
PUT /jobs/:id/execute
PUT /jobs/execute/:id
PUT /commands/execute_job/:jobId
POST /jobs/:id/executions
But I don't know which is best. ALSO, I don't know if PUT
is correct. I am suggesting PUT
because the execute
command will ultimately modify some of the data on the Job resource. My last option would turn execute
into a resource, like I am creating a new execution, but that doesn't feel right because it is not like I am going to have GET/PUT/DELETE verbs on it.
What is the REST way to do this?