Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
moved binding credentials to new file in running>services
Browse files Browse the repository at this point in the history
  • Loading branch information
Shannon Coen committed Feb 4, 2014
1 parent c6c5bf0 commit 631fa5d
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 69 deletions.
70 changes: 1 addition & 69 deletions source/docs/dotcom/marketplace/provider/index.html.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,75 +15,7 @@ http://info.appdirect.com/developer/docs/cloud-foundry/

## <a id='binding-credentials'></a>Binding Credentials ##

If your service is bindable, it means that in response to the bind API call, you will return credentials which can be consumed by an application. We write these credentials to the environment variable [VCAP_SERVICES](../../../using/deploying-apps/environment-variable.html). In some cases buildpacks will write a subset of these credentials to other environment variables that frameworks may expect.

Please choose from the following list of credential fields if possible. You can provide additional fields as needed, but if any of these meet your needs you should use them. This convention allows us to provide end user developers with libraries which parse VCAP_SERVICES and deliver useful objects to applications, and other libraries which actually configure applications themselves with a service connection.

**Important: if you provide a service which supports a connection string, you must provide at least the `uri` key; as mentioned you may provide discrete credential fields in addition. The aforementioned libraries use the `uri` key.**

| credentials | description |
|---------------|-------------|
| uri | Connection string of the form `dbtype://username:password@hostname:port/name`, where `dbtype` is mysql, postgres, mongodb, amqp, etc. |
| hostname | The FQDN of the server host |
| port | The port of the server host |
| name | Name of the service instance; database name |
| vhost | Name of the messaging server virtual host (replacement for `name` specific to AMQP providers) |
| username | Server user |
| password | Server password |

Here's an example output of `ENV['VCAP_SERVICES']`. Note that ClearDB chooses to return both discrete credentials, a uri, as well as another field. CloudAMQP chooses to return just the uri, and RedisCloud returns only discrete credentials.

<pre class="highlight xml">
VCAP_SERVICES=
{
cleardb-dev-n/a: [
{
name: "cleardb-dev-1",
label: "cleardb-dev-n/a",
plan: "spark",
credentials: {
name: "ad_c6f4446532610ab",
hostname: "us-cdbr-east-03.cleardb.com",
port: "3306",
username: "b5d435f40dd2b2",
password: "ebfc00ac",
uri: "mysql://b5d435f40dd2b2:ebfc00ac@us-cdbr-east-03.cleardb.com:3306/ad_c6f4446532610ab",
jdbcUrl: "jdbc:mysql://b5d435f40dd2b2:ebfc00ac@us-cdbr-east-03.cleardb.com:3306/ad_c6f4446532610ab"
}
}
],
cloudamqp-dev-n/a: [
{
name: "cloudamqp-dev-6",
label: "cloudamqp-dev-n/a",
plan: "lemur",
credentials: {
uri: "amqp://ksvyjmiv:IwN6dCdZmeQD4O0ZPKpu1YOaLx1he8wo@lemur.cloudamqp.com/ksvyjmiv"
}
}
{
name: "cloudamqp-dev-9dbc6",
label: "cloudamqp-dev-n/a",
plan: "lemur",
credentials: {
uri: "amqp://vhuklnxa:9lNFxpTuJsAdTts98vQIdKHW3MojyMyV@lemur.cloudamqp.com/vhuklnxa"
}
}
],
rediscloud-dev-n/a: [
{
name: "rediscloud-dev-1",
label: "rediscloud-dev-n/a",
plan: "20mb",
credentials: {
port: "17546",
host: "pub-redis-17546.MatanCluster.ec2.garantiadata.com",
password: "1M5zd3QfWi9nUyya"
}
},
],
}
</pre>
See [Binding Credentials](../../../running/architecture/services/binding-credentials.html).

## <a id='documentation'></a>Documentation ##

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
title: Binding Credentials
---

If your service is bindable, it means that in response to the bind API call, you will return credentials which can be consumed by an application. Cloud Foundry writes these credentials to the environment variable [VCAP_SERVICES](../../../using/deploying-apps/environment-variable.html). In some cases buildpacks will write a subset of these credentials to other environment variables that frameworks may expect.

Please choose from the following list of credential fields if possible. You can provide additional fields as needed, but if any of these fields meet your needs you should use them. This convention allows developers to provide buildpacks and libraries which either parse VCAP_SERVICES and deliver useful objects to applications, or which actually configure applications themselves with a service connection.

**Important: if you provide a service which supports a connection string, you should provide at least the `uri` key; as mentioned you may provide discrete credential fields in addition. Buildpacks and application libraries use the `uri` key.**

| credentials | description |
|---------------|-------------|
| uri | Connection string of the form `dbtype://username:password@hostname:port/name`, where `dbtype` is mysql, postgres, mongodb, amqp, etc. |
| hostname | The FQDN of the server host |
| port | The port of the server host |
| name | Name of the service instance; database name |
| vhost | Name of the messaging server virtual host (replacement for `name` specific to AMQP providers) |
| username | Server user |
| password | Server password |

Here's an example output of `ENV['VCAP_SERVICES']`. Note that ClearDB chooses to return both discrete credentials, a uri, as well as another field. CloudAMQP chooses to return just the uri, and RedisCloud returns only discrete credentials.

<pre class="highlight xml">
VCAP_SERVICES=
{
cleardb-dev-n/a: [
{
name: "cleardb-dev-1",
label: "cleardb-dev-n/a",
plan: "spark",
credentials: {
name: "ad_c6f4446532610ab",
hostname: "us-cdbr-east-03.cleardb.com",
port: "3306",
username: "b5d435f40dd2b2",
password: "ebfc00ac",
uri: "mysql://b5d435f40dd2b2:ebfc00ac@us-cdbr-east-03.cleardb.com:3306/ad_c6f4446532610ab",
jdbcUrl: "jdbc:mysql://b5d435f40dd2b2:ebfc00ac@us-cdbr-east-03.cleardb.com:3306/ad_c6f4446532610ab"
}
}
],
cloudamqp-dev-n/a: [
{
name: "cloudamqp-dev-6",
label: "cloudamqp-dev-n/a",
plan: "lemur",
credentials: {
uri: "amqp://ksvyjmiv:IwN6dCdZmeQD4O0ZPKpu1YOaLx1he8wo@lemur.cloudamqp.com/ksvyjmiv"
}
}
{
name: "cloudamqp-dev-9dbc6",
label: "cloudamqp-dev-n/a",
plan: "lemur",
credentials: {
uri: "amqp://vhuklnxa:9lNFxpTuJsAdTts98vQIdKHW3MojyMyV@lemur.cloudamqp.com/vhuklnxa"
}
}
],
rediscloud-dev-n/a: [
{
name: "rediscloud-dev-1",
label: "rediscloud-dev-n/a",
plan: "20mb",
credentials: {
port: "17546",
host: "pub-redis-17546.MatanCluster.ec2.garantiadata.com",
password: "1M5zd3QfWi9nUyya"
}
},
],
}
</pre>

0 comments on commit 631fa5d

Please sign in to comment.