By just installing Node JS 13 or higher you will have access to ability to connect to a Utility network service, list the subnetworks, query the topology status, update subnetworks, export subnetworks, disable and enable topology and much more.
You can use this tool to schedule task to update all subnetworks, or configure Jenkins (an automation server) to update export subnetworks nightly and much more. The uncli works on all operating systems, Windows, Linux & MacOS.
The installation process of the tool is simple. All you need to do is to install Node JS 13.x or higher. The current version of Node JS is 14.x.
Once you install Node js , open a command line prompt and type in the following
npm install -g un-cli
Once you install the uncli tools, you can now use them as follows: Connect to your portal by specifying the user name, password and the feature service name that has a utility network in it.
> uncli --portal https://utilitynetwork.esri.com/portal --service NapervilleElectric_SQLServer --user tester --password tester.108
I’ll go through the most popular commands but feel free to explore the rest. Also feel free to suggest new commands that might be useful to add to the tool!
At any time you can type “help” to get a list of all commands available.
Get Count of Features
Count how many features you have in your Utility Network
Update All Subnetworks
>update subnetworks -all
This command updates all dirty subnetworks one by one. It fetches all subnetworks that are dirty and updates them in a synchronous manner.
Update Deleted Subnetworks
>update subnetworks -deleted
This commands only update subnetworks that has been marked for deleted (or have some of their controllers disabled).
Export All Subnetworks
>export subnetworks -all
This command exports all subnetworks that have been cleaned and successfully updated and writes the exported json in the home directory.
Export New Subnetworks
>export subnetworks -new
This command exports all subnetworks that have been cleaned and successfully updated but haven’t yet been exported and writes the exported json in the home directory.
Automate uncli or execute commands in bulk
To automate or execute multiple commands in bulk you can use the -file parameter to specify a txt file with the list of command to execute ..
Create a text file and add your commands to it. For example below is two commands that update all subnetworks and export them. Name the file commands.txt
update subnetworks -all export subnetworks -new
add the -file option and provide the text file that you need to execute.
Jenkins is an automation server that allows you to automate tasks, this tools works with Jenkins as well
This tool is still in alpha phase, please report any bugs you find in the comments box in this blog post. Thank you so much! The tool works only on DEFAULT currently.
The tool was updated to include connecting to a specific gdbVersion and also list attribute rules execution summary by querying the logs.