I am trying to enumerate all subnetworks so I can programmatically call exportSubnetwork via the REST API.
I cannot find anything in the documentation that shows there is a means to do this via the REST API.
Is my only choice here to use arcpy or do a DB dip to look at the subnetworks table?
Answering my own question:
You have to look at the FeatureServer, not the UtilityNetwork to get this.
There exists a layer called "Subnet Line" which contains the tier/subnetworks that I was looking for.
Only downside is that that tiers are returned with their coded values, and the exportSubnet expects the non-coded value so you will have to do a translation.
@BrandenRager - Awesome job!
Subnet Line is one way of getting all subnetworks but I believe a better way is to use the subnetworks table for this. This is layer id 500002
https://{Your Site}/server/rest/services/UN_Service/Prod_UN_Service_2/FeatureServer/500002/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&defaultSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&havingClause=&gdbVersion=&historicMoment=&returnDistinctValues=false&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&multipatchOption=xyFootprint&resultOffset=&resultRecordCount=&returnTrueCurves=false&returnCentroid=false&timeReferenceUnknownClient=false&maxRecordCountFactor=&sqlFormat=none&featureEncoding=esriDefault&datumTransformation=&cacheHint=false&f=html
Response
Two distinct advantages -
1) This will show you the Tier Name i.e the non-coded value
2) This will also show subnetworks where there may not be a subnet line.
For example - A Distribution Transformer (LV subnetwork controller) without any LV Lines connected to it but has customers connected via associations. The "subnetline GlobalID" field will be blank for such instances.
Bonus advantages -
It will also show deleted subnetworks which you might want to clear out from the table periodically.
Also shows the last acknowledged date and last updated date which might help drive logic of when to export the subnetworks.
Hope this helps 🙂