EP List
Overview
Description
EP List widget displays a list of endpoints in a certain application along with their metadata with the ability to navigate through them. This widget should be used on the top-level dashboard (see Dashboards).
Display list of endpoints
Description
On the EP List widget, you are able to view the list of endpoints with its metadata, sort endpoints and search by any columns values.
Usage
- It is possible to sort endpoints order by certain column values with up/down arrow near column’s name in the table header section. Sorted table:
- The widget also provides an ability to find certain endpoint by any field. The search field is situated in the upper-right corner of the widget. Search results:
Navigation through endpoints
Description
Using the Endpoint List widget you can click an EP record in the widget list and get redirected to the endpoint-related dashboard displaying the detailed information about the selected endpoint.
Usage
- Click on any endpoint’s row in the list.
- The widget navigates a user to endpoint’s specific dashboard.
Values mapping
Description
Gives the ability to map endpoint’s metadata values or it’s identifier and represent it with preconfigured string pattern.
Usage
- You could see described values in the widget table’s column.
Endpoint creation
Description
EP List widget provides possibility of endpoint creation.
Usage
- Click the plus button in the bottom right corner of the widget.
- Fill in the fields and click “Create”.
- See that endpoint is created.
Filters
Description
The widget gives ability to filter endpoints by providing a certain endpoint filter ID.
Usage
- Filtered endpoints that matching
cc3200 devices
filter.
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: # Widget title text.
displayTitle: true # Indicates whether to display widget title text.
iconPath: # Path to icon.
type: epList # Config type. Must always equal "epList" for this widget type. REQUIRED.
Service integration
The next part of configuration describes a connection between widget and endpoint registry service.
serviceIntegration:
service: # Name of EPR service instance. REQUIRED.
applicationName: # Application name.
applicationVersionName: # Application version name.
Display list of endpoints
Following part of configuration maps response from endpoint registry service and display it in list view. User must have endpoint:read
permissions individually to each endpoint to be able to get access for certain endpoint.
columns: # Mapping between the EP metadata properties and their display names. REQUIRED.
- display: Description # Display name in the table column. REQUIRED.
cellType: 'text'
text:
- '${description}' # Array of common values or paths to the value (must be wrapped with "${}" symbols)
# contained in the EPR service response. REQUIRED.
Navigation through endpoints
Specify following descriptors for the redirect link in the itemLink
parameter:
path
this parameter contains the link to the dashboard that the user will be redirected after clicking an EP record in the widget list.parameters
defines the mapping between the variables stated in the path template and the actual values from the server response.name
matches the variable stated in the redirect path template.itemJsonPath
is the path to endpoint’s identifier.
itemLink: # Description of the redirect link.
path: "/thermostats/:endpointId" # Target URL with parameters. REQUIRED.
parameters: # Parameters required to build redirect link. REQUIRED.
itemJsonPath: endpointId # JSON path to endpoint's identifier. REQUIRED.
Values mapping
Configure two columns from EPR metadata values: location and connected. Location column joins two metadata values by certain pattern. State value includes conditional icon render.
rowsSelectable: <boolean> # Defines whether the table rows should be selectable. By default, false. OPTIONAL.
columns: # Mapping between the EP metadata properties and their display names. REQUIRED.
- display: Location # Display name in the table column. REQUIRED.
cellType: 'text' # Type of the cell (text, icon). REQUIRED.
text: # Array of common values or paths to the value (must be wrapped with "${}" symbols)
# contained in the EPR service response. REQUIRED.
- ${metadata.location} # JSON data path to location value. Will be mapped to according value from EPR service instance.
- '#' # Static string that will be displayed as is.
- ${metadata.floor} # JSON data path to floor value. Will be mapped to according value from EPR service instance.
- display: State
cellType: 'icon' # Type of the cell (text, icon). REQUIRED.
path: metadata.connected # JSON data path to connected value. REQUIRED.
icons: # List of conditional icons.
- icon: /img/offline.svg # Src of the icon image.
condition: default # Value from endpoint registry service that should be interpreted as the following icon
sortName: "off" # Value which used as alt name for sorting by list.
- icon: /img/offline.svg
condition: false
sortName: "off"
- icon: /img/online.svg
condition: true
sortName: "on"
Endpoint creation
The widget uses JSON schema in YAML format to generate the form of endpoint creation. A user must obtain endpoint:create
permission scopes to be authorized for endpoint creation.
Sample valid JSON schema for endpoint’s creation form:
creationSchema: # JSON schema object in YAML format that describes metadata fields of endpoint's creation form.
type: object # Root type of schema. Available value is 'object'.
properties: # List of props.
location: # Metadata field key name.
type: string # Type of field. Available values are 'number', 'string', 'boolean'.
name: Location # Field label.
description:
type: string
name: Description
latitude:
type: string
name: Latitude
longitude:
type: string
name: Longitude
creationUiSchema: # JSON schema object in YAML format that describes field types, order, etc. of the configuration form. More detailed information are here: https://github.com/mozilla-services/react-jsonschema-form#the-uischema-object
Filters
Apply a filter for EP List widget has the following configuration.
filterId: f0f84e85-cef9-4676-ac73-f4703abc59c0 # Certain filter id that should be applied to current list of endpoints.
# Define as '${dashboard.id}' to get filter id from router params.
Examples
Minimal valid configuration
config:
type: epList
header:
title: Devices
displayTitle: true
serviceIntegration:
applicationName: demo_application
applicationVersionName: demo_application_v1
service: epr # Name of Endpoint Registry Service from services section of configuration
columns:
- display: Id
cellType: 'text'
text:
- '${endpointId}'
- display: Location
cellType: 'text'
text:
- 'Device location -'
- '${metadata.location}'
itemLink:
path: "/thermostats/:endpointId"
parameters:
itemJsonPath: endpointId
Configuration with a maximum set of features
config:
type: epList
header:
title: Devices
displayTitle: true
serviceIntegration:
applicationName: demo_application
applicationVersionName: demo_application_v1
service: epr
filterId: 8293d0bd-2322-4680-949c-c393c7d1f129
creationSchema:
type: object
properties:
endpointToken:
type: string
name: Desired token (optional)
metadata:
type: object
properties:
location:
type: string
name: Location
description:
type: string
name: Description
latitude:
type: string
name: Latitude
longitude:
type: string
name: Longitude
creationUiSchema:
"ui:order":
- "metadata"
- "endpointToken"
rowsSelectable: true
columns:
- display: Serial number
cellType: 'text'
text:
- '${metadata.serial}'
- display: Firmware version
cellType: 'text'
text:
- '${metadata.fwVersion}'
- display: Created on
cellType: 'text'
text:
- '${createdDate}'
- display: State
cellType: 'icon'
path: metadata.connected
icons:
- icon: /img/offline.svg
condition: default
sortName: "off"
- icon: /img/offline.svg
condition: false
sortName: "off"
- icon: /img/online.svg
condition: true
sortName: "on"
itemLink:
path: "/administration/devices/:endpointId"
parameters:
itemJsonPath: endpointId
Interfaces
EP List 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.