Is it possible to change the Max Record Count on an portal ArcGIS hosted Feature service?

1782
5
Jump to solution
11-07-2016 02:42 AM
mansimittal1
New Contributor II

We can modify the MaxRecordCount of published feature layer on arcgis server using the code mentioned on the following url:

http://server.arcgis.com/en/server/latest/administer/linux/example-edit-service-properties.htm

Can we use the same code to modify feature count of feature layer published on portal ArcGIS?

0 Kudos
1 Solution

Accepted Solutions
JonathanQuinn
Esri Frequent Contributor

No, arcpy doesn't have any modules to send http/https requests.  You'll have to use urllib, urllib2 and JSON.  Get the JSON of the service through the Admin API, update the property, and then pass the updated JSON to the /edit endpoint to edit the service.  Here's a sample to get you started.  I just noticed that there are two maxRecordCount values, one for the layer and one seemingly for the whole service, I'll see which what happens when either is updated.

View solution in original post

5 Replies
JonathanQuinn
Esri Frequent Contributor

You should be able to update it through the Server Admin API:

mansimittal1
New Contributor II

I want to edit it through arcpy. is it possible to edit through arcpy ?

0 Kudos
JonathanQuinn
Esri Frequent Contributor

No, arcpy doesn't have any modules to send http/https requests.  You'll have to use urllib, urllib2 and JSON.  Get the JSON of the service through the Admin API, update the property, and then pass the updated JSON to the /edit endpoint to edit the service.  Here's a sample to get you started.  I just noticed that there are two maxRecordCount values, one for the layer and one seemingly for the whole service, I'll see which what happens when either is updated.

mansimittal1
New Contributor II

Okay.I tried this code and the error it gave me was unable to start the service.By any chance this error could occur due to providing wrong parameters of the published service?

0 Kudos
mansimittal1
New Contributor II

The link to the code you gave worked.Before I was giving one wrong parameter that's why code was not working. Thanks!

0 Kudos