-
Notifications
You must be signed in to change notification settings - Fork 0
1046 lines (957 loc) · 30.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
module ietf-subscribed-notifications {
yang-version 1.1;
namespace
"urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications";
prefix sn;
import ietf-yang-types {
prefix yang;
}
import ietf-inet-types {
prefix inet;
}
import ietf-interfaces {
prefix if;
}
organization "IETF";
contact
"WG Web: <http:/tools.ietf.org/wg/netconf/>
WG List: <mailto:[email protected]>
Editor: Alexander Clemm
<mailto:[email protected]>
Editor: Eric Voit
<mailto:[email protected]>
Editor: Alberto Gonzalez Prieto
<mailto:[email protected]>
Editor: Einar Nilsen-Nygaard
<mailto:[email protected]>
Editor: Ambika Prasad Tripathy
<mailto:[email protected]>";
description
"Contains a conceptual YANG specification for subscribing to events
and receiving matching content within notification messages.";
revision 2017-09-22 {
description
"Filtering and stream structures updated, replay a feature.";
reference
"draft-ietf-netconf-subscribed-notifications-04";
}
/*
* FEATURES
*/
feature json {
description
"This feature indicates that JSON encoding of notifications
is supported.";
}
feature configured-subscriptions {
description
"This feature indicates that management plane configuration
of subscription is supported.";
}
feature replay {
description
"This feature indicates that historical event replay is
supported. With replay, it is possible for past events to be
will be streamed in chronological order.";
}
/*
* EXTENSIONS
*/
extension subscription-state-notif {
description
"This statement applies only to notifications. It indicates that
the notification is a subscription state notification. Therefore
it does not participate in a regular event stream and does not
need to be specifically subscribed to in order to receive
notifications.";
}
/*
* IDENTITIES
*/
/* Identities for streams */
identity stream {
description
"Base identity to represent a generic stream of event
notifications exposed for subscription by a system.";
}
identity NETCONF {
base stream;
description
"Default NETCONF event stream, containing events based on
notifications defined as YANG modules that are supported by the
system. As a historical reference, this contains the same set
of events in a default RFC-5277 NETCONF stream.";
}
identity SYSLOG {
base stream;
description
"A stream of events mirroring the discrete set entries
concurrently being placed into a device's local Syslog.";
}
identity custom-stream {
base stream;
description
"A supported stream not defined via an identity in this model";
}
/* Identities for subscription results */
identity subscription-result {
description
"Base identity for RPC responses and State Change Notifications
providing information on the creation, modification, deletion of
subscriptions.";
}
identity ok {
base subscription-result;
description
"OK - RPC was successful and was performed as requested.";
}
identity error {
base subscription-result;
description
"Problem with subscription. Base identity for error return
codes for RPCs and State Change Notifications.";
}
/* Identities for subscription stream status */
identity subscription-status {
description
"Base identity for the status of a subscription. This status
indicates whether a subscriber is actively generating
notifications intended for a particular receiver.";
}
identity active {
base subscription-status;
description
"Status is active and healthy.";
}
identity inactive {
base subscription-status;
description
"Status is inactive, for example after the stop time, but not
yet deleted from the configuration.";
}
identity suspended {
base subscription-status;
description
"The status is suspended, meaning that the publisher is currently
unable to provide the negotiated updates for the subscription.";
}
identity in-error {
base subscription-status;
description
"The status is in error or degraded, meaning that stream and/or
subscription is currently unable to provide the negotiated
notifications.";
}
/* Identities for subscription errors */
identity internal-error {
base error;
description
"Error within publisher prohibits operation.";
}
identity suspension-timeout {
base error;
description
"Termination of previously suspended subscription. The publisher
has eliminated the subscription as it exceeded a time limit for
suspension.";
}
identity stream-unavailable {
base error;
description
"Stream does not exist or is not available to the receiver.";
}
identity encoding-unavailable {
base error;
description
"Encoding not supported";
}
identity replay-unsupported {
base error;
description
"Replay cannot be performed for this subscription. The publisher
does not provide the requested historic information via replay.";
}
identity history-unavailable {
base error;
description
"Replay request too far into the past. The publisher does store
historic information for all parts of requested subscription, but
not back to the requested timestamp.";
}
identity filter-unavailable {
base error;
description
"Referenced filter does not exist";
}
identity filter-type-unsupported {
base error;
description
"Publisher does not support filters constructed using this
filtering technology syntax.";
}
identity filter-unsupported {
base error;
description
"Failure can be from a syntax error, or a syntax too complex to be
processed by the platform. The supplemental info should include
the invalid part of the filter.";
}
identity namespace-unavailable {
base error;
description
"Referenced namespace doesn't exist or is unavailable
to the receiver.";
}
identity no-such-subscription {
base error;
description
"Referenced subscription doesn't exist. This may be as a result of
a non-existent subscription ID, an ID which belongs to another
subscriber, or an ID for acceptable subscription which has been
statically configured.";
}
identity error-insufficient-resources {
base error;
description
"The server has insufficient resources to support the
subscription as requested by an RPC.";
}
identity unsupportable-volume {
base error;
description
"The publisher cannot support the volume of information intended
to be sent for an existing subscription.";
}
identity error-no-such-option {
base error;
description
"A requested parameter setting is not supported.";
}
/* Identities for encodings */
identity encodings {
description
"Base identity to represent data encodings";
}
identity encode-xml {
base encodings;
description
"Encode data using XML";
}
identity encode-json {
base encodings;
description
"Encode data using JSON";
}
/* Identities for transports */
identity transport {
description
"An identity that represents a transport protocol for event
notifications";
}
identity netconf {
base transport;
description
"Netconf notifications as a transport.";
}
identity http2 {
base transport;
description
"HTTP2 notifications as a transport";
}
/*
* TYPEDEFs
*/
typedef subscription-id {
type uint32;
description
"A type for subscription identifiers.";
}
typedef filter-id {
type uint32;
description
"A type to identify filters which can be associated with a
subscription.";
}
typedef subscription-result {
type identityref {
base subscription-result;
}
description
"The result of a subscription operation";
}
typedef subscription-errors {
type identityref {
base error;
}
description
"The reason for the failure of an RPC request or the sending
of a subscription suspension or termination notification";
}
typedef encoding {
type identityref {
base encodings;
}
description
"Specifies a data encoding, e.g. for a data subscription.";
}
typedef subscription-status {
type identityref {
base subscription-status;
}
description
"Specifies the status of a subscription.";
}
typedef transport-protocol {
type identityref {
base transport;
}
description
"Specifies transport protocol used to send notifications to a
receiver.";
}
typedef egressing-from {
type enumeration {
enum "interface-originated" {
description
"Notifications will be sent from a specific interface on a
publisher";
}
enum "address-originated" {
description
"Notifications will be sent from a specific address on a
publisher";
}
}
description
"Specifies from where notifications will be sourced when
being sent by the publisher.";
}
typedef stream {
type identityref {
base stream;
}
description
"Specifies a system-provided datastream.";
}
typedef event-filter-ref {
type leafref {
path "/sn:filters/sn:event-filter/sn:identifier";
}
description
"This type is used to reference an event filter.";
}
/*
* GROUPINGS
*/
grouping event-filter-elements {
description
"This grouping defines the base for filters for notification
events.";
choice filter-spec {
description
"The content filter specification for this request.";
anydata subtree-filter {
description
"Event stream evaluation criteria encoded in a syntax of a
supported type of an RFC 6241, Section 6 filter. When
applied against an event stream and there is a non-empty or
positive result, the event is passed along.";
reference "RFC 6241, Section 6.";
}
leaf xpath-filter {
type yang:xpath1.0;
description
"Event stream evaluation criteria encoded in a syntax of xpath
1.0 When applied against an event stream and there is a
non-empty or positive result, the event is passed along.";
reference "http://www.w3.org/TR/1999/REC-xpath-19991116";
}
}
}
grouping subscription-policy-modifiable {
description
"This grouping describes all objects which may be changed
in a subscription via an RPC.";
choice target {
mandatory true;
description
"A filter must be applied against some source of information.
This identifies the target for the filter.";
case stream {
choice event-filter {
description
"A filter can be applied to a subscription. And that filter
will come either referenced from a global list, or be
provided within the subscription itself.";
case by-reference {
description
"Apply a filter that has been configured separately.";
leaf event-filter-ref {
type event-filter-ref;
mandatory true;
description
"References an existing filter which is to be applied to
the subscription.";
}
}
case within-subscription {
description
"Local definition allows a filter to have the same
lifecycle as the subscription.";
uses event-filter-elements;
}
}
}
}
leaf stop-time {
type yang:date-and-time;
description
"Identifies a time after which notification events should not
be sent. If stop-time is not present, the notifications will
continue until the subscription is terminated. If
replay-start-time exists, stop-time must for a subsequent time.
If replay-start-time doesn't exist, stop-time must for a future
time.";
}
}
grouping subscription-policy {
description
"This grouping describes information concerning a subscription.";
leaf encoding {
type encoding;
default "encode-xml";
description
"The type of encoding for the subscribed data. Default is XML";
}
uses subscription-policy-modifiable {
augment target/stream {
description
"Adds additional objects which must be set just by RPC.";
leaf stream {
type stream;
mandatory true;
description
"Indicates a stream of events against which to apply
an event filter.";
}
leaf replay-start-time {
if-feature "replay";
type yang:date-and-time;
description
"Used to trigger the replay feature and indicate that the
replay should start at the time specified. If
replay-start-time is not present, this is not a replay
subscription and event pushes should start immediately. It
is never valid to specify start times that are later than
or equal to the current time.";
}
}
}
}
grouping notification-origin-info {
description
"Defines the sender source from which notifications for a
configured subscription are sent.";
choice notification-origin {
description
"Identifies the egress interface on the Publisher from which
notifications will or are being sent.";
case interface-originated {
description
"When the push source is out of an interface on the
Publisher established via static configuration.";
leaf source-interface {
type if:interface-ref;
description
"References the interface for notifications.";
}
}
case address-originated {
description
"When the push source is out of an IP address on the
Publisher established via static configuration.";
leaf source-vrf {
type string;
description
"Network instance name for the VRF. This could also have
been a leafref to draft-ietf-rtgwg-ni-model, but that model
is not complete, and might not be implemented on a box.";
}
leaf source-address {
type inet:ip-address-no-zone;
description
"The source address for the notifications. If a source VRF
exists, but this object doesn't, a default address for the
VRF can be used.";
}
}
}
}
grouping receiver-info {
description
"Defines where and how to get notifications for a configured
subscriptions to one or more targeted recipient. This includes
specifying the destination addressing as well as a transport
protocol acceptable to the receiver.";
container receivers {
description
"Set of receivers in a subscription.";
list receiver {
key "address port";
min-elements 1;
description
"A single host or multipoint address intended as a target
for the notifications for a subscription.";
leaf address {
type inet:host;
description
"Specifies the address for the traffic to reach a remote
host. One of the following must be specified: an ipv4
address, an ipv6 address, or a host name.";
}
leaf port {
type inet:port-number;
description
"This leaf specifies the port number to use for messages
destined for a receiver.";
}
leaf protocol {
type transport-protocol;
default "netconf";
description
"This leaf specifies the transport protocol used
to deliver messages destined for the receiver. Each
protocol may use the address and port information
differently as applicable.";
}
}
}
}
grouping error-identifier {
description
"A code passed back within an RPC response to describe why the RFC
has failed, or within a state change notification to describe why
the change has occurred.";
leaf error-id {
type subscription-errors;
mandatory true;
description
"Identifies the subscription error condition.";
}
}
grouping hints {
description
"Objects passed back within an RPC response to describe why the
RFC has failed, or within a state change notification to
describe why the change has occurred.";
leaf filter-failure {
type string;
description
"Information describing where and/or why a provided filter was
unsupportable for a subscription.";
}
}
grouping subscription-response-with-hints {
description
"Defines the output for the establish-subscription and
modify-subscription RPCs.";
leaf subscription-result {
type subscription-result;
mandatory true;
description
"Indicates whether subscription is operational, or if a problem
was encountered.";
}
choice result {
description
"Depending on the subscription result, different data is
returned.";
case no-success {
description
"This case applies when a subscription request was not
successful and no subscription was created (or modified) as a
result. In this case, information MAY be returned that
indicates suggested parameter settings that would have a
high likelihood of succeeding in a subsequent establish-
subscription or modify-subscription request.";
uses hints;
}
}
}
/*
* RPCs
*/
rpc establish-subscription {
description
"This RPC allows a subscriber to create (and possibly negotiate)
a subscription on its own behalf. If successful, the
subscription remains in effect for the duration of the
subscriber's association with the publisher, or until the
subscription is terminated. In case an error (as indicated by
subscription-result) is returned, the subscription is not
created. In that case, the RPC reply MAY include suggested
parameter settings that would have a higher likelihood of
succeeding in a subsequent establish-subscription request.";
input {
uses subscription-policy;
}
output {
uses subscription-response-with-hints {
augment "result" {
description
"Allows information to be passed back as part of a
successful subscription establishment.";
case success {
description
"This case is used when the subscription request was
successful.";
leaf identifier {
type subscription-id;
mandatory true;
description
"Identifier used for this subscription.";
}
}
}
augment "result/no-success" {
description
"Contains establish RPC specific objects which can be
returned as hints for future attempts.";
leaf replay-start-time-hint {
type yang:date-and-time;
description
"If a replay has been requested, but the requested replay
time cannot be honored, this may provide a hint at an
alternate time which may be supportable.";
}
}
}
}
}
rpc modify-subscription {
description
"This RPC allows a subscriber to modify a subscription that was
previously created using establish-subscription. If successful,
the changed subscription remains in effect for the duration of
the subscriber's association with the publisher, or until the
subscription is again modified or terminated. In case an error
is returned (as indicated by subscription-result), the
subscription is not modified and the original subscription
parameters remain in effect. In that case, the rpc error
response MAY include suggested parameter hints that would have
a high likelihood of succeeding in a subsequent
modify-subscription request.";
input {
leaf identifier {
type subscription-id;
description
"Identifier to use for this subscription.";
}
uses subscription-policy-modifiable;
}
output {
uses subscription-response-with-hints;
}
}
rpc delete-subscription {
description
"This RPC allows a subscriber to delete a subscription that
was previously created from by that same subscriber using the
establish-subscription RPC.";
input {
leaf identifier {
type subscription-id;
mandatory true;
description
"Identifier of the subscription that is to be deleted.
Only subscriptions that were created using
establish-subscription can be deleted via this RPC.";
}
}
output {
leaf subscription-result {
type subscription-result;
mandatory true;
description
"Indicates whether subscription has been deleted, or if a
problem was encountered.";
}
}
}
rpc kill-subscription {
description
"This RPC allows an operator to delete a dynamic subscription
without restrictions on the originating subscriber or underlying
transport session.";
input {
leaf identifier {
type subscription-id;
mandatory true;
description
"Identifier of the subscription that is to be deleted. Only
subscriptions that were created using establish-subscription
can be deleted via this RPC.";
}
}
output {
leaf subscription-result {
type subscription-result;
mandatory true;
description
"Indicates whether subscription has been killed, or if a
problem was encountered.";
}
}
}
/*
* NOTIFICATIONS
*/
notification replay-completed {
sn:subscription-state-notif;
description
"This notification is sent to indicate that all of the replay
notifications have been sent. It must not be sent for any other
reason.";
leaf identifier {
type subscription-id;
mandatory true;
description
"This references the affected subscription.";
}
}
notification subscription-completed {
sn:subscription-state-notif;
description
"This notification is sent to indicate that a subscription has
finished passing events.";
leaf identifier {
type subscription-id;
mandatory true;
description
"This references the gracefully completed subscription.";
}
}
notification subscription-started {
sn:subscription-state-notif;
description
"This notification indicates that a subscription has started and
notifications are beginning to be sent. This notification shall
only be sent to receivers of a subscription; it does not
constitute a general-purpose notification.";
leaf identifier {
type subscription-id;
mandatory true;
description
"This references the affected subscription.";
}
uses subscription-policy;
}
notification subscription-resumed {
sn:subscription-state-notif;
description
"This notification indicates that a subscription that had
previously been suspended has resumed. Notifications will once
again be sent.";
leaf identifier {
type subscription-id;
mandatory true;
description
"This references the affected subscription.";
}
}
notification subscription-modified {
sn:subscription-state-notif;
description
"This notification indicates that a subscription has been
modified. Notifications sent from this point on will conform to
the modified terms of the subscription. For completeness, this
notification includes both modified and non-modified aspects of
a subscription ";
leaf identifier {
type subscription-id;
mandatory true;
description
"This references the affected subscription.";
}
uses subscription-policy;
}
notification subscription-terminated {
sn:subscription-state-notif;
description
"This notification indicates that a subscription has been
terminated.";
leaf identifier {
type subscription-id;
mandatory true;
description
"This references the affected subscription.";
}
uses error-identifier;
uses hints;
}
notification subscription-suspended {
sn:subscription-state-notif;
description
"This notification indicates that a suspension of the
subscription by the publisher has occurred. No further
notifications will be sent until the subscription resumes.
This notification shall only be sent to receivers of a
subscription; it does not constitute a general-purpose
notification.";
leaf identifier {
type subscription-id;
mandatory true;
description
"This references the affected subscription.";
}
uses error-identifier;
uses hints;
}
/*
* DATA NODES
*/
container streams {
config false;
description
"This container contains information on the built-in streams
provided by the publisher.";
list stream {
key "stream";
description
"Identifies the built-in streams that are supported by the
publisher.";
leaf stream {
type stream;
description
"A handle for a sequential set of events, each of which
is characterized by its own domain and semantics.
In case configurable custom streams are supported,
as indicated by the custom-stream identity, the configuration
of those custom streams is provided separately.";
}
leaf description {
type string;
mandatory true;
description
"A description of the event stream, including such information
as the type of events that are sent over this stream.";
}
leaf replay-support {
type empty;
description
"Indicates that event replay is available on this stream.";
}
leaf replay-log-creation-time {
type yang:date-and-time;
description
"The timestamp of the creation of the log used to support the
replay function on this stream. Note that this might be
earlier then the earliest available notification in the log.
This object is updated if the log resets for some reason.
This object MUST be present if replay is supported.";
}
leaf replay-log-aged-time {
type yang:date-and-time;
description
"The timestamp of the last notification aged out of the log.
This object MUST be present if replay is supported and any
notifications have been aged out of the log.";
}
}
}
container filters {
description
"This container contains a list of configurable filters
that can be applied to subscriptions. This facilitates
the reuse of complex filters once defined.";
list event-filter {
key "identifier";
description
"A list of pre-positioned filters that can be applied to
event subscriptions.";
leaf identifier {
type filter-id;
description
"An identifier to differentiate between filters.";
}
uses event-filter-elements;
}
}
container subscription-config {
if-feature "configured-subscriptions";
description
"Contains the list of subscriptions that are configured,
as opposed to established via RPC or other means.";
list subscription {
key "identifier";
description
"Content of a subscription.";
leaf identifier {
type subscription-id;
description
"Identifier to use for this subscription.";
}
uses subscription-policy;
uses receiver-info;
uses notification-origin-info;
}
}
container subscriptions {
config false;
description
"Contains the list of currently active subscriptions, i.e.
subscriptions that are currently in effect, used for subscription
management and monitoring purposes. This includes subscriptions
that have been setup via RPC primitives as well as subscriptions
that have been established via configuration.";
list subscription {
key "identifier";
description
"Content of a subscription. Subscriptions can be created using
a control channel or RPC, or be established through