automate publishing of web layers using arcpy€¦ · arcpy sharing tools map....

16
Automate Publishing of Web Layers Using ArcPy Shilpi Jain

Upload: others

Post on 14-Jun-2020

32 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Automate Publishing of Web Layers Using ArcPy€¦ · ArcPy Sharing Tools map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables}) Returns a class

Automate Publishing of Web Layers

Using ArcPyShilpi Jain

Page 2: Automate Publishing of Web Layers Using ArcPy€¦ · ArcPy Sharing Tools map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables}) Returns a class

Why automated?

Faster

Reliable

Integrate

Page 3: Automate Publishing of Web Layers Using ArcPy€¦ · ArcPy Sharing Tools map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables}) Returns a class

ArcPy Sharing Tools

Page 4: Automate Publishing of Web Layers Using ArcPy€¦ · ArcPy Sharing Tools map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables}) Returns a class

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

Page 5: Automate Publishing of Web Layers Using ArcPy€¦ · ArcPy Sharing Tools map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables}) Returns a class

server_type service_type

HOSTING_SERVER

FEATURE FeatureSharingDraft

TILE TileSharingDraft

FEDERATED_SERVER MAP_IMAGE MapImageSharingDraft

returned object

Page 6: Automate Publishing of Web Layers Using ArcPy€¦ · ArcPy Sharing Tools map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables}) Returns a class

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

Page 7: Automate Publishing of Web Layers Using ArcPy€¦ · ArcPy Sharing Tools map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables}) Returns a class

Demo 1: Sharing to ArcGIS Online

Page 8: Automate Publishing of Web Layers Using ArcPy€¦ · ArcPy Sharing Tools map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables}) Returns a class
Page 9: Automate Publishing of Web Layers Using ArcPy€¦ · ArcPy Sharing Tools map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables}) Returns a class

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

Page 10: Automate Publishing of Web Layers Using ArcPy€¦ · ArcPy Sharing Tools map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables}) Returns a class

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

Page 11: Automate Publishing of Web Layers Using ArcPy€¦ · ArcPy Sharing Tools map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables}) Returns a class

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

Page 12: Automate Publishing of Web Layers Using ArcPy€¦ · ArcPy Sharing Tools map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables}) Returns a class

Demo 2: Sharing to Enterprise

Page 13: Automate Publishing of Web Layers Using ArcPy€¦ · ArcPy Sharing Tools map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables}) Returns a class
Page 14: Automate Publishing of Web Layers Using ArcPy€¦ · ArcPy Sharing Tools map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables}) Returns a class

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

Page 15: Automate Publishing of Web Layers Using ArcPy€¦ · ArcPy Sharing Tools map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables}) Returns a class

Github Linkhttps://github.com/jnshill/ArcPyPublishing

Page 16: Automate Publishing of Web Layers Using ArcPy€¦ · ArcPy Sharing Tools map. getWebLayerSharingDraft (server_type, service_type, service_name, {layers_and_tables}) Returns a class

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”