Control
Overview
Allows a user to execute commands on an endpoint and view their execution results.
config:
type: control
Widget configuration
Control widget has the following configuration:
- config: # Config definition. REQUIRED.
header:
title: # Widget title text.
displayTitle: true # Indicates whether to display widget title text.
iconPath: # Path to icon.
type: control # Config type. Must always equal "control" for this widget type. REQUIRED.
icons: # Conditional list of icons.
- key: '0' # Each key must correspond to the available endpoint status.
icon: # Icon URL that relates to defined endpoint status.
- key: '1'
icon:
- key: 'default' # Default key for cases when status binding is unnecessary.
icon:
statusFetching: # Describes source of the current endpoint status.
serviceName: # Name of EPTS or EPR service instance. REQUIRED.
dataPath: # JSON path to the value contained in the data point. REQUIRED.
endpoint: # Takes value of ${dashboard.id} to fetch the data for the current endpoint on the
# dashboard or a pre-defined endpoint ID for any available endpoint. REQUIRED.
timeSeriesName: # Name of time series to get data from. REQUIRED for EPTS.
updateInterval: # Period for querying data from the data source, in seconds.
# If not defined only initial status would sync without interval updates.
action: # Describes integration with command invocation service. REQUIRED.
service: # Name of RCI service instance.
dataPath: # Path to command invocation result in response object of RCI service instance.
commands: # Conditional list of commands. REQUIRED.
- key: '0' # Each key must be equal to available endpoint status, and the value must be list of commands.
commandType: # Represents the type of the command client wants to invoke on the endpoint.
body: # Body of the request. Can be any valid object that is meaningful for the target endpoint.
- key: '1'
commandType:
body:
- key: 'default' # Default key for cases when status binding is unnecessary.
commandType:
body:
labels: # Conditional list of commands.
- key: '0' # Each key must be equal to available endpoint status, and the value must be list of labels.
status: # Label that describes current status of the endpoint.
action: # Label for action that will perform on click.
- key: '1'
status:
action:
- key: 'default' # Default key for cases when status binding is unnecessary.
status:
action:
Example configuration
Below is an example of minimal valid configuration. It renders the Control widget for a vehicle engine application:
- config:
type: control
header:
title: Engine
displayTitle: true
iconPath: /img/setpoint.svg
icons:
- key: '0'
icon: data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMSIgaGVpZ2h0PSIyMyIgdmlld0JveD0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LjM5NnY1LjcyOEgwVjQuNjc3aDMuMzk2djUuNzI4aDEuMzE4VjQuNjc3aDUuNDMxVjMuNDEzaC0zLjU5VjBoMTEuMjV2My40MTNoLTMuNTl2MS4yNjRoNC4zNzdsNS4wOTIgMy44OXYyLjA3MmguODI4VjcuOTg1aDUuMTM0bC4yODQuNzRjMS4yNyAzLjMxNyAxLjU3OCA5LjcwMi0uMDEgMTMuNTYxbC0uMjk0LjcxNHoiLz48L3N2Zz4=
statusFetching:
serviceName: epts
dataPath: value
endpoint: '${dashboard.id}'
timeSeriesName: ignitionStatus
updateInterval: 3
action:
service: rci
commands:
- key: '0'
commandType: start
- key: '1'
commandType: stop
labels:
- key: '0'
status: Engine off
action: start engine
- key: '1'
status: Engine on
action: stop engine
Interfaces
Control 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.