Pro Tool to Update Hosted Services

3518
5
04-24-2018 08:36 AM
Status: Open
JohnDye2
Occasional Contributor

Many folks don't realize this, but it's completely possible to extend, modify and update the definition of a Hosted Feature Service as well as update the schema of a Hosted Feature Layer, provided that you either:

  1. Own the Feature Service or Feature Layer in question
  2. OR are an Administrator of the Organization hosting the Feature Service or Feature Layer in question.

Hosted Feature Services

Using the Feature Service's Add to Definition endpoint, a user can:

  • Add a Layer to an existing Hosted Feature Service 

Using the Feature Service's Update Definition endpoint, a user can:

  • Enable Editor Tracking on an existing Hosted Feature Service
  • Modify Ownership Access Controls on an existing Hosted Feature Service
  • Update Hosted Feature Service Capabilities (Create, Edit, Delete, Query, Sync, Extract)
  • Update Feature Service Properties

Using the Feature Service's Delete From Definition endpoint, a user can:

  • Delete Layers from an existing Hosted Feature Service

Hosted Feature Layers

Using the Feature Layer's Add To Definition endpoint, a user can:

  • Add New Fields to the Hosted Feature Layer
  • Assign Domains to the Hosted Feature Layer
  • Add new Indexes to a Hosted Feature Layer

Using the Feature Layer's Update Definition endpoint, a user can:

  • Enable/Disable Attachments on a Feature Layer
  • Rename a Feature Layer
  • Update the Feature Layer Renderer
  • Update Feature Layer Time Information
  • Update Feature Layer properties
  • Update Feature Layer Domain and Alias
  • Rebuild Feature Layer Indexes
  • Update Multi-scale Geometry properties
  • Modify a Feature Layer's Field Names and Alias

Using the Feature Layer's Delete From Definition endpoint, a user can:

  • Delete Fields from a Feature Layer
  • Delete Indexes from a Feature Layer

Of course, to do any of these things, users must either write and validate the json and apply it directly at the the appropriate Feature Service or Feature Layer REST Endpoint, or use the ArcGIS Online/Enterprise Web UI to do so. In the case of the latter, the vast majority of this functionality is not exposed through the UI at all!

ArcGIS Pro needs to provide tool(s) that would allow a user to:

  1. Search for and select from their ArcGIS Online/Enterprise Org a Feature Service and/or Feature Layers that they own (in the case of Admins, search for and select any Feature Service and/or Feature Layer in the Org)
  2. Load the item json into an intuitive ArcGIS Pro Tool's UI
  3. Provide workflows within that tool to make all of the above changes to the Hosted Service
  4. Parse those changes into valid json
  5. Post those changes back to the appropriate REST endpoints based on the type of change being made

These capabilities are useful for allowing power users, service owners and administrators with easy and intuitive ways to effectively manage their services in an ad-hoc manner. Certainly, for bulk service management, the Python API is the more appropriate tool to use, but for one-offs Pro should provide a tool to allow users to do these things.

The REST Endpoints are already there! Pro just needs a tool that provides an elegant UI to make those changes, does some JSON parsing and submits the Post requests to make the changes

5 Comments
StevenFama

Everytime I try to update via the code, something always go wrong and nothing works.  PLEASE MAKE A TOOL to help us update.

JohnDye2

Are you checking your json first with something like JSONLint - The JSON Validator? I've never seen the endpoints not work unless it was my own fault for pushing invalid json. Nonetheless, its definitely path that is prone to error. Typically, when I need to do this, I will add the service to an ArcMap or Pro session, export it to a feature class on my system and then republish it as a Hosted Feature Layer, then test my changes on that copy before applying them to the original. Once I've done that, I delete the copy that I created. It's definitely a cumbersome workaround but until Esri provides some kind of tool for this, its the best workflow I know of.

BrunoKessler

AGOL/Portal should also provide workflows in an intuitive UI to make all of the above changes to the Hosted Service.

JohnDye2

I don't disagree and I think they're getting there under the Data Tab on the Item Details Page. I'd just also like to see the ability directly in Pro.

ErickPoundFDNY

There is a tool included with the Solutions Deployment called UpdateDomain. If ESRI would just migrate that to the mainline arcpy distribution, this would all be solved. Perhaps even to the arcgis Python API. Long overdue to get this done in my opinion.