Exporting and Importing Models¶
After creating a model, you may have to change its elements or add new elements as required. This task helps you manage existing models by exporting/importing EnOS-defined JSON files or Excel files to edit the existing model elements and is especially useful if you need to modify large numbers of elements for a model at one go.
The ability to export and import is also useful for copying or migrating models among different OUs or EnOS environments. You only need to export the model elements from the current OU, create an empty model in the OU that you wish to copy the model to, and import the model elements to the newly created model.
Note
The model name must be globally unique in the same EnOS environment. If you are copying the model to another OU within the same EnOS environment, you need to give a new name when creating the empty model. Using a new name will not affect the import of the model elements.
Before You Start¶
You need to have the proper permissions to view and manage models. Contact your OU administrator for access. For more information, see Policies, Roles, and Permissions.
Procedure¶
To edit your existing model, export the model first, then edit the downloaded file and import it to replace the existing model.
Exporting¶
In the EnOS Management Console, go to Models, and click Edit for the model you wish to export.
At the Feature Definition tab, click Export Model. Select the format of the file you want to download: JSON or Excel.
Edit the downloaded file.
The downloaded JSON file is named model_Modelname_Timestamp.json, where
Modelname
is the Model Name field from EnOS, andTimestamp
is the time you downloaded this JSON file in hhmmssSS, with SS indicating milliseconds.The downloaded Excel file is named ThingModel_Modelname.xlsx where
Modelname
is the Model Name field from EnOS.You can edit the file to modify existing model elements or add new elements.
In application development, if you need to locate model elements fast, you can use the Priority attribute in the JSON file or the Ranking attribute in the Excel sheet. Priority or Ranking 0 indicates this element is created when you create the model. Elements that you add to the existing model starts from 1 and increments by 1 for every element added hereafter. You can also give the elements random non-negative integers as their Priority or Ranking as you see fit. The Priority or Ranking numbers can be discontinuous, non-sequenced, or duplicated.
Importing¶
At the Feature Definition tab, click Edit > Import Model.
In the pop-up, click Upload. Select the edited JSON or Excel file.
Click Import if your uploaded file passes format verification.
You may have to correct format issues before you can complete importing. Refer to the error messages prompted after you have uploaded the JSON file.
Results¶
The model you selected has been changed based on the imported file you edited.