automate publishing of web layers using arcpy€¦ · arcpy sharing tools map....
TRANSCRIPT
Automate Publishing of Web Layers
Using ArcPyShilpi Jain
Why automated?
Faster
Reliable
Integrate
ArcPy Sharing Tools
map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables})
Returns a class object based on service_type selected.
http://pro.arcgis.com/en/pro-app/arcpy/mapping/map-class.htm
1. getWebLayerSharingDraft
server_type service_type
HOSTING_SERVER
FEATURE FeatureSharingDraft
TILE TileSharingDraft
FEDERATED_SERVER MAP_IMAGE MapImageSharingDraft
returned object
Properties of returned object
credits
summary
Metadata description
tags
useLimitations
Methods of returned object
exportToSDDraft() – returns the location and name of sddraft
overwritingExistingService copyDataToServer
portalFolder federatedServerUrl
Service Properties serverFolder offline
serverType
serviceName
Demo 1: Sharing to ArcGIS Online
StageService_server (in_service_definition_draft, out_service_definition, {staging_version})
https://pro.arcgis.com/en/pro-app/tool-reference/server/stage-service.htm
2. Stage Service
UploadServiceDefinition_server (in_sd_file, in_server, {in_service_name}, {in_cluster}, {in_folder_type},
{in_folder}, {in_startupType}, {in_override}, {in_my_contents}, {in_public}, {in_organization}, {in_groups})
https://pro.arcgis.com/en/pro-app/tool-reference/server/upload-service-definition.htm
server_type
3. Upload Service Definition
SignInToPortal (portal_url, username, password)
http://pro.arcgis.com/en/pro-app/arcpy/functions/signintoportal.htm
When to use?
If the script is to be run outside Pro.
4. Sign In To Portal
Demo 2: Sharing to Enterprise
Conclusion
Why Automate How to Automate
• Increase efficiency
• Eliminate human error
• Integrate with other GP tools
• arcpy.SignInToPortal
• arcpy.mp.getWebLayerSharingDraft
• arcpy.StageService_server
• arcpy.UploadServiceDefinition_server
Github Linkhttps://github.com/jnshill/ArcPyPublishing
Please Share Your Feedback in the App
Download the Esri
Events app and find
your event
Select the session
you attended
Scroll down to
“Survey”
Log in to access the
survey
Complete the survey
and select “Submit”