Closed AlexArcPy closed 8 years ago
Check out the publishing class in ArcRest helper.
Thanks, Mike! Which class do you refer to?
Check out https://github.com/Esri/ArcREST/blob/master/src/arcresthelper/publishingtools.py#L1368
Here is an example of it implemented http://solutions.arcgis.com/utilities/water/help/customer-complaints/
Thanks, Mike! Are you sure that this can be used for publishing to AGS? It has AGOL organization everywhere in the code; so it looks to me as this is used for publishing feature services to AGOL organization. I am interested in publishing map services into a local AGS site.
Oh my mistake. This is for portal or online
When you publish a tool to AGS, you can use the publishing tools in the system folder. You can also use the create service function on ArcGIS Server to do this as well. The easiest way to publish is to just use the core arcpy.mapping tools to ArcGIS Server.
hope this helps.
Thanks, Andrew. This is how I do it now - with arcpy.mapping tools. I haven't used CreateService, it seems as this will just create a skeleton service with the properties as I don't see any way to get an sd file published, so the service won't have any referenced GIS data. Am I wrong?
If you think it's useful, I could submit a pull request with the arcpy.mapping based workflow for publishing a service, as it seems as ArcREST doesn't have one.
I think you have to upload the sd file to server using the upload functions then use the GP publishing tools if you manually want to do it.
This project shows the painprocess of doing it that way: https://bitbucket.org/databasin/ags_tool_deploy
Thanks for sharing a useful resource. However, this tool provides a command-line interface for packaging and publishing python toolboxes to ArcGIS Server (10.2.x).
I am talking exclusively about map services, no GP services are involved yet :)
@AlexArcPy The example does apply to only GP, but map services and GP all publish through the same tool.
I have developed my own arcpy-based workflows tools for publishing services to AGS site (using
arcpy.mapping.CreateMapSDDraft
,arcpy.StageService_server
, andarcpy.UploadServiceDefinition_server
).Are there any functions in ArcREST for publishing services (it could be directly from .mxd or from .sd) present? I have found the
MXDtoFeatureServiceDef
but it seems to target AGOL organization.I believe you cannot create an .sd file without using arcpy, so I am fine another arcpy-based solution.
Am I missing this function in ArcREST?