POST
|
I wrote code that does something similar, it updates the feature service capabilities. You might be able to adapt it to your needs. from arcgis import GIS
import requests
import json
domain = 'gis.domain.org'
folder = 'MyServerFolder'
# login to GIS
gis = GIS(url="https://gis.domain.org/portal/home", profile='sangis_portal_aiteadmin')
token = gis._con.token
# Get a list of services from ArcGIS Server
# from a specific folder
gis_servers = gis.admin.servers.list()
print(gis_servers)
# Assuming a single server for simplicity
server1 = gis_servers[0]
damoa_services = server1.services.list(folder=folder)
for service in damoa_services:
# Get the service definition
service_def = requests.get(f'{service.url}?f=json&token={token}').json()
service_name = service_def['serviceName']
# Loop through the service extensions to find the FeatureServer extension
i=0
for ect in service_def['extensions']:
if ect['typeName'] == 'FeatureServer':
print("Enabling Feature Access capabilities...")
print(f"original capabilities: {service_def['extensions'][i]['capabilities']}")
# Update capabilities by editing the service definition
service_def['extensions'][i]['capabilities'] = "Query,Extract"
print(f"Updated capabilities: {service_def['extensions'][i]['capabilities']}")
# Construct the URL for editing the service definition
# This URL is specific to ArcGIS Server REST API
edit_service_url = f"https://{domain}/arcgis/admin/services/{folder}/{service_name}.MapServer/edit"
try:
payload = {
'f': 'json',
'service':json.dumps(service_def),
'token':token
}
# Make the POST request to update the service definition
response = requests.post(url=edit_service_url, data=payload)
# Check if the request was successful
# This doesn't work, 200 is returned even if the update fails
# Check the responce conteent instead
if response.status_code == 200:
print("Capabilities updated successfully.")
else:
print(f"Failed to update capabilities: {response.text}")
except requests.exceptions.RequestException as e:
raise e
i=0
break
else:
i += 1
... View more
08-06-2025
03:22 PM
|
0
|
0
|
103
|
POST
|
This seems to still be an issue in 2025, you can't use the ArcGIS python API to modify referenced feature services, or at least I couldn't get it working. Here some code I wrote to use the ArcGIS Server admin rest endpoint instead. It updates the capability of all feature services in a folder to add Extract to the default Query capability. Hope it helps someone. from arcgis import GIS
import requests
import json
domain = 'gis.domain.org'
folder = 'MyServerFolder'
# login to GIS
gis = GIS(url="https://gis.domain.org/portal/home", profile='sangis_portal_aiteadmin')
token = gis._con.token
# Get a list of services from ArcGIS Server
# from a specific folder
gis_servers = gis.admin.servers.list()
print(gis_servers)
# Assuming a single server for simplicity
server1 = gis_servers[0]
damoa_services = server1.services.list(folder=folder)
for service in damoa_services:
# Get the service definition
service_def = requests.get(f'{service.url}?f=json&token={token}').json()
service_name = service_def['serviceName']
# Loop through the service extensions to find the FeatureServer extension
i=0
for ect in service_def['extensions']:
if ect['typeName'] == 'FeatureServer':
print("Enabling Feature Access capabilities...")
print(f"original capabilities: {service_def['extensions'][i]['capabilities']}")
# Update capabilities by editing the service definition
service_def['extensions'][i]['capabilities'] = "Query,Extract"
print(f"Updated capabilities: {service_def['extensions'][i]['capabilities']}")
# Construct the URL for editing the service definition
# This URL is specific to ArcGIS Server REST API
edit_service_url = f"https://{domain}/arcgis/admin/services/{folder}/{service_name}.MapServer/edit"
try:
payload = {
'f': 'json',
'service':json.dumps(service_def),
'token':token
}
# Make the POST request to update the service definition
response = requests.post(url=edit_service_url, data=payload)
# Check if the request was successful
# This doesn't work, 200 is returned even if the update fails
# Check the responce conteent instead
if response.status_code == 200:
print("Capabilities updated successfully.")
else:
print(f"Failed to update capabilities: {response.text}")
except requests.exceptions.RequestException as e:
raise e
i=0
break
else:
i += 1
... View more
08-06-2025
03:19 PM
|
0
|
0
|
62
|
POST
|
Well that's concerning. My script might work in your case. This is typical output that a API returns for feed..metrics.items() If you know there should be features moving through the analytic and all your featurerate values are 0 then you could generate an alert. In our case featurerate= 0 is the norm that we expect. ('itemId', 'edfgdsfg')
('timeInterval', '300s')
('percentCompute', 0.0)
('totalAvgRateIn', 0.0)
('totalAvgRateOut', 0.0)
('feeds', [{'nodeId': 'hdfggrdsfgfr', 'label': 'Genasys Active Evac Areas Dev', 'featureRate': 0.0, 'attributeRate': 0.0, 'featureRateNoGeometry': 0.0, 'featureRateNoTime': 0.0, 'errorCount': 0}])
0
('sources', [])
('tools', [
{'nodeId': '-1e87-ecb5-c3e9-f9484f14b247', 'label': 'Project-1', 'featureRate': 0.0, 'attributeRate': 0.0, 'featureRateNoGeometry': 0.0, 'featureRateNoTime': 0.0, 'errorCount': 0},
{'nodeId': '-558e-c7c8-9311-93bf27091588', 'label': 'Map Fields', 'featureRate': 0.0, 'attributeRate': 0.0, 'featureRateNoGeometry': 0.0, 'featureRateNoTime': 0.0, 'errorCount': 0},
{'nodeId': '-257b-203b-ac1e-f78e57f5064e', 'label': 'Project-1-2', 'featureRate': 0.0, 'attributeRate': 0.0, 'featureRateNoGeometry': 0.0, 'featureRateNoTime': 0.0, 'errorCount': 0},
{'nodeId': '-ff40-385f-eca7-7d8e6e0d272b', 'label': 'Map Fields-1', 'featureRate': 0.0, 'attributeRate': 0.0, 'featureRateNoGeometry': 0.0, 'featureRateNoTime': 0.0, 'errorCount': 0},
{'nodeId': '-12fe-4699-2497-5bc88d67975b', 'label': 'Merge', 'featureRate': 0.0, 'attributeRate': 0.0, 'featureRateNoGeometry': 0.0, 'featureRateNoTime': 0.0, 'errorCount': 0},
{'nodeId': '-4c00-e950-9d37-0668eae0c625', 'label': 'Detect Gaps', 'featureRate': 0.0, 'attributeRate': 0.0, 'featureRateNoGeometry': 0.0, 'featureRateNoTime': 0.0, 'errorCount': 0},
{'nodeId': '-fbc2-81a6-6fed-73256600be3a', 'label': 'Calculate Field', 'featureRate': 0.0, 'attributeRate': 0.0, 'featureRateNoGeometry': 0.0, 'featureRateNoTime': 0.0, 'errorCount': 0}
])
... View more
07-29-2025
10:45 AM
|
1
|
0
|
49
|
POST
|
I can think of a couple of ways of doing it with different pros and cons Publish the individual parcel fabric feature classes to your portal as a read only feature service. In the source project remove the fields you don't want to be public and filter out the historic features for each feature class. Don't add the fabric layer, just the parcel types. Create a database level view of the sde.default version and publish that as a feature service. Create a process that copies the sde.default version from your edit database to a read only FGDB or EGDB and publish from there. No.1 is the easiest but it can slow editing performance if the public web service is heavily used. No.2 can also slow editing performance but it allows integration with 3rd party, non Esri clients such as SSRS or Asset Management systems. Also the performance of the published service might be slower. No.3 requires some script or other process to be designed and scheduled. Data in the read only copy is only as current as the last time the script ran. But it won't affect editing performance and can be integrated with 3rd party apps. Here is some SQL to create a view of a branch versioned feature class that is part of a parcel fabric, No.2 above CREATE view [t].[taxparcels_bVW] as
SELECT
a.*
FROM
t.TAXPARCELS a
-- Start branch versioning magic
WHERE a.GDB_ARCHIVE_OID IN (
SELECT GDB_ARCHIVE_OID
FROM
(
SELECT
GDB_ARCHIVE_OID,
ROW_NUMBER() OVER( PARTITION BY OBJECTID ORDER BY GDB_FROM_DATE DESC ) AS rn_,
GDB_IS_DELETE
FROM t.TAXPARCELS
WHERE GDB_BRANCH_ID IN (0)
AND GDB_FROM_DATE <= GETUTCDATE()
-- AND OBJECTID IN (
-- SELECT OBJECTID
-- FROM t.TAXPARCELS
--WHERE (RetiredByRecord IS NULL)
-- )
) AS br__
WHERE
br__.rn_ = 1
AND br__.GDB_IS_DELETE = 0
)
-- End branch versioning magic
-- Filter from sub result set
AND RetiredByRecord IS NULL
AND IsSeed <> 1
GO *Edit - Some useful links https://community.esri.com/t5/arcgis-parcel-fabric-documents/query-branch-versioned-parcels/ta-p/1057269 https://github.com/Esri/developer-support/tree/master/arcsde-sql/sql-server/branch-versioning
... View more
07-17-2025
03:33 PM
|
1
|
0
|
130
|
POST
|
If you are trying to automate this then I can think of 2 ways of doing it: Attribute rules. You could write a rule to use the Arcade Centroid function to write points to a feature class when a polygon is created and copy the "created by record" value. You would also have to write additional rules to handle parcel changes such as being marked retired. Handeling splits and merges can be tricky. You could create a python batch job that runs every night that creates and updates points based on the Parcel feature class.
... View more
07-10-2025
10:30 AM
|
1
|
0
|
143
|
POST
|
As test I tried to use the python api to stop a non functioning feed but that doesn't work either. The api reports the the feed is started. I call feed.stop() and the result is true but feed.status still reports 'started'.
... View more
06-30-2025
12:07 PM
|
1
|
0
|
132
|
POST
|
@JeffEismanGIS Thanks for reaching out. I tried to direct message you but I got error messages saying the message could not be sent. Case number: Esri Case #03941488
... View more
06-30-2025
11:13 AM
|
0
|
1
|
385
|
POST
|
I've been having major problems since yesterday as well. Sometimes the web page won't display any of my feeds or analytics. Sometimes it will show feeds and analytics but with the wrong status. I can't stop and restart analytics and sometimes they do start or stop but the system incorrectly states that they didn't.
... View more
06-27-2025
01:42 PM
|
0
|
3
|
455
|
POST
|
Thanks @MatejVrtich This is what worked for me as well.
... View more
06-18-2025
08:13 PM
|
0
|
0
|
134
|
POST
|
We have a hosted feature service that is updated frequently through a ArcGIS Velocity feed. The hosted feature service is published as a public hosted view and consumed in a public instant web app. The hosted view has editing disabled and CDN enabled. Typically the hosted view will display between 10 and 100 polygons. We wish to make the app as performant as possible as we are expecting large spikes in usage. We are trying to follow the Best practices to optimize scalability guidelines. Unfortunately, due to a limitation of ArcGIS Velocity analytics, we need to use a relative date filter in the hosted view definition. The filter we are using is update_date within the last 5 minutes. This is necessary to filter out features that are no longer in the Velocity feed. (We can't use Gap Analysis as it doesn't work on polygon features). The best practices guide warns against using relative dates: "When setting up view definitions and filters, do not use dynamic or relative date conditions, such as current time, in the last five minutes, today, yesterday, or tomorrow" How much of an impact, or how do we measure the impact, of using a relative date filter? Does it break the CDN? Is it just the initial query before data is added to the cache that is slow? Any insights or suggestions greatly appreciated.
... View more
06-18-2025
07:28 PM
|
0
|
1
|
253
|
POST
|
I have seen the ArcGIS plugin for AutoCAD pull in a line feature layer, create a version, make edits, then sync back to the feature service. This is really useful for us. Are Annotation layers also supported? We have many CAD files with annotations in them and would love a way to pull them into a GIS Feature service. Possibly even automate the process.
... View more
06-13-2025
11:01 AM
|
0
|
1
|
182
|
POST
|
We recently upgrade to ArcGIS Enterprise 11.2 With the new licensing level we have 25 creator named user licenses but only 17 Advanced Editor Add-on licenses. We need to add advanced edit capabilities to some more creators. I don't see a way to purchase more Advanced Editor Add-on licenses on the web site. I can purchase create, professional and professional plus but not Advanced Editor. https://www.esri.com/en-us/arcgis/products/arcgis-enterprise/pricing#accordion-1-3
... View more
06-12-2025
11:17 AM
|
0
|
1
|
274
|
POST
|
In the end we created a notebook script that runs as a scheduled task. The script uses the AGOL rest api to check velocity status and errors. It then emails group members if it finds an issue. Setting it to run at 15 minute intervals consumes approx 2.5 credits a day. Here's a copy of the script in case someone finds it useful. from arcgis.gis import GIS
gis = GIS("home")
import requests
import json
def emailWarning(errormessage):
emengencyMapGroupID = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' # Replace with your actual group ID
# Get the group object using the group ID
emengencyMapGroup = gis.groups.get(emengencyMapGroupID)
emailSubject = 'Test Errors recorded in the Genasys Velocity Feeds Test'
# Users have to be in the group to receive the email
emengencyMapGroup.notify(users=['OES_Dev'], subject=emailSubject, message=errormessage)
# Check that the source data wfs endpoint is up and running
url='https://source.feed.com/geoserver/z/wfs'
payload={'authkey':'mykey',
'SERVICE':'WFS',
'REQUEST':'GetFeature',
'VERSION':'2.0.0',
'TYPENAMES':'z:evacuation_zone',
'srsName':'EPSG:4326',
'outputFormat':'application/json',
'CQL_FILTER': 'zone_status<>\'Normal\''}
r = requests.get(url, params=payload)
print(r.status_code)
# Check if the request was successful
if (r.status_code != 200):
emailWarning('Failed to connect to the source WFS endpoint. Confirm source is up and running')
# Check the status of the Velocity feeds
# Get the Velocity feeds
velocity = gis.velocity
# velocity
feeds = gis.velocity.feeds
# feeds
Sample_feed = feeds.get("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
status = Sample_feed.status
# print(status)
print(status['status'])
# Check if the feed is started
if(status['status'] != 'started'):
emailWarning('MY poller ingest feed is not started. Please log in to Velocity and restart it.')
sample_metric = Sample_feed.metrics
# print(sample_metric)
print(sample_metric['numErrors'])
# Check if there are any errors in the feed metrics
if sample_metric['numErrors'] > 0:
emailWarning('MY poller ingest feed is recording errors. Please log in and investigate.')
# Check the status of the real-time analytics
# Get the real-time analytics
real_time_analyitics= gis.velocity.realtime_analytics
real_time_analyitics
event_inget_analytic =real_time_analyitics.get('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
event_inget_analytic.status
print( event_inget_analytic.status['status'])
# Check if the real-time analytics process is started
if event_inget_analytic.status['status'] != 'started':
emailWarning('My Real time Analytic processes is not started. Please log in to Velocity and check the status. ')
# Check if there are any errors in the real-time analytics metrics
for value in event_inget_analytic.metrics.items():
# metrics are in a list of dictionaries
if( type(value[1])==list):
if(len(value[1])> 0):
for dic in value[1]:
# Check if the dictionary has an 'errorCount' key
if 'errorCount' in dic:
if dic['errorCount'] > 0:
emailWarning('One of the My Real time Analytic processes had an error. Please log in to Velocity and check the logs. ')
print('we have a problem')
... View more
06-05-2025
10:38 AM
|
2
|
4
|
401
|
Title | Kudos | Posted |
---|---|---|
1 | 07-29-2025 10:45 AM | |
1 | 07-17-2025 03:33 PM | |
1 | 07-10-2025 10:30 AM | |
1 | 06-30-2025 12:07 PM | |
1 | 03-29-2023 01:04 PM |
Online Status |
Offline
|
Date Last Visited |
2 weeks ago
|