Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EnterpriseVectorTileLayerManager.edit() needs wrapped with a .start() .stop() for exportTiles=True to work #1889

Open
ohughes16 opened this issue Aug 7, 2024 · 0 comments
Assignees

Comments

@ohughes16
Copy link

Describe the bug
I am updating a vector tile layer with arcpy.server.ReplaceWebLayer and needing to ensure exportTiles=True, for offline capabilities to persist. After updating the service definition, the service needs to be stopped before the .edit() call and then started again after. Although the service shows exportTiles=True, Field maps errors saying that exportTiles is not equal to true unless you stop and start the service after editing the service definition with .edit().

To Reproduce
Steps to reproduce the behavior:

serviceDefinition = {
            "serviceName": SERVICENAME,
            "type": "VectorTileServer",
            "description": "",
            "capabilities": "TilesOnly,Tilemap",
            "provider": "ArcObjects11",
            "clusterName": "default",
            "minInstancesPerNode": 0,
            "maxInstancesPerNode": 0,
            "instancesPerContainer": 1,
            "maxWaitTime": 60,
            "maxStartupTime": 300,
            "maxIdleTime": 1800,
            "maxUsageTime": 600,
            "loadBalancing": "ROUND_ROBIN",
            "isolationLevel": "HIGH",
            "configuredState": "STARTED",
            "recycleInterval": 24,
            "recycleStartTime": "00:00",
            "keepAliveInterval": 1800,
            "private": "false",
            "isDefault": "false",
            "maxUploadFileSize": 0,
            "allowedUploadFileTypes": "",
            "properties": {
                "outputDir": outputDir,
                "cacheDir": cacheDir,
                "maxScale": "0",
                "maxRecordCount": "1000",
                "clientCachingAllowed": "true",
                "antialiasingMode": "None",
                "textAntialiasingMode": "Force",
                "isCached": "true",
                "virtualOutputDir": "/rest/directories/arcgisoutput",
                "maxExportTilesCount": "100000",
                "exportTilesAllowed": "true",
                "maxLOD": "15",
                "minLOD": "0",
                "maxBufferCount": "100",
                "virtualCacheDir": "/rest/directories/arcgiscache",
                "minScale": "0",
            },
            "portalProperties": {
                "isHosted": "true",
                "portalItems": [{"itemID": itemid, "type": "VectorTileServer"}],
            },
            "extensions": [],
            "frameworkProperties": {},
            "datasets": [],
        }
 vector_layer_item = gis.content.get(itemid)
 vector_tile_layer = VectorTileLayer.fromitem(vector_layer_item)

vtl_manager = vector_tile_layer.manager
vtl_manager.edit(service_dictionairy=serviceDefinition)

error:
No error, everything appears successful with the code, but when you go to create an offline area in Field Maps, it tells you that exportTiles is not enabled.
Adding a .stop() before .edit() and a .start() after .edit() allows tiles to be successfully taken offline.

Expected behavior
Documentation saying that you need .edit() to be wrapped with start/stop would be nice. Or if .edit() worked alone that would also be nice.

Platform (please complete the following information):

  • OS: Windows 2012
  • Browser: Edge
  • Python API Version: 2.0.0

Additional context
Earlier in the script we are updating the Vector Tile Layer using arcpy.server.ReplaceWebLayer() if that matters in replicating this issue.

@ohughes16 ohughes16 added the bug label Aug 7, 2024
@nanaeaubry nanaeaubry added enhancement and removed bug labels Aug 9, 2024
@nanaeaubry nanaeaubry self-assigned this Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants