Select to view content in your preferred language

Enable Time Settings of Feature Service

1258
1
Jump to solution
03-08-2019 02:34 AM
KarstenRank
Frequent Contributor

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
Frequent Contributor

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
Frequent Contributor

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)