I couldn’t figure out if there are a tool or a way to count the number of allocated max\min instances for all published services. See below
Best Regards,
Rawan
Solved! Go to Solution.
Good Morning Rawan,
Check and download the attached python file and try to run it.
No need to spend time on format this code.
https://community.esri.com/docs/DOC-9922-arcgis-server-map-service-properties
You can look into writing a python script to get the "minInstancesPerNode" and "maxInstancesPerNode" properties from the Admin API:
https://<server>.<domain>.com:6443/arcgis/admin/services/SampleWorldCities.MapServer?f=pjson
Dear Jonthan,
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.
Best Regards,
Rawan
You're at the Rest API, not the Admin API:
https://<server>.<domain>.com:6443/arcgis/admin/services/SampleWorldCities.MapServer?f=pjson
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.
Dear Jonathan,
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.
Dear Jonathan,
I could be noisy, but when I tried to login in Generate token to write the python it gives me the following error.
What could be the reason for that.
Best,
Rawan
That's not an error, that's the token. You can append the token to requests to the Admin API to authenticate.
Dear Jonathan,
Thank you for your reply, but I struggling with the begin.
I ‘m not sure from where I can add my code to get my information.
Any advice?
Best,
Rawan