Re: URL of a Service Instance


Dieu Cao <dcao@...>
 

Hi Rahul,

As mentioned above and described in the docs, it is up to you to implement
the code in your service broker to actually provision and store connection
information when there is a request to provision an instance of whatever
service you are providing.

It is up to you to implement the code in your service broker to return that
connection information, (ip, port, password, etc) to cloud controller when
your service broker receives a request to bind an app to a service
instance. In your response, you must include `credentials` as a hash, that
includes the connection information.

It is only then, if you have implemented code that returns connection
information in response to the bind request, will cloud controller make
that credentials hash that includes the connection information available as
part of the VCAP_SERVICES environment variable.

-Dieu
CF CAPI PM

On Sat, Dec 26, 2015 at 6:09 PM, Rahul Gupta <wildnez(a)gmail.com> wrote:

Hi Scott,

My service broker creates an instance of caching server, similar to what
mongodb does. An application that is going to use this caching server, will
be using its client API to connect. So when the application binds with the
service, the caching client in the app requires IP address or host name of
the caching server that was created by the broker.

From the example what Marco provided earlier:
Look at this URI provided by the mysql service broker: mysql://
25vHYlC5qhmHzmL6:8bSS58gjtzgznbke@
10.0.163.11:3306/cf_ccfd8402_83b2_4ab2_a803_4b8ad9551bc8?reconnect=true "

Its this IP address 10.0.163.11 and port 3306, what I am referring to.

My assumption was that once an application binds with a service, Cloud
Foundry itself would provide configuration details to the application to
make the connection between app and service instance possible. I looked at
VCAP_SERVICES but they do not contain any such information by default. So,
I assumed that such kind of connection details are to be provided by the
user only; therefore asking about the IP address of service instance.

By the way, are there any other environment variable that I missed to
check?

Thanks,
Rahul

Join {cf-dev@lists.cloudfoundry.org to automatically receive all group messages.