Python Interface - Dump all the Triggers to a Flat File


#1

I found this simple process to dump all the Triggers to a Flat file so I could use Notepad++ and do things like - Find All for ‘things’ of interest.

It sure helps me to find the triggers related to each other or saving things to applications.

#!/usr/bin/env python2 
#-*- Mode: python -*- 
/*  
This script prints out a list of all the triggers */
# Imports -------------------------------------------------------------- 
import pyhop
# Code ----------------------------------------------------------------- 
c = pyhop.Client(apikey="Your Key", host="Your Host", check_cert=False) 
# get all Triggers since date 0 
result = c.get_triggers(0) 
# print out each trigger via a json dump  
import json
print json.dumps(result, indent=2)
c.close()