|
POST
|
Thanks I will look into this. Sounds like I will need to use a Python Toolbox over a Script Tool.
... View more
10-27-2021
07:58 AM
|
0
|
2
|
4669
|
|
POST
|
I have a python script that will edit all map service capabilities for all services on a federated GIS Server. The script will print out a list of GIS Servers in a federated Enterprise environment > prompt the user to input an integer associated with the index of which GIS Server they want to operate on > all map services are updated on that server. I am trying to convert this to a script tool in ArcGIS Pro. My script requires the user to input a value after it prints the list of GIS Servers, so it knows which server to run the remaining script on. Is this possible using a script tool? If so, how can I do this?
... View more
10-26-2021
12:25 PM
|
0
|
11
|
5526
|
|
POST
|
Did you ever get this resolved? I'm running into a similar issue.
... View more
10-21-2021
07:00 AM
|
0
|
0
|
4765
|
|
POST
|
Found the solution, for anyone who may run into this. It was a bug in my code. The string that I'm passing for the Capabilities cannot contain spaces. So, rather than 'Extract, Delete, Update' it needs to be 'Extract,Delete,Update' Long story short is that my JSON I was trying to post was formatted incorrectly. So the the GIS Server was only taking the first capability (in my case, Extract).
... View more
10-13-2021
08:34 AM
|
0
|
0
|
2122
|
|
POST
|
Running ArcGIS Enterprise 1081. I have a python script that loops through a folder in Server Manager and updates the Capabilities for a Feature Server to 'Extract, Delete, Update'. The script runs successfully and my REST API POST request works fine. My issue is that Server Manager only shows Extract as a capability while the JSON representation shows the update with all three capabilities. These appear to be out of sync... Server Manager I am finding the JSON representation from the Server Admin directory. https://test.com/arcgis/admin/services/testFolder/TestService.MapServer?f=json Has anyone seen this before? Any ideas and what I need to do to fix this?
... View more
10-13-2021
06:08 AM
|
0
|
1
|
2174
|
|
POST
|
@LongDinh unfortunately, same issue BUT I was able to figure this out using a slightly different method from this example. I converted this to python 3 and replaced the httplib/urllib pieces with the functions from the 'request' library for python 3 and everything is worked as expected. Including the payload as you described initially was key to get this working. I can now loop through a folder on my GIS Server and update properties/capabilities for all services in the folder. Big thank you for your help again.
... View more
10-07-2021
04:41 PM
|
2
|
2
|
3284
|
|
POST
|
Yes good catch, I missed that. Unfortunately I still get the same error
... View more
10-06-2021
01:30 PM
|
0
|
1
|
3293
|
|
POST
|
Hi @LongDinh For some reason, my script is throwing an error when submitting the POST. I am building the JSON file programmatically (since I have 100's of services), but my code sees the JSON file as invalid. {'status': 'error', 'messages': ["A JSONObject text must begin with '{' at character 1 The JSON file is does start with the { I have validated it using an online editor I can copy the JSON from the file and submit it through the MapServer/edit endpoint and it is successful. Any ideas why I cant POST the JSON file?
... View more
10-05-2021
09:23 AM
|
0
|
3
|
3303
|
|
POST
|
It worked like a charm, no errors. Thank you very much! Next goal is to apply this workflow to over 100 services in a folder on Server Manager so I can make the same edits to every service within that folder. Thank you again for your help thus far.
... View more
09-29-2021
05:38 PM
|
1
|
0
|
3314
|
|
POST
|
I am getting this message when I run my script. But the feature service service is not updating. Any ideas? # <bound method Response.json of <Response [200]>
... View more
09-29-2021
12:32 PM
|
0
|
6
|
6271
|
|
POST
|
Thanks for the reply. I dont think this will work for us me as I have several hundreds of layers to publish as individual services. Setting up the service definition file for each one is not feasible. The bulk publishing doc I referenced is a good solution to publish these quickly, but I just need a way to update the feature service properties once the services are published. They are all 'registered' services pulling from a SDE database so unfortunately using the update_definition() function outlined here doesnt work. Service definitions | ArcGIS Developer
... View more
09-24-2021
06:00 PM
|
1
|
0
|
6341
|
|
POST
|
Other than making the app, map, and services public no. Depending on what you're doing, I've seen folks use a proxy file on a websever to bypass the login. Proxy pages with the API | ArcGIS API for JavaScript
... View more
09-24-2021
05:52 PM
|
0
|
0
|
9178
|
|
POST
|
I think I'm getting there. Still very new to python and programming in general so I appreciate the help. 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? In the JSON file, do I just copy the entire map service's JSON ( from sever manager) and edit the Feature Service capabilities section? Here is my code overall: import requests import os import json import ssl ssl._create_default_https_context = ssl._create_unverified_context # Get token from /arcgis/sharing/rest/generateToken token = "####" service_name="TestService" folder_name="TestFolder" domain="######################" edit_service_url = f"https://{domain}/arcgis/admin/services/{folder_name}/{service_name}.MapServer/edit" print (edit_service_url) base_dir = r"C:\Test" json_file = os.path.join(base_dir, r"myServicePropertiesX.json") from os.path import exists file_exists = exists(json_file) print (file_exists) with open(json_file) as jf: service_json=json.load(jf) payload = { 'f': 'json', 'service':service_json, 'token':token } response = requests.post( edit_service_url, data=payload ) print(response.json)
... View more
09-24-2021
10:01 AM
|
0
|
9
|
6347
|
|
POST
|
Unfortunately no. Here is my original problem that prompted this question. We were trying to generate a token to authenticate into a Web AppBuilder app. This did not work without using OAuth instead of generate token. Maybe this might help: Re: WebApp Builder on IIS - Login only works with ... - Esri Community
... View more
09-24-2021
06:50 AM
|
0
|
2
|
9186
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 07-16-2022 08:54 AM | |
| 1 | 11-09-2021 04:14 PM | |
| 1 | 04-13-2022 08:10 AM | |
| 1 | 11-13-2024 05:02 PM | |
| 1 | 05-06-2021 06:48 PM |
| Online Status |
Offline
|
| Date Last Visited |
03-14-2026
09:17 PM
|