Publishing tool set does not work as expected, when UPLOADS option is set

392
3
Jump to solution
02-28-2024 01:43 AM
Cristian_Galindo
Occasional Contributor III

It is intended to publish a geoprocessing tool to an standalone ArcGIS Server version 11, as it is required to enable the UPLOADS task in the service, and following the documentation:
https://pro.arcgis.com/en/pro-app/3.1/arcpy/sharing/geoprocessingsharingdraft-class.htm
the arcpy.sharing module is intended to be used in order to create the draft and then proceed to publish (as stated in the Code Sample in the documentation above
This is the code used :

server_type = "STANDALONE_SERVER"
service_type = "GP_SERVICE"
if ags_portal is not None and ags_portal != "":
    server_type = "FEDERATED_SERVER"
    service_type = "WEB_TOOL"

draft_creator = arcpy.sharing.CreateSharingDraft(server_type, service_type,name,result)
draft_creator.summary = "NIMA version: {0} {1}".format(release_version, dt.now().strftime("%Y%m%d%H%M"))
draft_creator.targetServer = ags_file
draft_creator.tags = "NIMA"
draft_creator.offline = False
draft_creator.offlineTarget = "11"
draft_creator.overwriteExistingService = True
draft_creator.copyDataToServer = False
draft_creator.executionType = "Asynchronous"
draft_creator.serverFolder = folder_name
if ags_portal is not None and ags_portal != "":
    draft_creator.portalFolder = folder_name
draft_creator.maximumRecords = 1000
draft_creator.minInstances = 0
draft_creator.maxInstances = 2
draft_creator.maxUsageTime = 72000
draft_creator.maxWaitTime = 60,
draft_creator.maxIdleTime = 1
draft_creator.resultMapServer = False,
draft_creator.messageLevel = "Info",
if service_names[name][2]:
    draft_creator.capabilities = "UPLOADS"

draft_creator.exportToSDDraft(sd_draft)
log.add("Created service definition draft file")

arcpy.server.StageService(sd_draft, sd)
log.add("Created service definition file from draft")

# Upload the service
arcpy.server.UploadServiceDefinition(sd, ags_file)


When the process finish, the upload capability is not enable (please see attached image):

ErrorUploadConfiguration.jpg
According to the documentation:
capabilities

(Read and Write)

The capabilities a service can support. The default value is None.

  • UPLOADS—The client can upload related operations and resources.
  • None—No capabilities need to be set. This is the default.

it should be enough.

0 Kudos
1 Solution

Accepted Solutions
Cristian_Galindo
Occasional Contributor III

After checking the REST Service, the upload capability has been activated all the time.

there is a nice little bug in ArcGIS Server:

BUG-000126447

Uploads checkbox in Operation Allowed remains unchecked on Server Manager when the Uploads capability is enabled in a geoprocessing service.

 

View solution in original post

0 Kudos
3 Replies
ChrisUnderwood
Esri Contributor

Hello @Cristian_Galindo , it looks like the Capabilities will only be set to Uploads when the IF statement evaluates to True. Are you sure your IF statement is working as you intend ?

if service_names[name][2]:
    draft_creator.capabilities = "UPLOADS"

 

0 Kudos
Cristian_Galindo
Occasional Contributor III

Hi @ChrisUnderwood 

when debugging several times prior to post my question, the line that sets the capabilities, always was hit.

Cheers.

0 Kudos
Cristian_Galindo
Occasional Contributor III

After checking the REST Service, the upload capability has been activated all the time.

there is a nice little bug in ArcGIS Server:

BUG-000126447

Uploads checkbox in Operation Allowed remains unchecked on Server Manager when the Uploads capability is enabled in a geoprocessing service.

 

0 Kudos