Good Morning Rawan,
Check and download the attached python file and try to run it.
No need to spend time on format this code.
You can look into writing a python script to get the "minInstancesPerNode" and "maxInstancesPerNode" properties from the Admin API:
Thanks for you reply,I need this to be applied on all services.
How could I add a python script to get the "minInstancesPerNode" and "maxInstancesPerNode" properties from the Admin API:?
I opened this link, and logins as admin but I couldn’t made any changes, maybe I misunderstand this point.
You're at the Rest API, not the Admin API:
The bolded section is the URL to the Admin API. Log in with administrative credentials to make changes.
I would start with looking at the overview of scripting administration of your Server, and the specific examples of editing service properties and checking a folder for stopped services for pieces of code you can use.
Have you been able to review the samples I mentioned, specifically checking a folder for stopped services?
# Loop through each service in the folder and stop or start it for item in dataObj['services']: fullSvcName = item['serviceName'] + "." + item['type'] # Construct URL to stop or start service, then make the request statusURL = "/arcgis/admin/services/" + folder + fullSvcName + "/status"
The section above is where it will loop through every service, construct the URL to the service, and check the status. You'll want to modify that to grab the JSON of the service, loop through the key:value pairs to find the keys you need, and return them by printing them or writing them to a file.