Skip to content

Commit bc9bb36

Browse files
mariayordjohannes-vogelchgeo
authored
Added docu for vcap additional options (#2035)
Co-authored-by: Johannes Vogel <[email protected]> Co-authored-by: Christian Georgi <[email protected]>
1 parent 8ba74eb commit bc9bb36

File tree

1 file changed

+115
-0
lines changed

1 file changed

+115
-0
lines changed

node.js/cds-connect.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,123 @@ Here are a few examples:
384384
</tbody>
385385
</table>
386386

387+
If the `vcap` configuration contains multiple properties such as `name`, `label`, `tags`, `plan`, all properties have to match the corresponding VCAP_SERVICE attributes:
387388

389+
<style scoped>
390+
.no-stripes tr:nth-child(2n) {
391+
background-color:unset;
392+
}
393+
</style>
394+
395+
<table class="no-stripes">
396+
<thead>
397+
<tr>
398+
<th>CAP config</th>
399+
<th>VCAP_SERVICES</th>
400+
</tr>
401+
</thead>
402+
<tbody>
403+
<tr >
404+
<td >
405+
406+
407+
```json
408+
{
409+
"cds": {
410+
"requires": {
411+
"hana": {
412+
"vcap": {
413+
"label": "hana",
414+
"plan": "standard",
415+
"name": "myHana",
416+
"tags": "database"
417+
}
418+
}
419+
}
420+
}
421+
}
422+
```
423+
</td>
424+
<td >
388425

426+
```json
427+
{
428+
"VCAP_SERVICES": {
429+
"hana": [{
430+
"label": "hana",
431+
"plan": "standard",
432+
"name": "myHana",
433+
"tags": ["database"]
434+
}]
435+
}
436+
}
437+
```
438+
</td>
439+
</tr>
440+
</tbody>
441+
</table>
442+
443+
CAP services often come with a default `vcap` configuration. In rare cases, the default configuration has to be deactivated which can be achieved by explicitly setting the service property `vcap.<property>` to `false`:
444+
445+
<style scoped>
446+
.no-stripes tr:nth-child(2n) {
447+
background-color:unset;
448+
}
449+
</style>
450+
451+
<table class="no-stripes">
452+
<thead>
453+
<tr>
454+
<th>CAP config</th>
455+
<th>VCAP_SERVICES</th>
456+
</tr>
457+
</thead>
458+
<tbody>
459+
<tr >
460+
<td >
461+
462+
463+
```json
464+
{
465+
"cds": {
466+
"requires": {
467+
"hana": {
468+
"vcap": {
469+
"label": false,
470+
"name": "myHana",
471+
"tags": "database"
472+
}
473+
}
474+
}
475+
}
476+
}
477+
```
478+
</td>
479+
<td >
480+
481+
```json
482+
{
483+
"VCAP_SERVICES": {
484+
"myHana-binding": [{
485+
"label": "not-hana",
486+
"plan": "standard",
487+
"name": "myHana",
488+
"tags": ["database"]
489+
}]
490+
}
491+
}
492+
```
493+
</td>
494+
</tr>
495+
</tbody>
496+
</table>
497+
498+
::: tip To see the default configuration of a CAP service, use:
499+
500+
```js
501+
cds env get requires.<servicename>
502+
```
503+
:::
389504

390505
### In Kubernetes / Kyma { #in-kubernetes-kyma}
391506

0 commit comments

Comments
 (0)