Bulk Importing Assets from the Command Line
Use the toolbox command, CentraSiteAssetImporter, to bulk import multiple assets from a CSV file or an Excel file (.xlsx format).
Note: | Ensure that all of the necessary JAR files are available in the "redist" folder. This folder is located directly under the CentraSite installation directory. |
Required JAR files for a CSV (.csv) file:
Required JAR files for an Excel (.xlsx) file:
Download Apache POI 3.13 from the URL
https://poi.apache.org/download.html and place the following Jar files in the “
redist" folder.
![*](bullet.gif)
poi*.jar
![*](bullet.gif)
poi-ooxml*.jar
![*](bullet.gif)
poi-ooxml-schemas*.jar
Supported data types and their format:
![*](bullet.gif)
String
![*](bullet.gif)
Boolean
![*](bullet.gif)
Number
![*](bullet.gif)
URI/URL
![*](bullet.gif)
Multiline String
![*](bullet.gif)
Classification
![*](bullet.gif)
IP Address
![*](bullet.gif)
Email
![*](bullet.gif)
Date/Time
![*](bullet.gif)
Duration
Format for data type "Duration":
Example: P1Y2M3DT4H5M
Format for data type "Date":
![*](bullet.gif)
yyyy-MM-dd
Example: 2015-12-10
Format for data type "Date and Time":
![*](bullet.gif)
yyyy-mm-dd hh:mm:ss
Example: 2015-12-10 12:04:10
![*](bullet.gif)
yyyy-mm-dd hh:mm
Example: 2015-12-10 12:04
Format for data type "Time":
![*](bullet.gif)
hh:mm:ss
Example: 12:04:10
![*](bullet.gif)
hh:mm
Example: 12.10
The syntax for the toolbox command is:
C:\SoftwareAG\CentraSite\utilities>CentraSiteToolbox.cmd CentraSiteAssetImporter.jar [-url <CENTRASITE-URL>] -username <USERNAME> -password <PASSWORD> [-ownername] <OWNER-NAME>) -qname <FULLY QUALIFIED NAME> -inputfile <FULL PATH TO FILE> [-excelworksheet <EXCEL WORKSHEET NAME>] -namecolumn <ASSET COLUMN NAME> [-desccolumn <ASSET DESC COLUMN NAME>]
The input parameters are:
Parameter | Description |
-url | (Optional). The fully qualified URL of the CentraSite registry/repository. Default value is http://localhost:53307. |
-username | The user ID of a registered CentraSite user who has the CentraSite Administrator role. For example, Administrator. |
-password | The password for the CentraSite user identified by the parameter -username. |
-ownername | (Optional). The domain in which the user wants to include the imported asset. If this parameter is not specified, the user identified by the parameter -username will be the owner. |
-qname | The namespace of an asset type along with its schema name. For example: {http://namespaces.DefaultOrganization.com/Schema} |
-inputfile | The absolute or relative path to the CSV or Excel file. If relative, the path should be relative to the location from where the command is executed. |
-excelworksheet | (Applicable only to Excel). The name of the Excel worksheet which contains the details of assets to be imported into CentraSite. |
-namecolumn | The name of the column or header in Excel sheet or CSV file from which a display name would be assigned to the imported asset. |
-desccolumn | The name of the column or header in Excel sheet or CSV file from which a brief description would be assigned to the imported asset. |
Example:
C:\SoftwareAG\CentraSite\utilities>CentraSiteToolbox.cmd CentraSiteAssetImporter.jar -url http://localhost:53305/CentraSite/CentraSite -username Administrator -password manage -ownername sag\inosec1 -qname {http://namespaces.DefaultOrganization.com/Schema} MyAssetType -filelocation c:\repository\assetdata.xlsx -namecolumn "Interface Name" -excelworksheet Lowes.com -desccolumn "desc"