Updating AGO Hosted Feature Services with Python

1978
2
05-22-2014 08:29 AM
DanielSenner
New Contributor II
Hello, we are currently using the python script below to update services in ArcGIS online. The issue we are having is when it runs it removes the thumbnail and description I populate. I was wondering if it is possible for the thumbnail and the description not to be removed when it runs? Any help on this would be appreciated.

http://blogs.esri.com/esri/arcgis/20...s-with-python/

Thanks
Dan Senner
Tags (2)
0 Kudos
2 Replies
KevinHibma
Esri Regular Contributor
Your link got garbled, so I'm not sure if you're pointing to the first or 2nd version of the blog.
In the 2nd version of the blog, you can enter a description into the INI file.
http://blogs.esri.com/esri/arcgis/2014/01/24/updating-your-hosted-feature-service-for-10-2/

As for the thumbnail, I see its part of the item common parameters: http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#//02r30000009v000000
That said, you could enhance the script to upload a thumbnail when uploading the SD.
You could go as far as generating a new thumbnail everytime you run the script (from the MXD). There is an arcpy command: http://resources.arcgis.com/en/help/main/10.1/index.html#//00s30000000n000000 or some code examples in this Q&A: http://mappingcenter.esri.com/index.cfm?fa=ask.answers&q=1504
0 Kudos
AdrienLepoutre
New Contributor III

Hello Kevin,

Thank you for creating that blog. 

I read your blog post and wrote a script based on it. I am currently coming across an issue and thought I would share it as you seem to have some experience in the domain.

I am trying to update the title of an item in open data, considering it is encased in a process with a script similar to yours (.aprx -> service definition -> hosted feature layer in AGOL).

 

Based on your expertise, do you think renaming the feature service might be the best solution?

 

Here is my post on geonet:

https://community.esri.com/message/928224-updating-title-of-hosted-feature-layer-getting-updated-via...

 

I’ve also opened a case but the analyst suggested renaming the service but I have not been able to find these functionalities on the admin REST for AGOL.

I saw you had created a tool to rename services (I assume using the REST api). I was wondering if I could possibly use it on my service in AGOL?

I’ve also tried https://developers.arcgis.com/rest/services-reference/update-definition-feature-service-.htm to no avail.

0 Kudos