Merge "Startup archetype: remove 'Impl' from config subsystem Module name."
[controller.git] / opendaylight / md-sal / messagebus-api / src / main / yang / event-aggregator.yang
1 module event-aggregator {
2     // FIXME: this module needs to be split up to concepts and API
3     //        as the concepts are shared with the other model in this
4     //        package.
5     yang-version 1;
6     namespace "urn:cisco:params:xml:ns:yang:messagebus:eventaggregator";
7     prefix "eventaggregator";
8
9     organization "Cisco Systems, Inc.";
10     contact "Robert Gallas";
11
12     description
13         "Module implementing message but RPC.
14
15         Copyright (c)2014 Cisco Systems, Inc. All rights reserved.
16
17         This program and the accompanying materials are made available
18         under the terms of the Eclipse Public License v1.0 which
19         accompanies this distribution, and is available at
20         http://www.eclipse.org/legal/epl-v10.html";
21
22     revision "2014-12-02" {
23         description "Initial revision";
24     }
25
26     typedef pattern {
27         type string {
28             length 1..max;
29         }
30
31         // FIXME: make this a regular expression
32         description "A match pattern. Specifically this is a wildcard pattern.";
33     }
34
35     typedef notification-pattern {
36         type pattern;
37         description
38             "Pattern for matching candidate notification types. This pattern is to be
39             applied against the concatenation of the namespace of the module which
40             defines that particular notification, followed by a single colon, and
41             then followed by notification identifier, as supplied in the argument to
42             the notification statement.";
43     }
44
45     typedef topic-id {
46         type string {
47             length 1..max;
48         }
49         description
50             "A topic identifier. It uniquely defines a topic as seen by the the user
51             of this model's RPCs";
52     }
53
54     // FIXME: we would really like to share instances here, but that requires some sort
55     //        of sane reference counting. The reason for sharing is the data path part
56     //        of notification delivery -- multiple creators of topics can still share
57     //        a single data path.
58     rpc create-topic {
59         description
60             "Create a new topic. A topic is an aggregation of several notification
61             types from a set of nodes. Each successful invocation results in a unique
62             topic being created. The caller is responsible for removing the topic
63             once it is no longer needed.";
64
65         input {
66             leaf notification-pattern {
67                 type notification-pattern;
68                 mandatory true;
69                 description
70                     "Pattern matching notification which should be forwarded into this
71                     topic.";
72             }
73
74             leaf node-id-pattern {
75                 type pattern;
76                 mandatory true;
77                 description
78                     "Pattern for matching candidate event source nodes when looking
79                     for contributors to the topic. The pattern will be applied against
80                     /network-topology/topology/node/node-id";
81             }
82         }
83
84         output {
85             leaf topic-id {
86                 type topic-id;
87                 mandatory true;
88             }
89         }
90     }
91
92     rpc destroy-topic {
93         description
94             "Destroy a topic. No further messages will be delivered to it.";
95
96         input {
97             leaf topic-id {
98                 type topic-id;
99                 mandatory true;
100             }
101         }
102     }
103
104     notification topic-notification {
105         description
106             "Notification of an event occuring on a particular node. This notification
107             acts as an encapsulation for the event being delivered.";
108
109         leaf topic-id {
110             type topic-id;
111             mandatory true;
112             description
113                 "Topic to which this event is being delivered.";
114         }
115
116         leaf node-id {
117             // FIXME: should be topology node ID
118             type string;
119             mandatory true;
120             description
121                 "Node ID of the node which generated the event.";
122         }
123
124         anyxml payload {
125             mandatory true;
126             description
127                 "Encapsulated notification. The format is the XML representation of
128                 a notification according to RFC6020 section 7.14.2.";
129         }
130     }
131 }