projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
12216: Fix crash at path "/c=foo"
[arvados.git]
/
doc
/
_includes
/
_events_py.liquid
diff --git
a/doc/_includes/_events_py.liquid
b/doc/_includes/_events_py.liquid
index b631d940d06e5fb7f45f14274b46ae11802613b8..460fd42232bb9eb07c7f93574b2b86aeb4590c40 100644
(file)
--- a/
doc/_includes/_events_py.liquid
+++ b/
doc/_includes/_events_py.liquid
@@
-1,15
+1,18
@@
#!/usr/bin/env python
#!/usr/bin/env python
+{% comment %}
+Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: CC-BY-SA-3.0
+{% endcomment %}
import arvados
import arvados.events
import arvados
import arvados.events
-import json
# 'ev' is a dict containing the log table record describing the change.
def on_message(ev):
# 'ev' is a dict containing the log table record describing the change.
def on_message(ev):
- # Your code here.
- print json.dumps(ev)
-
+ if ev.get("event_type") == "create" and ev.get("object_kind") == "arvados#collection":
+ print "A new collection was created: %s" % ev["object_uuid"]
-api = arvados.api(
'v1', cache=False
)
+api = arvados.api(
"v1"
)
ws = arvados.events.subscribe(api, [], on_message)
ws.run_forever()
ws = arvados.events.subscribe(api, [], on_message)
ws.run_forever()