IBM-Cloud / bluemix-go

Go library for accessing the Bluemix API
Apache License 2.0
37 stars 89 forks source link

Service_instance API changes #63

Closed huikang closed 7 years ago

huikang commented 7 years ago

Signed-off-by: Hui Kang kangh@us.ibm.com

ashishth09 commented 7 years ago

Hi @huikang ,

I revisited my earlier thoughts.

If you pass accepts_incomplete = true and the service broker can provision it synchronously then it will do so. http://docs.cloudfoundry.org/services/api.html. You can try out with cloudantNoSQLDB service by passing accepts_incomplete = true The result of creation and deletion are 201 and 204 respectively and not 202 which would have been returned if the service provisioned asynchronously.

So, I think those should be given a default value of true and they already are so at this point in the code base. It basically means if you already know that your service can be provisioned synchronously then you don't need to have any polling mechanism at the client side while if you think your service gets provisioned async you need to poll for the last_operation. This also means client don't need to worry about passing accepts_incomplete. It is always true.

I re-checked the API since last discussion and for service instance only deletion API needs async.

TL;DR

  1. Please revert the changes to create/update declaration.
  2. Remove async=true from definition of create/updaterawURL := "/v2/service_instances?accepts_incomplete=true&async=true" https://apidocs.cloudfoundry.org/264/service_instances/creating_a_service_instance.html doesn't list it as an input query parameter.
  3. Delete should take only async as input and inside its definition set accepts_incomplete=true.
  4. I see some unit tests broke, would be great if you fix those along the way.

Thanks

huikang commented 7 years ago

@ashishth09 thanks for your comment. Will update.

ashishth09 commented 7 years ago

Closed in #60