
$ cds build/all
$ cds add mta
---
_schema-version: '3.1'
ID: BusinessPartner
version: 1.0.0
description: "A simple CAP project."
parameters:
enable-parallel-deployments: true
build-parameters:
before-all:
- builder: custom
commands:
- npm ci
- npx -p @sap/cds-dk cds build --production
modules:
- name: BusinessPartner-srv
type: nodejs
path: gen/srv
parameters:
buildpack: nodejs_buildpack
build-parameters:
builder: npm-ci
provides:
- name: srv-api # required by consumers of CAP services (e.g. approuter)
properties:
srv-url: ${default-url}
Service: Destination Service
Plan: lite
Runtime Environment: Cloud Foundry
Space: dev
Instance Name: demo-destination
URL=https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER/
Name=API_BUSINESS_PARTNER
ProxyType=Internet
Type=HTTP
Authentication=NoAuthentication
Description=Business Partner SandBox API
$ cds compile srv/ --to xsuaa > xs-security.json
---
_schema-version: '3.1'
ID: BusinessPartner
version: 1.0.0
description: "A simple CAP project."
parameters:
enable-parallel-deployments: true
build-parameters:
before-all:
- builder: custom
commands:
- npm ci
- npx -p @sap/cds-dk cds build --production
modules:
- name: BusinessPartner-srv
type: nodejs
path: gen/srv
parameters:
buildpack: nodejs_buildpack
build-parameters:
builder: npm-ci
provides:
- name: srv-api # required by consumers of CAP services (e.g. approuter)
properties:
srv-url: ${default-url}
requires:
- name: demo-destination
- name: businesspartner-uaa
resources:
- name: demo-destination
type: org.cloudfoundry.existing-service
parameters:
service-name: demo-destination
- name: businesspartner-uaa
type: org.cloudfoundry.managed-service
parameters:
path: ./xs-security.json
service: xsuaa
service-plan: application
config:
xsappname: businesspartner-${org}-${space}
tenant-mode: dedicated
"cds": {
"requires": {
"API_BUSINESS_PARTNER": {
"kind": "odata-v2",
"model": "srv/external/API_BUSINESS_PARTNER",
"[development]": {
"credentials": {
"url": "https://sandbox.api.sap.com/s4hanacloud/sap/opu/odata/sap/API_BUSINESS_PARTNER",
"headers": {
"APIKey": "<api-key>"
}
}
},
"[production]": {
"credentials": {
"destination": "API_BUSINESS_PARTNER"
}
}
},
"uaa": {
"kind": "xsuaa"
}
}
}
$ cds build/all
$ mbt build -t ./
$ cf deploy BusinessPartner_1.0.0.mtar
"dependencies": {
"@sap-cloud-sdk/http-client": "^2.12.0",
"@sap-cloud-sdk/util": "^2.12.0",
"@sap/cds": "^6",
"@sap/xsenv": "^3.4.0",
"@sap/xssec": "^3.2.14",
"express": "^4",
"passport": "^0.6.0"
},
service BusinessService @(requires: 'authenticated-user'){
@cds.autoexpose
entity A_BusinessPartner as projection on abp.A_BusinessPartner {
key BusinessPartner, Customer, BusinessPartnerFullName, BusinessPartnerGrouping, BusinessPartnerUUID, OrganizationBPName1
}
}
{
"scopes": [],
"attributes": [],
"role-templates": [],
"authorities-inheritance": false,
"oauth2-configuration": {
"redirect-uris": [
"https://*.hana.ondemand.com/**"
]
}
}
- name: BusinessPartner
type: approuter.nodejs
path: app/ # from cds.env.folders. Consider also cds.env.build.target -> gen/app
parameters:
keep-existing-routes: true
disk-quota: 256M
memory: 256M
requires:
- name: srv-api
group: destinations
properties:
name: srv-api # must be used in xs-app.json as well
url: ~{srv-url}
forwardAuthToken: true
- name: BusinessPartner-xsuaa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |