Enable Time Settings of Feature Service

377
1
Jump to solution
03-08-2019 02:34 AM
KarstenRank
Occasional Contributor III

Hi there,

is it possible to enable to the "Time Settings" of a Feature Service with the Python API?

Thanks for your help

Karsten

1 Solution

Accepted Solutions
KarstenRank
Occasional Contributor III

Find the solution:

  • first create a token
  • updateServiceDef

def updateServiceDef(token):
    ''' use this to update feature service max record count '''
    updateServiceDefURL = 'https://services2.arcgis.com/.../ArcGIS/rest/admin/services/.../FeatureServer/0/updateDefinition'
    params = {
      'updateDefinition': {"timeInfo" : {"startTimeField" : "DateTimeField1", "endTimeField" : "DateTimeField2"}},
        'async': 'true',
      'token': token,
      'f':'json'
    }
    response = requests.post(updateServiceDefURL, data=params, verify=True)

View solution in original post

1 Reply
KarstenRank
Occasional Contributor III

Find the solution:

  • first create a token
  • updateServiceDef

def updateServiceDef(token):
    ''' use this to update feature service max record count '''
    updateServiceDefURL = 'https://services2.arcgis.com/.../ArcGIS/rest/admin/services/.../FeatureServer/0/updateDefinition'
    params = {
      'updateDefinition': {"timeInfo" : {"startTimeField" : "DateTimeField1", "endTimeField" : "DateTimeField2"}},
        'async': 'true',
      'token': token,
      'f':'json'
    }
    response = requests.post(updateServiceDefURL, data=params, verify=True)

View solution in original post