This directory has the sources for a XS and OData services that expose the IOT data out the data storage.
Messages can be send to the HCP IoT Services using the Message Management Service (MMS) component deployed in the consumer account. By default MMS stores incoming messages into a relational database. The respective message tables are automatically created by MMS based on the device type and message type definitions. More details can be found in the IoT Services documentation. By default, MMS uses the automatically created database (schema) for storing data and the default data source binding for accessing this schema. The name of the underlying database schema is displayed in the "Databases & Schemas" section of the HCP Cockpit. The default data source bindings for this schema are also displayed on this page. In the example below, MMS is bound to a shared HANA instance.
The default schema binding can be changed to point to a dedicated HANA instance or any other database available in HCP.
For the purpose of HANA XS development, a HANA XS database instance will be provided on HCP account-level in HCP. The instance can be created using the HCP cockpit.
In the example below a HANA XS instance called “iotmmsxs” is created.
The HANA XS instance will also show up as a new schema in the “Databases and Schemas” section.
In order to switch the MMS database binding from HANA to HANA XS, select the HANA schema and remove the “iotmms” binding. After that, select the new “iotmmsxs” schema and add a new binding to “iotmms”.
After doing that MMS needs to be restarted. As soon as MMS will receive data from devices it will automatically create all tables in the new HANA XS instance. Hence, all the data can be accessed via HANA XS application running in the same HANA instance.
Now we are ready for XS development. Only the browser based tools will be used for that. Click on Development Tools link available for your XS instance.
This will open an Editor tool for you showing your account specific package.
Right away open another web based tool which we will use in the next steps. Click on a black arrow right to green plus and select ‘Catalog’
This will open a Catalog tool for you showing your DB schemas with their content.
Pay your attention that NEO_% schema is a real name of your (iotmmsxs) schema displayed in your HCP Cockpit. All T_IOT_% tables are landed there.
Return back to Editor, right click on (iotmmsxs) and select Create Application.
Select ‘Create in selected package’ option (this is not mandatory) and choose ‘Blank Application’ template. This will create a blank XS application for you.
Drag and drop or create the missing files. The content of your package should look as follows:
Adapt all necessary files and activate them.
Return back to Catalog tool and select a SQL button on top.
Insert the following SQL script there, adapt it and press green execute button. This should result in success execution.
Return back to HCP Cockpit and navigate to HANA XS Application.
Click on application URL. This will open a default index.html file located in your XS application.
Add /iotservice.xsodata at the end of that URL. This will point you to OData service. https://<system_id>hanaxs.hanatrial.ondemand.com/<user_id>trial/iotmmsxs/iotservice.xsodata
The next link shows OData service metadata https://<system_id>hanaxs.hanatrial.ondemand.com/<user_id>trial/iotmmsxs/iotservice.xsodata/$metadata
The next link shows entity content in XML format https://<system_id>hanaxs.hanatrial.ondemand.com/<user_id>trial/iotmmsxs/iotservice.xsodata/T_IOT_<MESSAGE_TYPE_ID>
The next link shows entity content in JSON format https://<system_id>hanaxs.hanatrial.ondemand.com/<user_id>trial/iotmmsxs/iotservice.xsodata/T_IOT_<MESSAGE_TYPE_ID>?$format=json
XSJS Service based on old $.db
interface
https://<system_id>hanaxs.hanatrial.ondemand.com/<user_id>trial/iotmmsxs/iotserviceolddbapi.xsjs
XSJS Service based on new $.hdb
interface (available starting from HANA XS SP09)
https://<system_id>hanaxs.hanatrial.ondemand.com/<user_id>trial/iotmmsxs/iotservicenewhdbapi.xsjs