I'm a little confused on what to put in the JSON file. Say I just want to have just the Query capability on the Feature service, how do I do that?
There is an "extensions" array which contains an object with a typeName == "FeatureServer". One of the object's properties is capabilities. You can add in the "Query" string to enable the capability. The structure looks something like the below:
{"extentions": [ ... ,{
"typeName": "FeatureServer",
"capabilities": "Query",
"enabled": "true",
"maxUploadFileSize": 0,
"allowedUploadFileTypes": "",
"properties": {...}}
... ]
}
In the JSON file, do I just copy the entire map service's JSON ( from sever manager) and edit the Feature Service capabilities section?
Yes, I believe so. The JSON file should be an updated copy of the service properties found at the edit service url. Be sure to leave a copy of the original if you want to revert your changes.
It might also be a good idea to create a service which has Query/Edit capability enabled and see the differences before posting the changes. The ESRI admin enterprise notes are detailed but are human readable.
Also note, I may have been incorrect with the payload variable. If the server returns a parameter-like error (i am guessing), try using json.dumps for the service parameter.
payload = {
'f': 'json',
'service':json.dumps(service_json),
'token':token
}