I am trying to automate the process of publishing a geoprocessing service to ArcGIS for Server 10.2.2, using a python script:
import arcpy result = r"C:\data\ContourLineFunction.rlt" connectionPath = r"C:\Users\sof\AppData\Roaming\ESRI\Desktop10.2\ArcCatalog\arcgis on localhost_6080 (admin).ags" sddraft = "ContourLineFunction.sddraft" sd = "ContourLineFunction.sd" serviceName = "ContourLineFunction" # create service definition draft arcpy.CreateGPSDDraft( result, sddraft, serviceName, server_type="ARCGIS_SERVER", connection_file_path=connectionPath, copy_data_to_server=False, folder_name=None, summary="lorem ipsum", tags="gp", executionType="Synchronous", resultMapServer=False, showMessages="INFO", maximumRecords=1000, minInstances=1, maxInstances=5, maxUsageTime=100, maxWaitTime=10, maxIdleTime=180) analyzeMessages = arcpy.mapping.AnalyzeForSD(sddraft)
The result from the AnalyzeForSD function contains multiple errors 001243:
{ 'errors': { (u'ERROR 001243: The ContourLineFunction/in_string_version parameter is missing a syntax dialog explanation in the item description', 92): [], (u'ERROR 001243: The ContourLineFunction/yCoordinate parameter is missing a syntax dialog explanation in the item description', 92): [], (u'ERROR 001242: Tool ContourLineFunction is missing item description summary', 80): [], (u'ERROR 001243: The ContourLineFunction/xCoordinate parameter is missing a syntax dialog explanation in the item description', 92): [], (u'ERROR 001243: The ContourLineFunction/radius parameter is missing a syntax dialog explanation in the item description', 92): []} ...
I know I can get rid of the errors by manually entering item descriptions in the Service Editor in ArcMap/ArcCatalog.
I have tried to find the settings in the sddraft file, but nothing looked like the right place for the values.
I have tried to find something inside the .rlt-file (geoprocessing result), but this was all binary stuff inside a ZIP file 😞
How can I automate the setting of the item descriptions?
Solved! Go to Solution.
Hi Stefan,
I don't believe there is a way to update the dialog explanation using arcpy. You will need to edit the explanation before running your script above by right-clicking on the model > Item Description > Edit.
Hi Stefan,
I don't believe there is a way to update the dialog explanation using arcpy. You will need to edit the explanation before running your script above by right-clicking on the model > Item Description > Edit.
Hi Jake, this is true! Another aspect of my tool is that it is written in C#, and I have to make a registry change to be able to see (and use) the edit button:
27000 - Enable ArcMap to create documentation for custom geoprocessing tools
Which leads me to an ArcObjects-related question. My GP-Tool implements IGPFunction.MetadataFile() which is a getter to return the file name of the metadata.xml file. The XML file contains the item description, but is not created until I edit the Item Description in ArcMap/ArcCatalog. Is there a way to automatically create this file, so that I only have to insert the missing item description text? If this could be scriptable with ArcObjects or Python, this would make the publishing process even more automatic.