import urllib.request
import json
class GhCloud:
def __init__(self, org):
self.org = org
def read(self):
url = 'https://api.github.com/orgs/%s/repos' % self.org
data = json.loads(urllib.request.urlopen(url).read().decode('utf-8'))
for d in data: yield d
def done(self):
pass
I put this in cloudmarker.yaml. plugins:
ghplug:
plugin: ghcloud.GhCloud
params:
org: python
audits:
ghmon:
clouds:
- ghplug
stores:
- esstore
- filestore
run:
- ghmon
I run tool. PYTHONPATH=. cloudmarker --now
Cloudmarker runs my ghcloud.py and puts data into localhost:9200 and /tmp automatically. I can do it without cloning Cloudmarker code. I only hack my code and Cloudmarker runs it.
Can you give me Custodian doc or tutorial that will help me do this in Custodian? I saw the Kubernetes link. It has many files to read. Can you give me simpler starting place?