Select to view content in your preferred language

How to update a Tile Package in AGOL With Python?

618
4
02-10-2020 08:26 AM
ThomasColson
MVP Frequent Contributor

Is updating a Tile Package hosted on AGOL with Python even possible? There used to be https://cloudygis.maps.arcgis.com/home/item.html?id=d829e15ca7d840f29b1a1d8d2e8b7ac7  which no longer works due to SSL settings, which even when tell  urllib to ignore the warnings, it still doesn't work. Surely someone has solved this? 

0 Kudos
4 Replies
ThomasColson
MVP Frequent Contributor

Trying TileSharingDraft—Sharing module | Documentation , and I see 

overwriteExistingService
(Read and Write)

Specifies whether an existing service with the same name will be overwritten.

Boolean

in the documentation, but sharing_draft.overwriteExistingService = "True" (and I tried "true") results in 

Service name 'GRSM_STORM_TOTAL_PRECIP_TILES' already exists for 'orgid'
Failed to execute (UploadServiceDefinition).

Is the documentation wrong, or is there a bug and you can't use TileSharingDraft—Sharing module | Documentation  to overwrite an existing tile service despite the documentation suggesting otherwise?

0 Kudos
DanPatterson_Retired
MVP Emeritus

booleans shouldn't be enclosed in quotes ...  True ... by itself.  If it requires a string, it should be stated as such and would definitely be an error in the documentation. ( True != "true" != "True" )

ThomasColson
MVP Frequent Contributor

Helpful, changed it, BUT, same error: 

Service name 'GRSM_STORM_TOTAL_PRECIP_TILES' already exists for 'orgid'
Failed to execute (UploadServiceDefinition).

0 Kudos
DanPatterson_Retired
MVP Emeritus

env—ArcPy classes | Documentation 

arcpy.env.overwriteOutput = True

if it is a script and deleting that type of object is supported

0 Kudos