Import and Export

Last modified: Feb 12, 2019 @ 06:55

Import and export functionality allows Hardware Types and Templates to be transferred between Device Networks in the same or a different DDM instance.

Prerequisites

When transferring from a DDM instance to another, both instances must be running the same version of DDM Core. Different versions may use different data models, which may cause the import operation to fail.

Overview

The following DDM entities can be exported and imported:

  • Gateway Type
  • Smart Object Type and its contained Resource Types
  • Device Type

Hardware Types window in the Dashboard, including the buttons for import and export.

Different Hardware Types produce different types of export files. For example, Gateway Types are exported as a JSON file, while Device Types are exported as a ZIP file containing a set of three files.

Note: Do not edit export files.

Gateway Types

Export Gateway Types and Gateway Templates

  1. In the Dashboard, navigate to Settings -> Hardware Types.
  2. In the Gateway Type tab, tick the checkbox at the extreme right of each Gateway Type to export.
  3. Click the Export Selected button and save the export file.

Import Gateway Types and Gateway Templates

  1. On the destination Device Network, in the Dashboard, navigate to Settings -> Hardware Types.
  2. In the Gateway Types tab, Click the Import button.
  3. Navigate to the exported file and select it, then click the Open button.

Notes

  • For each Gateway Type being imported, HardwareTypeId and Name must not already exist within the destination Device Network. Gateway Types that do not meet these requirements will not be imported.
  • On the destination Device Network, Gateway Templates are identified by Name. If an existing Gateway Template on the Device Network has the same Name as a Gateway Template being imported, the existing one will not be updated.

Smart Object Types and Resource Types

Transferring Smart Object Types (and their included Resource Types) is primarily done in the format specified by the Open Mobile Alliance (OMA) Lightweight Machine to Machine (LwM2M) standard.

Export Smart Object Types

The procedure is similar to exporting Device Types, and is performed in the Smart Object Types tab of the Hardware Types window.

Exporting Smart Object Types results in a ZIP file that contains two files:

  • SmartObjectTypes.json: contains a list of Smart Objects and included resource types.
  • SmartObjectTypes.xml: contains a list of Smart Objects and included resource types in a format matching the OMA LwM2M standard.

Import Smart Object Types

  1. In the Dashboard, navigate to Settings -> Hardware Types.
  2. In the Smart Object Types tab, tick the checkbox at the extreme right of each Smart Object Type to export.
  3. Click the Export Selected button and save the export file.

The file to import can be the ZIP file generated by exporting Smart Object Types. Alternatively, the file can be in XML or JSON format.

When setting up a new environment or creating a new Device Network, it is recommended to import the objects included in the IPSO model. An XML file containing these objects can be found at https://ipso-alliance.github.io/pub/.

Smart Object Type requirements:

  • Name is required, and cannot be empty.
  • TypeId is greater than 0.

Resource Type requirements:

  • Name is required, and cannot be empty.
  • TypeId is greater than 0.
  • If a Resource Type does not allow multiple instances, only one Resource Type Instance of that Resource Type can be included for a Smart Object Type. In this case, only InstanceNumber 0 is allowed.

If any requirement fails for a Smart Object Type or included Resource Type, the entire import is aborted.

Smart Object Types and Resource Types are identified by TypeId. Resource Type Instances are identified by a combination of TypeId and InstanceNumber. Missing items are created in the Device Network. Existing items are updated according to the information in the imported file.

The range of IDs defined by OMA as reserved for Reusable Resources is used to set the IsReusable property for imported Resource Types. Any Resource Type included in the import with a TypeId within this range will receive a true value for the IsReusable property.

Device Types and Associated Types and Templates

Export Device Types

  1. In the Dashboard, navigate to Settings -> Hardware Types.
  2. In the Device Types tab, tick the checkbox at the extreme right of each Device Type to export.
  3. Click the Export Selected button and save the export file.

Exporting Device Types results in a ZIP file that contains three files:

  • DeviceType.json: contains a list of device types. It will include Device Types along with their Smart Object Type Instances, as well as connected Device Templates, Smart Object Templates and Resource Templates. It does not contain any detailed information of Smart Object Types or Resource Types.
  • IPSO.xml: contains a list of Smart Objects and their included Resource Types, in a format that matches the OMA LwM2M standard.
  • Export.txt: A log file containing information about the export.

Import Device Types

Prerequisite: Before importing Device Types, make sure that the required Smart Object Types are already present in the destination Device Network.

  1. On the destination Device Network, in the Dashboard, navigate to Settings -> Hardware Types.
  2. In the Device Types tab, Click the Import button.
  3. Navigate to the exported file and select it, then click the Open button.
    An initial validation is done to verify that all Smart Object Types from the exported ZIP file exist in the Device Network.

    • If the validation is successful, the Device Type import continues.
    • If the validation fails, the entire import is aborted.

Device Types from the import file are created in the destination Device Network, along with connected Device Templates and Smart Object Templates. Templates are identified by name, and will not be updated if they already exist in the Device Network.

The response includes information on which items were imported, and which items were excluded from the import.