While working on a project that required the use of thegeoevent extension to send emails based on updates to a hosted feature service, we found that we needed to quickly stop the email output connectors before performing a server restart. To do this you can go through the GeoEvent Manager and manually stop the email output connectors, but this assumes that your GeoEvent admin will always be available when a server restart is needed. Also, many times server maintenance is performed late at night while staff are usually not around. Fortunately, there is a way to script the process of stopping and starting your GeoEvent input and output connectors.
The attached zip file contains a sample script that will stop GeoEvent output connectors whose Name values are contained within a python list. This script requires that you have downloaded and installed the latest ArcREST python site-package which can be accessed on GitHub. The script has been developed to start or stop GeoEvent output connectors but can easily be modified to perform the same actions on input connectors. To get started with the sample script, please do the following:
The outputLst variable stores each output connectors Name value within a python list. The script will loop through the list of Name values and perform either the start or stop action on that specific output connector. First you need to access the Name parameter values, which are in a GUID format, by doing the following:
The script is now ready to run against your GeoEvent Admin API and should stop or start the output connectors you have stored in the python list. You can schedule this script to run on a regular basis or import the arcpy module and create a GP tool.
I hope this helps GeoEvent users with their administrative tasks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.