Data Points Configuration using Swagger
Swagger
Swagger is a framework and set of tools for designing, building, documenting, and consuming RESTful APIs. It helps you to standardize the API design and provides interactive documentation. HCC2 REST API Server provides this tool. It is accessible by opening a browser and visit this URL:
http://<HCC2_IP_Address>:7071/swagger
You can create configuration and general data points as follows using the HCC2 REST API Swagger.
Swagger Data Points Creation Workflow
-
Initialize Application. This command initializes a new instance of the application and clears any previous data points created for this application. Api command:
Initialize Application: PUT: /api/v1/app-creator/{appName}/defaults
-
General Data Points. This command allows you to define and modify general data points for your application. General data points can be used to store your process data. Api command:
General Data Points: PUT: /api/v1/app-creator/{appName}/datapoint/general
-
Config Data Points. This command allows you to define and modify configuration data points for your application. Configuration data points can be used to persist data that your application can use to define internal properties or settings. Api command:
Config Data Points: PUT: /api/v1/app-creator/{appName}/datapoint/config
-
File Management Export. Tarball file (.tar.gz) file Exporting. When you have configured all data points, you can export and save this .tar.gz file for use at runtime by your application. This tarball file may be (optionally) opened by ACE to add, modify, or enhance configurations. Api command:
File Management Export: GET: /api/v1/app-creator/{appName}/targz
-
File Management Import. An existing tarball can be uploaded to continue refining the application definition via the REST endpoints. Alternatively, you may define your data points using ACE, and then that .tar.gz file can be saved into the HCC2 for registration. Api command:
Config Data Points: POST: /api/v1/app-creator/{appName}
-
Registration. Register the new application with data points configuration already saved in HCC2. This step must be done every time your new application is restarted. Api command:
Config Data Points: POST: /api/v1/app-registration/{appName}
For more detailed information about HCC2 REST API Server, Swagger utilization, and the typical application pattern, refer to REST Server.