The OpenWhisk Cognos Dashboard Embedded package provides a set of actions for interacting with Cognos Dashboard Embedded instances. These actions allow you to view and create Dashboards using data available in IBM Cloud Object Storage or more custom locations.
Entity | Type | Parameters | Description |
---|---|---|---|
openwhisk-cognos-dashboard | package | webDomain, __bx_creds | Work with a Cognos Dashboard Embedded instance. |
create-dashboard | action | module, spec | Renders a Cognos Dashboard |
sample-module | action | Demonstrates an example module | |
sample-spec | action | Demonstrates an example spec | |
sample-dashboard-edit | sequence | Demonstrates an example Dashboard in Edit mode | |
sample-dashboard-view | sequence | Demonstrates an example Dashboard in View mode |
Parameter | Description |
---|---|
module | A module that declares the data source |
spec | An existing dashboard, see Adding a canned dashboard to an application |
webDomain | The web domain of the site used to render the Dashboard; default is https://service.us.apiconnect.ibmcloud.com |
__bx_creds | The Cognos Dashboard Embedded binding |
Before you can view Dashboards, you need to have a service instance of Cognos Dashboard Embedded.
- Follow the first two steps in the Getting Started Tutorial.
Use the Cloud Functions CLI plugin to install the Cognos Dashboard Embedded package into your namespace.
- Install the Cloud Functions plugin for the IBM Cloud CLI.
- Install the
wskdeploy
command. See the Apache OpenWhisk documentation.
To install the Cognos Dashboard Embedded package:
-
Clone the Cognos Dashboard Embedded package repo.
git clone https://github.com/IBM-Cloud/openwhisk-cognos-dashboard.git
-
Deploy the package.
wskdeploy -m manifest.yaml
-
Verify that the
openwhisk-cognos-dashboard
package is added to your package list.ibmcloud fn package list
Output:
packages /myOrg_mySpace/openwhisk-cognos-dashboard private
The Cognos Dashboard Embedded package relies on the service credentials that were created in the Getting Started tutorial. A service binding will add the credentials to the package.
-
Bind the credentials to the Cognos Dashboard Embedded package.
ibmcloud fn service bind dynamic-dashboard-embedded openwhisk-cognos-dashboard --instance <your cognos dashboard instance name>
A sample Dashboard has been provided to test the package.
- Access the API Management page in IBM Cloud Functions.
- Select the Cognos Dashboard Embedded APIs.
- Use the copy button to copy the Route to your API.
- Vist the link
<your route URL>/sample-edit
in your browser. - Vist the link
<your route URL>/sample-view
in your browser.
To use your own data sources and dashboards, perform the following steps.
- Create a new Cloud Function's action similar to the Sample Module. To provide data, simply return an object with the
module
property that contains the data source object required by the Cognos Dashboard Embedded API. If you're rendering a canned Dashboard, return an object with thespec
property that contains the specification. - Create a web-enabled sequence that begins with your action and then calls the
openwhisk-cognos-dashboard/create-dashboard
action. An example is seen in the Sample Dashboard sequence.sequences: my-dashboard: actions: my-action,openwhisk-cognos-dashboard/create-dashboard web: true
- Expose your sequence as an API. Again, this is similar to the sample dashboard route seen above. For example, the below wskdeploy manifest would create a dashboard at the URL
mydashboards/sample
.apis: your-api-name: mydashboards: sample: my-dashboard: method: GET response: http