EP List

Overview

eplist-view

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

  1. It is possible to sort endpoints order by certain column values with up/down arrow near column’s name in the table header section. sort-view Sorted table: sort-applied
  2. 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-button Search results: search-result

Configuration

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

  1. Click on any endpoint’s row in the list. eplist-view
  2. The widget navigates a user to endpoint’s specific dashboard. eplist-view

Configuration

Values mapping

Description

Gives the ability to map endpoint’s metadata values or it’s identifier and represent it with preconfigured string pattern.

Usage

  1. You could see described values in the widget table’s column. eplist-view

Configuration

Endpoint creation

Description

EP List widget provides possibility of endpoint creation.

Usage

  1. Click the plus button in the bottom right corner of the widget. eplist-plus
  2. Fill in the fields and click “Create”. eplist-creation-form
  3. See that endpoint is created. eplist--creation-success

Configuration

Filters

Description

The widget gives ability to filter endpoints by providing a certain endpoint filter ID.

Usage

  1. Filtered endpoints that matching cc3200 devices filter. filtered-endpoints

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:                   # 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.

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.

filtered-endpoints

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"

double-raw-config

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

eplist-creation-schema-result

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.

filtered-endpoints

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

minimal-config-result

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

max-config-result

Interfaces

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

EP List interfaces diagram

For service communication, WD widgets mainly use REST APIs.