I am trying to build a mechanism (outside of ArcGIS Pro) to trace devices of Interest for a nightly process.
The TraceLocations parameters requires a terminalId to defined.
I realize I can create a lookup and try and populate this in my REST Requests but I am keen to understand if the system can provide this on demand.
One alternative is to use the "connectivity" component of the JSON output (via the ExportSubnetwork or Trace) but this means I need to trace the network or export all subnetworks before I can start compiling my list of Starting Points.
Any suggestions?
EDIT: I realize I can use the TerminalID from the connected lines and their TODEVICETERMINAL/FROMDEVICETERMINAL but that too is a convoluted way to get the TerminalIDs.
Solved! Go to Solution.
There are many different ways to get this information, depending on which API you're using (arcpy.Describe for ArcPy, getDefinition for Pro SDK, etc). In a services-based environment it all ends up in a call to get the schema/definition from the FeatureServer/queryDataElements operation. You can do this manually by passing in the layer id of your utility network. This is the REST endpoint equivalent of Arcpy.Describe.
Look at the UN data element you can get the terminal IDs associated with each asset type, that will let you build up the schema of what terminals IDs you have available for analysis. If you want your tool to be sensitive to the context and connectivity of a specific feature, then you'll need to look at the from/todeviceterminalid fields on the line or the associations table.
Running a trace to get the terminal ids used for connectivity create a sort of paradox, where you need to run a trace to get the terminal ID to create a trace location to run a trace. and as you noted its slow.
@RobertKrisher Thanks for confirming that. Can I ask a question on how to query the UN Data Element via REST? I keep getting the error.
Were you suggesting I do it a different way - Like ArcPy and Describe()?
There are many different ways to get this information, depending on which API you're using (arcpy.Describe for ArcPy, getDefinition for Pro SDK, etc). In a services-based environment it all ends up in a call to get the schema/definition from the FeatureServer/queryDataElements operation. You can do this manually by passing in the layer id of your utility network. This is the REST endpoint equivalent of Arcpy.Describe.
@RobertKrisher - That's exactly what I was looking for! Didn't realize queryDataElements was an option, I conveniently glanced over this section in the API Reference.
For anyone else who might need it - https://developers.arcgis.com/rest/services-reference/enterprise/query-data-elements-feature-service...
Thanks 🙂