Skip to content

Registration

Overview

Registration is the initial action performed by this project. Running it, multiple times will overwrite the previous application instance, as long as the function_name in [config.json] remains the same.

Registration can be a combination of both opening an existing TAR.GZ configuration file and appending additional datapoints defined within the DataPoints class within [app.py].

The registration method can be configured in [config.json].

NOTE Ensure that the static TAR.GZ file path is specified using Linux-style formatting (with forward slashes).

  {
    "app": {
      "name": "Sample Python HCC2 Application", 
      "function_name": "samplePythonApp", 
      "version": {
        "major": 1,
        "minor": 0,
        "micro": 0
      },
      "log_level": "info"
    },
    "registration": {
      "static_enabled": true,  <-- Enable static registration
      "targz": "./resources/configs/static/samplePythonApp.tar.gz", <-- Static TAR.GZ config file path
      "dynamic_general_enable": true, <-- Enable GENERAL dynamic registration
      "dynamic_config_enable": true <-- Enable CONFIG dynamic registration
    },
    ...
  }
  ```

#### **Static Only**
The Python application will only attempt to register the provided `TAR.GZ` configuration file. If the file is not found, a blank application will be registered instead.

> **NOTE** Ensure that the static `TAR.GZ` file path is specified using Linux-style formatting (with forward slashes).

```json
"registration": {
  "static_enabled": true,
  "targz": "./resources/configs/static/samplePythonApp.tar.gz",
  "dynamic_general_enable": false,
  "dynamic_config_enable": false
}

Dynamic Config / General Only

The Python application will initialize a blank application and attempt to define each general and/or configuration data point within the shared DataPoint class general and config dictionaries. Any provided TAR.GZ files will be ignored.

"registration": {
  "static_enabled": false,
  "targz": "",
  "dynamic_general_enable": true,
  "dynamic_config_enable": true
}

Static & Dynamic

The Python application will only attempt to open the provided TAR.GZ configuration file in the HCC2 REST App Creator. If the file is not found, a blank application will open instead.

The application will then attempt to define each general and configuration data point defined within the shared DataPoint class general and config dictionaries before registering the application.

NOTE Ensure that the static TAR.GZ file path is specified using Linux-style formatting (with forward slashes).

"registration": {
  "static_enabled": true,
  "targz": "./resources/configs/static/samplePythonApp.tar.gz",
  "dynamic_general_enable": true,
  "dynamic_config_enable": true
}

Creating a TAR.GZ Configuration File

The 'tar.gz' file can be created using the same methods as previously outlined in the Example application: