BUG 3121 - destroy topic implementation
[controller.git] / opendaylight / md-sal / messagebus-api / src / main / yang / event-source.yang
1 module event-source {
2     yang-version 1;
3     namespace "urn:cisco:params:xml:ns:yang:messagebus:eventsource";
4     prefix "eventsource";
5
6     import event-aggregator { prefix aggr; }
7     import network-topology { prefix nt; revision-date "2013-10-21"; }
8     import opendaylight-inventory {prefix inv; revision-date "2013-08-19"; }
9     import yang-ext {prefix ext; revision-date "2013-07-09"; }
10
11     organization "Cisco Systems, Inc.";
12     contact "Robert Gallas";
13
14     description
15         "Base model for a topology where individual nodes can produce events.
16
17         Module implementing event source topology and encapped notification.
18
19         Copyright (c)2014 Cisco Systems, Inc. All rights reserved.
20
21         This program and the accompanying materials are made available
22         under the terms of the Eclipse Public License v1.0 which
23         accompanies this distribution, and is available at
24         http://www.eclipse.org/legal/epl-v10.html";
25
26     revision "2014-12-02" {
27         description "first revision
28             + add rpc dis-join-topic
29             + add notification event-source-status-notification";
30     }
31
32     // FIXME: expand this
33     typedef join-topic-status {
34         type enumeration {
35             enum up;
36             enum down;
37         }
38         description "Object status";
39     }
40
41     // FIXME: migrate to topology
42     typedef node-ref {
43         type leafref {
44             path "/inv:nodes/inv:node/inv:id";
45         }
46     }
47
48     typedef event-source-status {
49         type enumeration {
50             enum active;
51             enum inactive;
52             enum deactive;
53         }
54         description "Status of event source
55                        - active: event source is publishing notification,
56                        - inactive: event source stopped publishing of notifications temporarily
57                        - deactive: event source stopped publishing of notifications permanently" ;
58     }
59
60     grouping topology-event-source-type {
61         container topology-event-source {
62             presence "indicates an event source-aware topology";
63         }
64     }
65
66     rpc join-topic {
67         input {
68             leaf node {
69                ext:context-reference "inv:node-context";
70                type "instance-identifier";
71             }
72             leaf topic-id {
73                 type aggr:topic-id;
74                 description "in current implementation notification-pattern is defined by topic-id.
75                              By persisting topic definition we could omit notification-pattern";
76             }
77             leaf notification-pattern {
78                 type aggr:notification-pattern;
79             }
80         }
81
82         output {
83             leaf status {
84                 type join-topic-status;
85             }
86         }
87     }
88
89     rpc dis-join-topic {
90         input {
91             leaf node {
92                ext:context-reference "inv:node-context";
93                type "instance-identifier";
94             }
95             leaf topic-id {
96                 type aggr:topic-id;
97                 mandatory true;
98                 description "identifier of topic to be disjoin";
99             }
100         }
101
102     }
103
104     notification event-source-status-notification {
105
106         description
107             "Notification of change event source status.";
108
109         leaf status {
110             type event-source-status;
111             mandatory true;
112             description "Current status of event source.";
113         }
114
115     }
116
117     augment "/nt:network-topology/nt:topology/nt:topology-types" {
118         uses topology-event-source-type;
119     }
120
121     augment "/nt:network-topology/nt:topology/nt:node" {
122         when "../../nt:topology-types/topology-event-source";
123         leaf event-source-node {
124             type node-ref;
125         }
126     }
127 }