EP Configuration
Overview
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:
- Display one value of metrics and allows to change it.
- Display several endpoint configuration’s parameters and allows to change it.
- Display configuration as JSON in the text editor area and allows to modify entire configuration and save it.
Display one value of metrics
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.
If you try press any of widgets buttons, you will see “Permission denied” notification into top right corner of the page:
Configuration
Display several endpoint configuration’s parameters
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
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
- To Enable this mode use property
digitalDisplay
and turn it intotrue
. - 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
. - Use property
dataPath
to define the path to value which will get from the response body. - Define config modification usage (current/not current) by property
currentConfig
(set true if use current config) - 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:
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:
Display several endpoint configuration’s parameters
- 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.) - 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
- Set property
defaultConfig
astrue
.
It isfalse
by default. Whentrue
, 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
settrue
:{service}/{baseUrl}/app-versions/{appVersionName}
- If
defaultConfig
setfalse
or not defined:{service}/{baseUrl}/endpoints/{endpointId}/app-versions/{appVersionName}
- If
- Property
digitalDisplay
should befalse
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):
Difference between minimal and maximal configuration only in count ofproperties
in theschema
property, andiconPath
inheader
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:
Display configuration as JSON
- If you NOT define
schema
property, this mode will apply. - 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
- Set property
defaultConfig
astrue
.
It isfalse
by default. Whentrue
, 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
settrue
:{service}/{baseUrl}/app-versions/{appVersionName}
- If
defaultConfig
setfalse
or not defined:{service}/{baseUrl}/endpoints/{endpointId}/app-versions/{appVersionName}
- If
- Property
digitalDisplay
should befalse
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.
For service communication, WD widgets mainly use REST APIs.