Get additional information such as the description of the network dataset used for the analysis and the execution limits for a tool in the geoprocessing service.
The tool is meant to be used before executing other tools that are available in the geoprocessing service. For example, if you need to identify the maximum number of stops supported by the FindRoutes tool, you can run this tool to determine the limit.
Parameter | Explanation |
---|---|
serviceName |
Specify the service name containing the tool. The parameter value should be specified using one of the following keywords that reference a particular geoprocessing service.
The default value is asyncRoute. |
toolName |
Specify the tool name in the geoprocessing service. The parameter value should be a valid tool name in the geoprocessing service specified by the serviceName parameter. Valid tool names are
The default value is FindRoutes. |
GetToolInfo example
The following Python script demonstrates how to use the GetToolInfo tool in a script.
''' The script shows how to use the GetToolInfo tool to get the maximum number of stops that can be used as inputs with FindRoutes tool. ''' import sys import json import arcpy #Change the username and password applicable to your own ArcGIS Online account username = "<your user name>" password = "<your password>" utility_service = "https://logistics.arcgis.com/arcgis/services;World/Utilities;{0};{1}".format(username, password) #Add the geoprocessing service as a toolbox. arcpy.ImportToolbox(utility_service) #Call the tool to get the limits for the FindRoutes tool result = arcpy.Utilities.GetToolInfo("asyncRoute", "FindRoutes") #Print any warning or error messages returned from the tool result_severity = arcpy.GetMaxSeverity() if result_severity == 2: arcpy.AddMessage("An error occured when running the tool") arcpy.AddMessage(arcpy.GetMessages(2)) sys.exit(2) elif result_severity == 1: arcpy.AddMessage("Warnings were returned when running the tool") arcpy.AddMessage(arcpy.GetMessages(1)) #Retrieve the tool info and convert it to a dictionary output_tool_info_json = result.getOutput(0) output_tool_info_dict = json.loads(output_tool_info_json) #Retrieve the maximum number of stops allowed by the service max_stops = int(output_tool_info_dict["serviceLimits"]["maximumStops"]) arcpy.AddMessage("The maximum number of stops supported by the FindRoutes tool: {}" .format(max_stops))
service limits, network description, network dataset description
There are no credits for this item.
This tool is available for users with an ArcGIS Online organizational subscription. To access this geoprocessing tool, you'll need to sign in with an account that is a member of an organizational subscription. Executing this tool does not incur service credits.