Upload (POST) Content on ArcEnterprise using REST API

1194
11
05-04-2022 12:15 PM
moremeowbell
New Contributor III

I have developed a script using the ArcGIS API for Python in order to add content and publish data onto ArcGIS Portal. However, I am looking for a methodology to move this data through a REST API instead. The only information I can find on accomplishing this task is here: https://developers.arcgis.com/rest/services-reference/enterprise/upload.htm. The example that ESRI provides simply shows how to use a UI for the Upload of data. How can this be accomplished on the "backend" using Python? Could someone point me towards to scripting documentation or share a sample script?

0 Kudos
11 Replies
Brian_Wilson
Occasional Contributor III

My expectations for documentation on the API have been dashed.

Please, @moremeowbell tell me exactly what you are trying to do. 

The Upload operation appears to add content to an existing service. I am still uncertain, because nowhere in the description does it actually say what happens.

When I publish a hosted service (or overwrite one) with the Python API, I create a file that describes the service and contains the data. Then I push it up to the server and the server publishes it. That's the workflow I have right now, it sometimes works.  I am thinking of walking through the Python in a debugger to see what calls it makes when I run these commands. No hope for building the SD file because it's hooked into ArcPro but I might be able to see what happens in the ArcGIS Python API part.

My server is currently partially broken (5 days now, Esri is theoretically working on it but they have gone dark on me so I am losing hope now.) so I can't be 100% sure if I am encountering normal bugs or brokenness.

 

0 Kudos
moremeowbell
New Contributor III

@Brian_Wilson I am attempting to create a workflow around the Upload function. I'm just not sure how to call it in my script. For example, I am familiar with the "add content" and then "publish" workflow, but would like to see if this can be accomplished using the Upload function instead. For the "add content" workflow the function is called by <gis.content.add>, what is the syntax for Uploading? My ultimate goal is to be able to call this function and use it to Upload data in parts (I have a lot of big datasets).

0 Kudos