VtrinCmd Tool
This is an internal tool used to import and export files in JSON format The parameters and Examples are provided in this document
Usage: VtrinCmd[.exe] [parameters] ...
--acceptkeychanges Accept server key changes.
--acceptnewkeys Accept new server keys.
--confirm Experimental (with --importjson option) Ask user to confirm commit.
--connectionstring <value> Connection string for the driver.
--continueonerror (with --importjson option) Continue operation when an error occurs.
--dryrun Experimental (with --importjson option) Report changes but do not commit.
--exportjson <value> Export JSON class data. "ClassID[properties]:Mask" Multiple separated with |
--exportjsonbag <value> Export JSON property bag(s) "BagID[VersionTime]:UserID" Multiple separated with |
--exportjsontreenode <value> Export JSON from TreeNode instance and other related data. NodeId as parameter.
--exportrecursive (with --exportjsontreenode) Export recursively the whole sub tree.
--exporttofolder <value> Export TreeNodes recursively to a folder structure. Folder path as parameter.
--fetchmax <value> (with --query option) Maximum number of rows returned by the query.
--fileversion Display only the file version (VtrinLib.dll)
--force (with --importjson option) Forcefully remove conflicting instances.
--help Display this help.
--hidelinenumbers (with --query option) Don't show line numbers in query results.
--importjson <value> Import JSON data from a file(s). Multiple files separated with |
--importjsonfolder <value> Import data from .json files in a folder recursively. Folder path as parameter.
--includedefault (with --exportjson option) Include property values identical to default values.
--indent <value> Number of spaces for indent in exporting/displaying JSON data (Tab used by default)
--noreplace (with --importjson option) Do NOT replace/merge into existing class instances.
--outfile <value> Write output to a file (with export* options).
--query <value> Query class data. "ClassID[Properties]:Mask"
--rawvalues (with --query option) Show raw values in query results.
--report Experimental (with --importjson option) Display detailed report.
--savecredentials Save entered credentials to the credential storage.
--taketime Measure amount of time taken by the operation.
--trace Show diagnostics trace.
--user <value> User for the connection. (When using vault name prefix with *)
--verbose Show verbose trace output on console.
--version Display the product version (VtrinLib.dll)
The query language for --exportjson and --query options "classid[properties]:mask"
classid The Id of the source class. properties (Optional) List of class properties to include, comma separated in square brackets []. mask (Optional) Vtrin where mask string (prefix with :) for filtering query results.
- Multiple queries are supported and should be separated with | (pipe)
- The property list supports * (asterisk) wildcard to include matching propertynames.
- Propertynames prefixed with - (dash) are excluded from the results. (Wildcards not supported.)
- With --query option, only properties visible to user by default are included. Using * in the property list overrides this.
- NOTE: Unless --includedefault is used --exportjson only includes properties if their value differs from the default.
Examples:
VtrinCmd --connectionstring wss://myserver/mysource --user mydomain\\myuser --savecredentials
- Connect to data source with user "mydomain\myuser" and store the entered credentials to credential storage.
- User is asked to enter password. If the connection is successful, the credential storage name can be chosen.
- The credential storage name can be used with --user option by prefixing it with * (asterisk).
- If default storage name was chosen the --user option can be omitted.
VtrinCmd --connectionstring wss://myserver/mysource --exportjson "Equipment|EquipmentPropertyInfo" --outfile equipment.json
- Export to JSON all Equipment and EquipmentPropertyInfo class instances and store the output to equipment.json file
VtrinCmd --connectionstring wss://myotherserver/mysource --importjson equipment.json
- Import the data from equipment.json to the connected data source
VtrinCmd --connectionstring wss://myserver/mysource --exportjson "CalculationTask[-RowModificationTime]\:Module = 'MyModule'"
- Export to JSON all CalculationTask instances whose Module is 'MyModule', exclude RowModificationTime from the export.
VtrinCmd --connectionstring wss://myserver/mysource --query "Class[Id,BaseClassName]\:Id LIKE 'Path\_\*' ORDER BY Id DESC"
- List the names and base class names of classes whose name begin with string "Path_" in descending order by name
VtrinCmd --connectionstring wss://myserver/mysource --query "Path_ABB.Ability.SysDiag.System[ComputerName,*disk*]"
- List all System instances showing values for ComputerName and any property containing word "disk"
Updated 4 months ago
