Add asset instances
Asset Inventory allows you to create specific instances of the Asset Type. You can map the Asset Type to the appropriate EI Agent to which it is physically connected.
You can add a single asset by entering the information for that asset, or add multiple assets from a CSV file.
After you add asset types, follow the steps below to add assets.
Add a single asset
- From the left menu, click Assets > Asset Inventory.
- From the right pane, click Add Asset.
- In the Select Add Asset Method pop-up, select Manual Asset.
- In the Add Asset page, complete the following fields.
Field | Description |
---|---|
Asset Name | The name for the asset. |
Serial No. | The serial number for the asset. |
Asset Type | Select an asset type from the drop-down list. |
Tag | This is an optional field. Tag is used for bulk mapping of assets to an EI Agent. You can assign the same tag to multiple assets. |
- Update any fields that are unique to this instance of the asset type.
- Click Save.
Note: When defining a sensor device/asset instance of the MQTT asset type, the Client ID specified in Advanced Settings should match the MQTT Client ID used while publishing MQTT data to the EI. The different MQTT connections (data streams) to EI are differentiated using this Client ID. (Refer to MQTT asset type settings and SNMP Connector Utilizing NTCIP1202)
Add Multiple assets
Use a CSV file to add a large number of assets.
Note: You must have the Asset Management role to upload CSV files.
- From the left menu, click Assets > Asset Inventory.
- From the right pane, click Add Asset.
- In the Select Add Asset Method pop-up, select Bulk Add.
- In the Upload tab, select an asset type for which you want to initiate the bulk import of assets instances from the Asset Type drop-down list or start typing in the Search field to narrow your options.
Note: Selecting an incorrect asset type will lead to an incorrect generation of assets and templates.
- In the Upload CSV section, choose a file or drag and drop to upload a CSV file. If you don't have a file, click Download CSV template to download the sample template that contains the required column fields. Then, fill the template with appropriate data and upload it.
The CSV file should contain header columns for each field for which the data is to be set
In the CSV file, the field names must be the internal API names defined in the GraphQL API.
After the header, each non-empty row creates an asset in the system if all the constraints are fulfilled. Each row represents a record.
All available field headers as well as some information about each field are available.
Example CSV file:
# Asset Import Template for ftoennie-fridge-physics-simulator # serial (Serial No): String (required) # label (Asset Name): String (required) # host (IP Address or Host Name): String (optional) (default: 10.49.133.110) # initialLowerTempBarrier (initial lower temp barrier): Double (optional) # initialTransferCoefficient (initialTranferCoefficient): Double (optional) # initialUpperTempBarrier (initial upper temp barrier): Double (optional) # key (secretKey): String (optional) # port (Port): Integer (optional) (default: 10000) # powerPrice (electricity price): Double (optional) # responsibleEMail (responsibleEMail): String (optional) # roomTemperature (Room Temperature): Double (optional) # slaveId (Slave ID): Integer (optional) (default: 1) # timeout (Timeout): Integer (optional) (default: 500) # mappingTag (Mapping Tag): String (optional) # $agentSerial (EI Agent Serial No): String (optional) # $agentLabel (EI Agent Name): String (optional) # stringCustomAttribute (User defined): String (optional) # encryptedstringCustomAttribute (User defined): Encrypted String (optional) # doubleCustomAttribute (User defined): Double (optional) # fileCustomAttribute (User defined): File (optional) serial,label,host,initialLowerTempBarrier,initialTransferCoefficient,initialUpperTempBarrier,key,port,powerPrice,responsibleEMail,roomTemperature,slaveId,timeout,mappingTag,$agentSerial,$agentLabel
Example CSV file:
NTCIP1202 Connection Type:Note: The Bulk Add template now includes a new field called Trap Port.
# Asset Import Template for ftoennie-fridge-physics-simulator # serial (Serial No): String (required) # label (Asset Name): String (required) # host (IP Address or Host Name): String (optional) (default: 10.49.133.110) # initialLowerTempBarrier (initial lower temp barrier): Double (optional) # initialTransferCoefficient (initialTranferCoefficient): Double (optional) # initialUpperTempBarrier (initial upper temp barrier): Double (optional) # key (secretKey): String (optional) # port (Port): Integer (optional) (default: 10000) # powerPrice (electricity price): Double (optional) # responsibleEMail (responsibleEMail): String (optional) # roomTemperature (Room Temperature): Double (optional) # slaveId (Slave ID): Integer (optional) (default: 1) # timeout (Timeout): Integer (optional) (default: 500) # mappingTag (Mapping Tag): String (optional) # $agentSerial (EI Agent Serial No): String (optional) # $agentLabel (EI Agent Name): String (optional) # stringCustomAttribute (User defined): String (optional) # encryptedstringCustomAttribute (User defined): Encrypted String (optional) # doubleCustomAttribute (User defined): Double (optional) # fileCustomAttribute (User defined): File (optional) serial,label,host,initialLowerTempBarrier,initialTransferCoefficient,initialUpperTempBarrier,key,port,powerPrice,responsibleEMail,roomTemperature,slaveId,timeout,mappingTag,$agentSerial,$agentLabel
The lines starting with # are comments and will be ignored when the file is processed.
The last line in the template contains the field headers,
Each field is described in a comment like this:
- <field_name> (<human readable field label>): <value type> (<required or optional>) (default: <default value>)
- Possible value types are: String, Integer, Long, Double
- Fields marked with Required will need a value, otherwise, the asset won’t be created and an error will be generated.
- To create an asset, the fields that can be left empty are marked optional.
- For some fields, default values are used if no values are provided in the CSV file. These default values are imported from the asset type and from the default values that are specified globally.
- For some fields, some additional information is provided at the end of the field description. This information varies and guides the user.
- For fileCustomAttribute,
there are two ways to add value:Directly give the file contents. Example: some_text
It will appear as a text file with the name shown as a customer attribute label.Use below given format to give file as base64 encoded:
BASE64FILE:\<base64 encoded JSON Object of File Name >:\<actual base64 encoded data>.
Example:
BASE64FILE:eyAiRklMRV9OQU1FIjogImZpbGVfbmFtZS50eHQifQ==:c29tZV9jb250ZW50 <br> where <br> eyAiRklMRV9OQU1FIjogImZpbGVfbmFtZS50eHQifQ== = { "FILE_NAME": "file_name.txt"} <br> and <br> c29tZV9jb250ZW50 = some_content
The first two fields: serial and label define the unique keys for the asset. All the CSV files that are uploaded must contain these two unique fields. This also applies to the CSV files that are generated from scratch.
The last two fields: $agentSerial and $agentLabel are for mapping an asset to an EI Agent. These fields are optional. The CSV files generated from scratch don’t have to contain these fields.
- If one or both the fields are present, they can be used to change the AI Agent mapping for the given asset record.
- For a single record either the EI Agent Name or the EI Agent Serial No can be used to reference an EI Agent that is in the DB as the mapping target.
- If a value is provided for one of the fields, the bulk addition will find a matching EI Agent entry and assign it to map the given asset.
- If no value is provided for either of these fields but the field header is part of the CSV file, then the EI Agent mapped to the asset will be removed. The asset won’t be mapped to any EI Agent after that.
- If both the field headers are present and the values for both are given, then $agentLabel is used.
All fields that are marked as optional can be removed from the CSV file.
The CSV files generated from scratch don’t need to contain the comments. Only the field headers are needed.
- Click Upload. Depending on the CSV file size, it may take a few seconds for the process to complete and the created assets can be viewed in the Asset Inventory page.
View CSV files job log
From the left menu, click Assets > Asset Inventory.
From the right pane, click Add Asset.
In the Add Asset pop-up, select Bulk Add.
In the Bulk Add Asset page, select the Upload History tab to view information about the ongoing bulk addition of the assets. You can view the last 20 uploaded CSV files. When a new job is started the oldest one is deleted. The tabular view of CSV files has the following columns.
Column header Description File The CSV file name that has been uploaded to start the job. Type This has one of the following 2 values:
* Map Assets to EI Agent Job
* Add Assets JobSubmitted By The user ID of the user that uploaded the CSV file. Submitted At The date and time when the file was uploaded. Status The status of the job. It can be Running or Completed. Success The number of records processed successfully. Click on the number to view the detailed information about the job.
* For Add Assets Job: The number of added assets.
* For Map Assets to EI Agent Job: The number of assets that have been mapped to an EI Agent.Failed The number of records that were processed unsuccessfully or with error. Click on the number to view the detailed information about the job. Skipped The number of records that have been skipped. Click on the number to view the detailed information about the job.
Examples for skipped records:
* An asset was not created because it already exists. Assets won’t be updated.
* If the unique fields correspond to an already existing asset in the DB, the record will be skipped.
For Map Assets to EI Agent Job, if the record is skipped, the mapping status for the asset won’t change irrespective of whether it is already mapped or not mapped to the given EI Agent.