Server Tool alias?

Discussion created by KevinBellSLC on Aug 20, 2014
Branched from an earlier discussion


This has the following code sample:


import arcpy
import time

arcpy.ImportToolbox(";Elevation/ESRI_Elevation_World", "viewshedAlias")

result = arcpy.Viewshed_viewshedAlias(r'c:\data\inputPoint.shp', "10000 Kilometers")

while result.status < 4:
  print result.status
print "Execution Finished"

arcpy.CopyFeatures_management(result.getOutput(0), 'localResult.shp')



With this sample above, I don't get the alias here.  They import the toolbox and give it an alias, but how does the following line know the alias?  viewshedAlias is not part of arcpy.


result = arcpy.Viewshed_viewshedAlias(r'c:\data\inputPoint.shp', "10000 Kilometers")


I tried something like this:


arcpy.ImportToolbox(r"http://myserver/arcgis/rest/services;aFolder/aTool", "myTool")


result = myTool(r'C:\gisProject\default.gdb\aPoint', "1000 Feet")


...but it errors saying 'myTool' is not defined.  What am I missing about the alias?