{
"vendor": "SAP"
, "url" : "https://functions-service.cfapps.eu10.hana.ondemand.com"
, "uaa": {
"uaadomain" : "authentication.eu10.hana.ondemand.com"
, "tenantmode" : "dedicated"
, "sburl" : "https://internal-xsuaa.authentication.eu10.hana.ondemand.com"
, "clientid" : "sb-75cae42f-a2fe-443b-914e-a813051a4213!b8187|faas-broker!b2495"
, "verificationkey": "-----BEGIN PUBLIC KEY----- <snip> -----END PUBLIC KEY-----"
, "xsappname" : "75cae42f-a2fe-443b-914e-a813051a4213!b8187|faas-broker!b2495"
, "identityzone" : "<subaccount_name>"
, "identityzoneid" : "10673374-a27d-4135-c81d-8d55be7bd62a"
, "clientsecret" : "Y8PIUAmUm+sRQWqeUeQzQPGPIdf="
, "tenantid" : "10673374-a27d-4135-c81d-8d55be7bd62a"
, "url" : "https://dbs-dev.authentication.eu10.hana.ondemand.com"
}
}
Property | Description |
---|---|
url | The URL of the service instance you have just created. This is known as the protected resource. In our specific case, this is the URL for the Functions Dashboard running in the EU10 data centre. In order to access this protected resource, the user must know this URL together with the values of the following three fields. |
uaa.clientid | The unique ID of the service broker for this particular service instance. The value in this field has been populated for you, and starts with sb- (for service broker), followed by the value of the Service Key field uaa.xsappname |
uaa.clientsecret | The password required for access to the protected resource |
uaa.url | The URL of the Cloud Foundry authentication server that will generate the required OAuth token. |
uaa.url
field contains the URL of the authentication server within your own Cloud Foundry sub account. Using the Neo destination we are about to create, Web IDE will make a request to this authentication server to generate an OAuth token that will then allow it to publish your coding to the Functions Dashboard.Field | Description |
---|---|
Name | Give the destination some meaningful name |
Type | What sort of connection are we going to use to communicate with the protected resource? |
Description | Some meaningful description of why this destination exists. In our case, this destination allows Web IDE to gain access to FaaS |
URL | The URL of our protected resource. This value is always found in the Service Key field url |
Proxy Type | Where is our protected resource located? On an on-premise server (accessed via the SAP Cloud Connector) or on a server accessible via the public internet?
|
Authentication | Here we're going to use OAuth2ClientCredentials .This describes the fact that authentication between Neo and CF will take place using an OAuth token generated by the server referenced in the "Token Server URL" field below |
Client ID | The unique Id of the service broker managing our service instance. This value is found in the Service Key field uaa.clientid |
Client Secret | This value is found in the Service Key field uaa.clientsecret and behaves as a password |
Token Service URL | The URL of the server that will generate the required OAuth token. This value is found in the Service Key field uaa.url and needs /oauth/token appended to it.From the perspective of authentication, this is where the connection is made between a service running in the Neo environment (Web IDE) and a service running in the Cloud Foundry environment (the Functions Dashboard) |
Token Service User | Leave blank |
Token Service Password | Leave blank |
clientid
and clientsecret
.Field | Value |
---|---|
Name | WebIDE_FaaS_Usage |
Type | HTTP |
Description | Connect Web IDE to CF Functions Dashboard |
URL | https://functions-service.cfapps.eu10.hana.ondemand.com |
Proxy Type | Internet |
Authentication | OAuth2ClientCredentials |
Client ID | sb-72cee12c-a8fd-463a-904d-a6180a124f13!b8718|faas-broker!b5249 |
Client Secret | Y8PIUAmUm+sRQWqeUeQzQPGPIdf= |
Token Service URL | https://dbs-dev.authentication.eu10.hana.ondemand.com/oauth/token |
Token Service User | |
Token Service Password |
Property | Name | Description |
---|---|---|
WebIDEEnabled | true | At start up, Web IDE is passed a JSON object called listDestinations containing all the Neo destinations for which this flag has been set to true .All destinations in which this flag is either missing, or set to false will remain invisible to Web IDE |
WebIDEUsage | faas_api | The value of this field indicates the type of service to which Web IDE has access. In this case, Web IDE will now have access to the Functions Dashboard referenced by the URL field of this destination |
HTTP 404 Not Found
listDestinations
that contains the details of all Neo destinations that have the WebIDEEnabled
property set to true
.Therefore, our instance of Web IDE will now know about our new WebIDE_FaaS_Usage
destinationProperty | Value |
---|---|
Project name | test-fn-project |
Function name | fn-http |
Trigger name | http |
test-fn-project
-> functions
-> fn-http
and edit file index.js
.This file is a basic NPM module and for the sake of simplicity, will export only one function.var utils = require('basic-formatting-utils')
// Call the appropriate datetime_xxx function for your timezone:
// datetime_pst US Pacific Time
// datetime_est US Eastern Standard Time
// datetime_gmt Greenwich Mean Time
// datetime_cet Central European Standard Time
// datetime_ist India Standard Time
//
// Or supply the numbers of minutes by which your timezone is offset from UTC.
// E.G. If you are four hours behind UTC, then use:
//
// var date = utils.datetime_by_timezone(-240)(new Date())
var date = utils.datetime_gmt(new Date())
var format_response = (evt, ctx) =>
utils.as_html([],
utils.as_body([]
, [ utils.as_h1([], "Function called at: " + date)
, utils.create_content(
[ {title: "Context Object", value: ctx}
, {title: "Event Object", value: evt}
, {title: "NodeJS process", value: process}
])
].join("")
)
)
var response_handler = (content, stream) =>
new Promise((resolve, reject) => {
stream.on('finish', resolve)
stream.on('error', reject)
stream.end(content)
})
// ******************************************************************************
// PUBLIC API
// ******************************************************************************
/**
* @param {FaasEvent} event
* @param {FaasContext} context
*
* @return {Promise|*}
*/
module.exports = (event, context) =>
response_handler(
format_response(event, context)
, event.getResponseStream('text/html; charset=utf8')
)
package.json
and replace the contents of this file with the following JSON object:{
"dependencies": {
"basic-formatting-utils": "*"
}
}
index.js
http.trg.json
(this file was created for you by the project template wizard)fn-http
folder and select Deploy -> Deploy Function. A pop-up will appear showing all the Neo destinations for which the WebIDEUsage
property equals faas_api
(Function Deployment) Deployment of function fn-http in progress...
After a few seconds, you will see an alert in the top right corner of the Web IDE screen informing you that the function has been deployed.http.trg.json
and select Deploy -> Deploy Trigger. The same pop-up will be display again in which you can select the destination.(Trigger Deployment) Deployment of trigger http has started
When the deployment process has completed, you will see two things. In the top right of the Web IDE screen, you will see the following alert:(Trigger Deployment) Trigger http deployed with url https://72cee12c-af3d-431a-940d-a6180a124f13.ingress.live.faas-live.shoot.live.k8s-hana.ondemand.com...
Object
, Array
or Map
can be expanded in order to view its contents.You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
38 | |
19 | |
13 | |
13 | |
11 | |
10 | |
10 | |
10 | |
8 | |
8 |