Select to view content in your preferred language

How to overwrite existing Voxel Scene Layer (.slpk) with the same service name via Python automation?

93
0
Friday
Labels (2)
文瑞蘇
Emerging Contributor

I'm currently developing an automated workflow using Python and ArcGIS Pro 3.5 to generate and publish a Voxel Scene Layer (.slpk) to our ArcGIS Enterprise Portal. The workflow runs every 10 minutes, and the data content is dynamic (radar-based voxel data). Our goal is to keep the service name fixed as radar, so that other downstream apps and dashboards depending on this service don’t break or require updates.

Here's what I've tried:


What I'm currently doing:

  1. Update .lyrx file content (e.g., maxLabel, colorRangeMax)

  2. Use arcpy.CreateVoxelSceneLayerContent_management() to generate a new .slpk

  3. Attempt to overwrite the existing Portal item named radar


 Issues encountered:

1. SharePackage() fails with naming conflict:

ERROR 001398: Service name 'radar4D' already exists.

Because SharePackage() doesn’t support overwriting, and simply fails if the service name already exists—even after deleting the Portal item via gis.content.search().delete().

2. Tried using arcpy.sharing.CreateSharingDraft(), but this returns None when used with .slpk:

from arcpy import sharing sharing_draft = sharing.CreateSharingDraft("HOSTING_SERVER", "SCENE_SERVICE", "radar4D", slpk_path) # --> returns NoneType, so attributes like .portalFolder raise AttributeError

3. Tried UploadServiceDefinition_server() with .sd, but it's unclear how to generate an .sd from .slpk.


 My goal:

I simply want to automatically overwrite an existing Voxel Scene Layer every 10 minutes, with updated .slpk content, using Python. No change in URL or service name.

Is there any supported method to:

  • Overwrite a hosted Scene Layer (from .slpk) via Python or arcpy?

  • Delete the existing service cleanly (not just the Portal item) so SharePackage() can reuse the same name?

  • Or any alternative method (e.g., REST API, Service Definition workflows) that works with voxel .slpk?


Environment:

  • ArcGIS Pro 3.5 (licensed)

  • arcpy 3.5

  • Python script running in scheduled job

  • ArcGIS Enterprise Portal (10.9.1)

  • Logged in via arcpy.SignInToPortal(...)


Any help, examples, or official recommendations would be greatly appreciated!

Thank you in advance 

Tags (2)
0 Kudos
0 Replies