Remove ambiguity on provisioning status code#717
Remove ambiguity on provisioning status code#717rsampaio merged 8 commits intocloudfoundry:masterfrom
Conversation
|
I agree the spec looks inconsistent right now with this statement.
However I think replacing It's also worth mentioning that not all brokers or platforms support I wonder if instead of removing |
|
I agree with @Samze, this is probably a breaking change for v2.x. We cannot remove the |
6b4e9e2 to
fe2650e
Compare
3bf3275 to
a74e502
Compare
|
@Samze I added some clarifying points around the synchronous requests and the use of 200 code by existent brokers. I was also reflecting on the goal of this PR and I believe the intent is to encourage the use of I'm curious to hear your thoughts. |
Samze
left a comment
There was a problem hiding this comment.
Sorry for the delayed response @rsampaio!
Just so I understand, the goal of this is to encourage platforms to use the broker response of 409 conflict mechanism instead of 200? I think maybe I'm not quite getting how this works for the synchronous case - I think This response is deprecated in favor of the last_operation endpoint is throwing me off.
The asynchronous case:
- Platform provision to broker, broker responses 202
- Platform provision to again broker with same request, broker returns 409
- Platform hits last operation endpoint....continues until success
The synchronous case
- Platform provision to broker, broker responses 201
- Platform provision to again broker with same request, broker returns 409
- Platform hits last operation endpoint.. ?
In this case the broker initially returned 201, so may not support the last operation endpoint.
Perhaps we should deprecated 200 in favour of 200 response? The only issue is that currently 409 and 200 are distinguished by 409 having different parameters and 200 having the same parameters.
|
No worries @Samze!
That is correct and it only applies to the asynchronous case.
Exactly!
In this case, when the broker returns a 201 the service instance should be already created and there is no reason to call
Maybe you mean 200 in favor of 201 and I agree, I believe the broker should return 409 for duplicated uuid and not only for duplicated parameters. |
The specification for synchronous provisioning says `201 Created` status code should be returned when for provisioning and bind and `200 OK` only for update, unbind and deprovisioning requests. This also reverts cloudfoundry#561 and assumes duplicated requests will return `409 Conflict` for the same unique UUID and it should be advised to platforms to start polling the `last_operation` endpoint to wait for completion.
This reverts commit d4c51a6.
a4f1ca5 to
0dae18c
Compare
What is the problem this PR solves?
The specification for synchronous provisioning says
201 Createdstatus codeshould be returned for provisioning and bind and
200 OKonly forthe update, unbind, and deprovision requests. This change should remove ambiguity on the provisioning and binding requests and converge to a single way to verify if a service instance has completed the provisioning step by calling the
last_operationendpoint.This also reverts #561 and assumes duplicated requests will return
409 Conflictfor the same unique UUID and it should be advised to platformsto start polling the
last_operationendpoint to wait for completion.Checklist:
Fixes Issue #709