EP Configuration

Overview

configuration-sample

Description

EP Configuration widget allows users to view and edit the configuration of a single endpoint.
Use property type with value configuration to define widget type.
This widget can be added only to the endpoint-related page (a page which has endpoint ID in URL).
Also you should have authorization scope endpoint:update to update any parameters in that widget.
Widget can be used in three modes:

  1. Display one value of metrics and allows to change it.
  2. Display several endpoint configuration’s parameters and allows to change it.
  3. Display configuration as JSON in the text editor area and allows to modify entire configuration and save it.

Display one value of metrics

configuration-sample

Description

This mode allows display any one configuration metric. You could increase or decrease it value by pressing the up or down-arrow buttons.
If you does not have permission to edit data widgets buttons will be disabled. configuration-sample
If you try press any of widgets buttons, you will see “Permission denied” notification into top right corner of the page:
configuration-sample
Configuration

Display several endpoint configuration’s parameters

configuration-sample

Description

This mode allows you to edit several configuration metric in simple text-edit areas. It based on schemaForm component (For more information about the schemaForm, read about react-jsonschema-form.)
Configuration

Display configuration as JSON

configuration-sample

Description

This mode displays configuration of endpoint in raw JSON format and allows to edit and save it.
Configuration

Configuration

General configuration

Widget’s general configuration is presented below. Service integration and each feature must be specified as a property of the config parameter.

- config:
    header:
      title: <string>         # Widget title text.
      displayTitle: <boolean> # Indicates whether to display widget title text.
      iconPath: <string>      # Path to icon.
    type: <string>           # Widget type. Must always equal "configuration". REQUIRED.

Service integration

The next part of configuration describes a connection between widget and endpoint registry service.

  service:                 # Name of EPR service instance. REQUIRED.
  applicationVersionName:  # Application version name. REQUIRED.
  dataPath:                # Data path in the ECR service instanse response. REQUIRED.
  currentConfig:           # Defines whether the current device configuration for the selected application version name be displayed. Boolean. OPTIONAL.
  defaultConfig:           # Defines whether the default device configuration for the selected application version name be displayed. Boolean. OPTIONAL.

Display one value of metrics

  1. To Enable this mode use property digitalDisplay and turn it into true.
  2. Configure REST endpoint, from which we will get data. For this, define service, applicationVersionName, path properties. REST endpoint example for this mode: {hostname}/ecr/api/v1/endpoints/{endpointId}/app-versions/environment-ver-1/current.
  3. Use property dataPath to define the path to value which will get from the response body.
  4. Define config modification usage (current/not current) by property currentConfig (set true if use current config)
  5. Optional you can describe metric use property postfix (for example it can be unit of measure).
    Example of minimal valid configuration:
     config:
       type: configuration
       header:
         displayTitle: true
         title: Metrics Value
       serviceIntegration:
         service: ecr
         applicationVersionName: environment-ver-1
         dataPath: temperatureSetpoint
         currentConfig: true
       digitalDisplay: true
    

    View of widget with minimal valid configuration: configuration-sample
    Example of maximal valid configuration:

     config:
       type: configuration
       header:
         displayTitle: true
         title: Setpoint
         iconPath: /img/setpoint.svg
       serviceIntegration:
         service: ecr
         applicationVersionName: environment-ver-1
         dataPath: temperatureSetpoint
         currentConfig: true
       postfix: "℃"
       digitalDisplay: true
    

    View of widget with maximal valid configuration: configuration-sample

Display several endpoint configuration’s parameters

  1. To Enable this mode you need define property schema which will describe schemaForm configuration. (For more information about the schemaForm, read about react-jsonschema-form.)
  2. Configure REST endpoint, from which we will get data. For this, define service, applicationVersionName, path properties. Rest endpoint example for this mode: {hostname}/ecr/api/v1/app-versions/environment-ver-1
  3. Set property defaultConfig as true.
    It is false by default. When true, this property enables loading default config for the widget instead of the personal one for the endpoint. Examples of widgets REST endpoint according this props:
    • If defaultConfig set true: {service}/{baseUrl}/app-versions/{appVersionName}
    • If defaultConfig set false or not defined: {service}/{baseUrl}/endpoints/{endpointId}/app-versions/{appVersionName}
  4. Property digitalDisplay should be false or not defined.
    Example of minimal valid configuration (one endpoint configuration’s parameter):
     config:
       type: configuration
       header:
         displayTitle: true
         title: Default configuration
       serviceIntegration:
         service: ecr
         applicationVersionName: environment-ver-1
         defaultConfig: true
       schema:
         type: object
         properties:
           reportingPeriod:
             type: number
             name: Reporting period, sec
    

    View of widget with minimal valid configuration (one endpoint configuration’s parameter): configuration-sample
    Difference between minimal and maximal configuration only in count of properties in the schema property, and iconPath in header property.

Config with several endpoint configuration’s parameters:

    config:
      type: configuration
      header:
        displayTitle: true
        title: Default configuration
      serviceIntegration:
        service: ecr
        applicationVersionName: environment-ver-1
        defaultConfig: true
      schema:
        type: object
        properties:
          referencePressure:
            type: number
            name: Reference pressure, mbar
          reportingPeriod:
            type: number
            name: Reporting period, sec

View of widget with several endpoint configuration’s parameters: configuration-sample

Display configuration as JSON

  1. If you NOT define schema property, this mode will apply.
  2. Configure REST endpoint, from which we will get data. For this, define service, baseUrl, applicationVersionName properties. Rest endpoint example for this mode: {hostname}/ecr/api/v1/app-versions/environment-ver-1
  3. Set property defaultConfig as true.
    It is false by default. When true, this property enables loading default config for the widget instead of the personal one for the endpoint. Examples of widgets REST endpoint according this props:
    • If defaultConfig set true: {service}/{baseUrl}/app-versions/{appVersionName}
    • If defaultConfig set false or not defined: {service}/{baseUrl}/endpoints/{endpointId}/app-versions/{appVersionName}
  4. Property digitalDisplay should be false or not defined.

    Minimal and maximal configuration have the same view:
     config:
       type: configuration
       header:
         displayTitle: true
         title: Default configuration
       serviceIntegration:
         service: ecr
         applicationVersionName: environment-ver-1
         defaultConfig: true
    

Interfaces

EP Configuration supports a number of service interfaces to perform its functional role. The key supported interfaces are summarized in the following diagram.

EP Configuration interfaces diagram

For service communication, WD widgets mainly use REST APIs.