Hi,
We are using ArcGIS Entreprise 11.1 with a federated server and we would like to automate the caching of our vector tile layers.
Our vector tile service has an associated, referenced feature service which allows the rebuild cache Rest operation:
Clicking on the "Rebuild Cache" button is working perfectly, therefore it looks like a great way to automate using this method.
We are aiming to automate the rebuild cache daily by reproducing this rest operation and we tried running the following script:
import urllib
import json
'''Retrieves a token to be used with API requests.'''
data = urllib.parse.urlencode({'username' : 'username',
'password' : 'password',
'client' : 'https://XXX/server/rest/services',
'referer': 'https://YYY/portal/sharing/rest',
'expiration': 60,
'f' : 'json'}).encode('utf-8')
response = urllib.request.urlopen('https://YYY/portal' + '/sharing/rest/generateToken',data).read().decode('utf-8')
rebuildcacheurl = 'https://XXX/server/rest/services/System/CachingControllers/GPServer/Manage%20Vector%20Tile%20Cache/submitJob?serviceName=GX_WGS84_BaseMap&serviceFolder=Hosted&tilingFormat=INDEXED&f=json&token='
token = json.loads(response)['token']
submitjob = urllib.request.urlopen(rebuildcacheurl+token).read().decode('utf-8')
We have been unsuccessful so far and we are receiving this error response:
I have been trying to find documentation but I couldn't get anything which solve our issue.
Any help would be appreciated.
Thanks a lot!