Is it possible to modify the url of an ArcGIS Server item?

822
3
Jump to solution
04-24-2013 04:03 AM
JadeFreeman
Occasional Contributor III
We have a number of layers that are fairly complex and have popups configured on many layers.  The move from 10.0 to 10.1 necessitated setting up a new server in our organization and publishing all of our existing services to the new server so that our existing applications could continue to work off the old services while we deployed the new services. 

I am really, really hoping there will be a way to update the url for all of our items which point to our 10.0 server and point them to our new 10.1 server.  Otherwise, it'll be many, many hours involved to rebuild all of our popups.

We are also in the midst of a complete re-organization so even if we had been able to update our server in place, we would have eventually needed to change the url's.

Thanks in advance!
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MikeMinami
Esri Notable Contributor
There is no out-of-the-box way to change the URL to layers and as you've found, you have to go through the API. In your case, the schema of your layers didn't change so your popups still work. If we did this, people would expect that it would be robust and account for all potential changes. So, we've not ventured here because it's a hard problem to solve. When you update the item, make sure you keep all other metadata about it. You definitely don't want to corrupt your map.

Mike

View solution in original post

0 Kudos
3 Replies
JadeFreeman
Occasional Contributor III
With a little reverse engineering of the AGOL REST API and looking at the docs (http://www.arcgis.com/apidocs/rest/), it seems there is a REST endpoint that accepts POST submissions.  You can pass in properties to update such as url, tags etc. You can even update the username and password for secured services.

I built a simple html form to send the update and it appears to work without losing the popup information.  The trick is finding the id of the folder you have the layer in.  Here is the rest endpoint format:

http://www.arcgis.com/sharing/content/users/<username>/<owner folder id>/items/<item id>/update

While this appears to work, and I have tested updating the url and service username/password, I can't believe there is not a more 'official' way to do this.  On the service edit page, it seems like there should be an option for updating the url.  If the service is secure, you can update the username/password. 

I realize there are probably a lot of potential problems (i.e. what happens if you change the structure of the service by adding/removing layers etc.) but it would be handy when you know the service has not changed, just the location, to be able to quickly update.
0 Kudos
MikeMinami
Esri Notable Contributor
There is no out-of-the-box way to change the URL to layers and as you've found, you have to go through the API. In your case, the schema of your layers didn't change so your popups still work. If we did this, people would expect that it would be robust and account for all potential changes. So, we've not ventured here because it's a hard problem to solve. When you update the item, make sure you keep all other metadata about it. You definitely don't want to corrupt your map.

Mike
0 Kudos
JadeFreeman
Occasional Contributor III
Thanks Mike,

I agree, it would be difficult to manage customer expectations and functionality.  Perhaps straightforward documentation on how to do more advanced management functions could be added to the online help?  Maybe an 'Advanced Resource Management' section? From digging thru the API, it's quite appears quite robust and putting together a resource center with a few samples would be really helpful.

For now, I think I know where to go from here.  I got tired of trying to code popups by handcrafting json documents so I've been using the AGOL tools to put applications together and then extracting the json document needed for our mobile content server thru some FME workbenches.  I'll take a similar approach here to build some functionality to update resource urls.

Cheers!

Jade
0 Kudos