Add E2E benchmark OpenApi integration test
[netconf.git] / apps / restconf-it / src / test / resources / juniper / junos-conf-snmp@2022-01-01.yang
1 /*
2  * Copyright (c) 2022 Juniper Networks, Inc.
3  * All rights reserved.
4  */
5  module junos-conf-snmp {
6    namespace "http://yang.juniper.net/junos/conf/snmp";
7
8    prefix jc-snmp;
9
10    import junos-common-ddl-extensions {
11      prefix junos;
12      revision-date 2022-01-01;
13    }
14
15    import junos-common-types {
16      prefix jt;
17      revision-date 2022-01-01;
18    }
19
20    import junos-conf-root {
21      prefix jc;
22      revision-date 2022-01-01;
23    }
24
25    organization "Juniper Networks, Inc.";
26
27    contact "yang-support@juniper.net";
28
29    description "Junos snmp configuration module";
30
31    revision 2022-01-01 {
32      description "Junos: 22.3R1.9";
33    }
34
35    augment /jc:configuration {
36      uses snmp-group;
37    }
38    augment /jc:configuration/jc:groups {
39      uses snmp-group;
40    }
41    grouping snmp-group {
42      container snmp {
43        description "Simple Network Management Protocol configuration";
44        uses apply-advanced;
45        leaf system-name {
46          description "System name override";
47          type string;
48        }
49        leaf description {
50          description "System description";
51          type string;
52        }
53        leaf location {
54          description "Physical location of system";
55          type string;
56        }
57        leaf contact {
58          description "Contact information for administrator";
59          type string;
60        }
61        leaf-list interface {
62          ordered-by user;
63          description "Restrict SNMP requests to interfaces";
64          type union {
65            type jt:interface-name;
66            type string {
67              pattern "<.*>|$.*";
68            }
69          }
70        }
71        container alarm-management {
72          description "Alarm management";
73          uses apply-advanced;
74          list alarm-list-name {
75            key name;
76            ordered-by user;
77            description "Alarm list name";
78            leaf name {
79              description "Alarm list name";
80              type string {
81                length "1 .. 32";
82              }
83            }
84            uses apply-advanced;
85            list alarm-id {
86              key name;
87              ordered-by user;
88              description "Alarm id";
89              leaf name {
90                description "Alarm id";
91                type union {
92                  type string {
93                    pattern "<.*>|$.*";
94                  }
95                  type uint32 {
96                    range "1 .. 4294967295";
97                  }
98                }
99              }
100              uses apply-advanced;
101              list alarm-state {
102                key name;
103                ordered-by user;
104                description "Alarm model state, configure state value as 1 for clear alarm";
105                leaf name {
106                  description "Alarm state";
107                  type union {
108                    type string {
109                      pattern "<.*>|$.*";
110                    }
111                    type uint32 {
112                      range "1 .. 4294967295";
113                    }
114                  }
115                }
116                uses apply-advanced;
117                leaf notification-id {
118                  description "Notification id of alarm";
119                  type string {
120                    length "1 .. 254";
121                  }
122                }
123                leaf varbind-index {
124                  description "Varbind index in alarm varbind list";
125                  default "0";
126                  junos:must "(\".. varbind-value\")";
127                  junos:must-message "[varbind-value] must be configured for varbind-index";
128                  type union {
129                    type string {
130                      pattern "<.*>|$.*";
131                    }
132                    type uint32 {
133                      range "0 .. 4294967295";
134                    }
135                  }
136                }
137                leaf varbind-value {
138                  description "Alarm varbind value";
139                  default "0";
140                  junos:must "(\".. varbind-index\")";
141                  junos:must-message "[varbind-index] must be configured for varbind-value";
142                  type union {
143                    type string {
144                      pattern "<.*>|$.*";
145                    }
146                    type int32 {
147                      range "0 .. 2147483647";
148                    }
149                  }
150                }
151                leaf description {
152                  description "Alarm description";
153                  type string {
154                    length "1 .. 2048";
155                  }
156                }
157                leaf varbind-subtree {
158                  description "Alarm varbind subtree";
159                  junos:must "((\".. resource-prefix\" && \".. varbind-index\"))";
160                  junos:must-message "resource-prefix and varbind-index must be configured for varbind-subtree";
161                  type string {
162                    length "1 .. 254";
163                  }
164                }
165                leaf resource-prefix {
166                  description "Alarm resource prefix";
167                  type string {
168                    length "1 .. 254";
169                  }
170                }
171              }
172            }
173          }
174        }
175        container filter-interfaces {
176          presence "enable filter-interfaces";
177          description "List of interfaces that needs to be filtered";
178          uses apply-advanced;
179          list interfaces {
180            key name;
181            ordered-by user;
182            description "Filter specified interfaces";
183            leaf name {
184              type string;
185            }
186            uses apply-advanced;
187          }
188          leaf all-internal-interfaces {
189            description "Filter all internal interfaces";
190            type empty;
191          }
192        }
193        leaf if-count-with-filter-interfaces {
194          description "Filter interfaces config for ifNumber and ipv6Interfaces";
195          type empty;
196        }
197        leaf filter-duplicates {
198          description "Filter requests with duplicate source address/port and request ID";
199          type empty;
200        }
201        container nonvolatile {
202          description "Configure the handling of nonvolatile SNMP Set requests";
203          uses apply-advanced;
204          leaf commit-delay {
205            description "Delay between affirmative SNMP Set reply and start of commit";
206            default "5";
207            units "seconds";
208            type union {
209              type uint32;
210              type string {
211                pattern "<.*>|$.*";
212              }
213            }
214          }
215        }
216        container v3 {
217          description "SNMPv3 configuration information";
218          uses apply-advanced;
219          container usm {
220            description "User-based security model (USM) information";
221            uses apply-advanced;
222            container local-engine {
223              description "Local engine user configuration";
224              uses apply-advanced;
225              list user {
226                key name;
227                ordered-by user;
228                description "SNMPv3 USM user information";
229                uses v3-user-config;
230              }
231            }
232            list remote-engine {
233              key name;
234              ordered-by user;
235              description "Remote engine user configuration";
236              leaf name {
237                description "Remote engine id (Hex format)";
238                type string {
239                  junos:posix-pattern "^.{5,64}$";
240                  junos:pattern-message "Must be a string of 5 to 64 hex characters";
241                }
242              }
243              uses apply-advanced;
244              list user {
245                key name;
246                ordered-by user;
247                description "SNMPv3 USM user information";
248                uses v3-user-config;
249              }
250            }
251          }
252          container vacm {
253            description "View-based access control model (VACM) information";
254            uses apply-advanced;
255            container security-to-group {
256              description "Assigns security names to group";
257              uses apply-advanced;
258              list security-model {
259                key name;
260                ordered-by user;
261                description "Security model context for group assignment";
262                leaf name {
263                  description "SNMPv3 security-to-group model name";
264                  type enumeration {
265                    enum "usm" {
266                      description "User-based security model";
267                    }
268                    enum "v1" {
269                      description "SNMPv1 model";
270                    }
271                    enum "v2c" {
272                      description "SNMPv2c model";
273                    }
274                  }
275                }
276                uses apply-advanced;
277                list security-name {
278                  key name;
279                  ordered-by user;
280                  description "Security name to assign to group";
281                  leaf name {
282                    description "Security name";
283                    type string {
284                      length "1 .. 32";
285                    }
286                  }
287                  uses apply-advanced;
288                  leaf group {
289                    description "Group to which to assign security name";
290                    type string {
291                      length "1 .. 32";
292                    }
293                  }
294                }
295              }
296            }
297            container access {
298              description "Specify SNMP access limits";
299              uses apply-advanced;
300              list group {
301                key name;
302                ordered-by user;
303                description "Group access configuration";
304                leaf name {
305                  description "SNMPv3 VACM group name";
306                  type string {
307                    length "1 .. 32";
308                  }
309                }
310                uses apply-advanced;
311                container default-context-prefix {
312                  description "Default context-prefix access configuration";
313                  uses apply-advanced;
314                  list security-model {
315                    key name;
316                    ordered-by user;
317                    description "Security model access configuration";
318                    uses security-model-access;
319                  }
320                }
321                list context-prefix {
322                  key name;
323                  ordered-by user;
324                  description "Context-prefix access configuration";
325                  leaf name {
326                    description "SNMPv3 VACM context prefix";
327                    type string {
328                      junos:posix-pattern "^.{1,32}$";
329                      junos:pattern-message "Must be a string of 32 characters or less";
330                    }
331                  }
332                  uses apply-advanced;
333                  list security-model {
334                    key name;
335                    ordered-by user;
336                    description "Security model access configuration";
337                    uses security-model-access;
338                  }
339                }
340              }
341            }
342          }
343          list target-address {
344            key name;
345            ordered-by user;
346            description "Identifies notification targets as well as allowed management stations";
347            leaf name {
348              description "SNMP target address name";
349              type string {
350                length "1 .. 32";
351              }
352            }
353            uses apply-advanced;
354            leaf address {
355              description "SNMP target address";
356              type jt:ipaddr;
357            }
358            leaf port {
359              description "SNMP target port number";
360              default "162";
361              type union {
362                type uint16;
363                type string {
364                  pattern "<.*>|$.*";
365                }
366              }
367            }
368            leaf timeout {
369              description "Acknowledgment timeout for confirmed SNMP notifications";
370              default "15";
371              units "seconds";
372              type union {
373                type uint32;
374                type string {
375                  pattern "<.*>|$.*";
376                }
377              }
378            }
379            leaf retry-count {
380              description "Maximum retry count for confirmed SNMP notifications";
381              default "3";
382              type union {
383                type string {
384                  pattern "<.*>|$.*";
385                }
386                type uint32 {
387                  range "0 .. 255";
388                }
389              }
390            }
391            leaf tag-list {
392              description "SNMP tag list used to select target addresses";
393              type string {
394                length "0 .. 255";
395              }
396            }
397            leaf address-mask {
398              description "Mask range of addresses for community string access control.";
399              type jt:ipaddr;
400            }
401            leaf routing-instance {
402              description "Routing instance for trap destination";
403              type string {
404                junos:posix-pattern "!^(([*]{1,})|(__.*__)|(.{194,}))$";
405                junos:pattern-message "Must be a non-reserved string of 193 characters or less";
406              }
407            }
408            leaf logical-system {
409              description "Logical-system name for trap destination";
410              type string {
411                junos:posix-pattern "^[a-zA-Z0-9_-]{1,63}$";
412                junos:pattern-message "Logical-system name is a string consisting of up to 63 letters, numbers, dashes and underscores";
413              }
414            }
415            leaf target-parameters {
416              description "SNMPv3 target parameter name in the target parameters table";
417              type string {
418                length "1 .. 32";
419              }
420            }
421          }
422          list target-parameters {
423            key name;
424            ordered-by user;
425            description "Parameters and filter name used when sending notifications";
426            leaf name {
427              description "SNMPv3 target parameters name";
428              type string {
429                length "1 .. 32";
430              }
431            }
432            uses apply-advanced;
433            container parameters {
434              description "Parameters used when sending notifications";
435              uses apply-advanced;
436              leaf message-processing-model {
437                description "The message processing model to be used when generating SNMP notifications";
438                type enumeration {
439                  enum "v1" {
440                    description "SNMPv1 model";
441                  }
442                  enum "v2c" {
443                    description "SNMPv2c model";
444                  }
445                  enum "v3" {
446                    description "SNMPv3 model";
447                  }
448                }
449              }
450              leaf security-model {
451                description "Security-model used when generating SNMP notifications";
452                type enumeration {
453                  enum "usm" {
454                    description "User-based security model";
455                  }
456                  enum "v1" {
457                    description "SNMPv1 model";
458                  }
459                  enum "v2c" {
460                    description "SNMPv2c model";
461                  }
462                }
463              }
464              leaf security-level {
465                description "Security-level used when generating SNMP notifications";
466                type enumeration {
467                  enum "none" {
468                    description "None (noAuthNoPriv)";
469                  }
470                  enum "authentication" {
471                    description "Authentication (authNoPriv)";
472                  }
473                  enum "privacy" {
474                    description "Privacy and authentication (authPriv)";
475                  }
476                }
477              }
478              leaf security-name {
479                description "Security name used when generating SNMP notifications";
480                type string {
481                  length "1 .. 32";
482                }
483              }
484            }
485            container notify-filter {
486              description "Notify filter to apply to notifications";
487              leaf filter {
488                description "Filter name to apply to notifications";
489                type string {
490                  length "1 .. 32";
491                }
492              }
493            }
494          }
495          list notify {
496            key name;
497            ordered-by user;
498            description "Used to select management targets for notifications as well as the type of notifications";
499            leaf name {
500              description "Notify name";
501              type string {
502                length "1 .. 32";
503              }
504            }
505            uses apply-advanced;
506            leaf type {
507              description "Notification type";
508              default "trap";
509              type enumeration {
510                enum "trap" {
511                  description "SNMP trap";
512                }
513                enum "inform" {
514                  description "Inform request";
515                }
516              }
517            }
518            leaf tag {
519              description "Notifications will be sent to all targets configured with this tag";
520              type string {
521                length "0 .. 255";
522              }
523            }
524          }
525          list notify-filter {
526            key name;
527            ordered-by user;
528            description "Filters to apply to SNMP notifications";
529            leaf name {
530              description "SNMP profile name in the notify filter table";
531              type string {
532                length "1 .. 32";
533              }
534            }
535            uses apply-advanced;
536            list oid {
537              key name;
538              ordered-by user;
539              description "OID include/exclude list";
540              leaf name {
541                description "OID to include/exclude from notify filter";
542                type string {
543                  junos:posix-pattern "^(.?1|[a-zA-Z][a-zA-Z0-9]*)(.[0-9]+|[.][*]|[.][a-zA-Z])*$";
544                  junos:pattern-message "Must be an OID of the form 1.x.*.z... or objname[.x.*.z]";
545                }
546              }
547              choice filter-action {
548                case case_1 {
549                  leaf include {
550                    description "Include this OID in the notify filter";
551                    type empty;
552                  }
553                }
554                case case_2 {
555                  leaf exclude {
556                    description "Exclude this OID from the notify filter";
557                    type empty;
558                  }
559                }
560              }
561            }
562          }
563          leaf management-routing-instance {
564            description "Enable SNMPv3 access for all routing instances from this default context";
565            junos:must "(\"routing-instances $$\")";
566            junos:must-message "Referenced routing instance must be defined under [edit routing-instances] hierarchy level";
567            type string {
568              junos:posix-pattern "!^((__.*__)|(all)|(.*[ ].*)|(\"\")|(.{129,}))$";
569              junos:pattern-message "Must be a non-reserved string of 128 characters or less with no spaces.";
570            }
571          }
572          list snmp-community {
573            key name;
574            ordered-by user;
575            description "SNMP community and view-based access control model configuration";
576            leaf name {
577              description "Unique index value in this community table entry";
578              type string {
579                length "1 .. 32";
580              }
581            }
582            uses apply-advanced;
583            leaf community-name {
584              description "SNMPv1/v2c community name (default is same as community-index)";
585              type jt:unreadable;
586            }
587            leaf security-name {
588              description "Security name used when performing access control";
589              type string {
590                length "1 .. 32";
591              }
592            }
593            leaf context {
594              description "Context used when performing access control";
595              type string {
596                length "0 .. 32";
597              }
598            }
599            leaf tag {
600              description "Tag identifier for set of targets allowed to use this community string";
601              type string {
602                length "0 .. 255";
603              }
604            }
605          }
606        }
607        list proxy {
608          key name;
609          ordered-by user;
610          description "SNMP proxy configuration";
611          leaf name {
612            description "Unique proxy name";
613            type string;
614          }
615          uses apply-advanced;
616          leaf device-name {
617            description "Satellite/Proxied Device name or IP address";
618            type string;
619          }
620          choice version {
621            case case_1 {
622              container version-v1 {
623                description "For v1 proxy configuration define snmp-community";
624                uses comm-object;
625              }
626            }
627            case case_2 {
628              container version-v2c {
629                description "For v2c proxy configuration define snmp-community";
630                uses comm-object;
631              }
632            }
633            case case_3 {
634              container version-v3 {
635                description "For v3 proxy configuration define security-name";
636                uses sec-object;
637              }
638            }
639          }
640          list routing-instance {
641            key name;
642            ordered-by user;
643            description "Associate routing-instance name for proxy forwarding";
644            leaf name {
645              description "Routing-instance name for proxy forwarding";
646              type string;
647            }
648            uses apply-advanced;
649          }
650          list logical-system {
651            key name;
652            ordered-by user;
653            description "Associate logical-system name for proxy forwarding";
654            leaf name {
655              description "Associate logical-system name for proxy forwarding";
656              junos:must "(\".. .. logical-system $$ routing-instance\")";
657              junos:must-message "[routing-instance] must be configured for this logical-system";
658              type string {
659                junos:posix-pattern "^[a-zA-Z0-9_-]{1,63}$";
660                junos:pattern-message "Logical-system name is a string consisting of up to 63 letters, numbers, dashes and underscores";
661              }
662            }
663            uses apply-advanced;
664            list routing-instance {
665              key name;
666              ordered-by user;
667              description "Associate routing-instance name for proxy forwarding";
668              leaf name {
669                description "Routing-instance name for proxy forwarding";
670                type string;
671              }
672              uses apply-advanced;
673            }
674          }
675          leaf nfx-host {
676            description "Set routing-instance for NFX Host";
677            type empty;
678          }
679        }
680        container subagent {
681          description "SNMP subagent configuration";
682          uses apply-advanced;
683          container tcp {
684            presence "enable tcp";
685            description "Allow SNMP subagent tcp connection";
686            uses apply-advanced;
687            container routing-instance {
688              description "Specify routing-instance name for tcp connection";
689              uses apply-advanced;
690              leaf default {
691                description "Allow connections over default routing-instance";
692                type empty;
693              }
694            }
695          }
696        }
697        container engine-id {
698          description "SNMPv3 engine ID";
699          uses apply-advanced;
700          choice engine-id-choice {
701            case case_1 {
702              leaf use-mac-address {
703                description "Uses management interface MAC Address for the engine ID";
704                type empty;
705              }
706            }
707            case case_2 {
708              leaf use-default-ip-address {
709                description "Use default IP address for the engine ID";
710                type empty;
711              }
712            }
713            case case_3 {
714              leaf local {
715                description "Local engine ID";
716                type string {
717                  junos:posix-pattern "^.{1,27}$";
718                  junos:pattern-message "Must be a string of 27 characters or less";
719                }
720              }
721            }
722          }
723        }
724        container access {
725          description "SNMPv3 access information";
726          status deprecated;
727          uses apply-advanced;
728          list user {
729            key name;
730            ordered-by user;
731            description "SNMPv3 USM user information";
732            leaf name {
733              description "SNMPv3 USM username";
734              type string {
735                junos:posix-pattern "^.{1,32}$";
736                junos:pattern-message "Must be a string of 32 characters or less";
737              }
738            }
739            uses apply-advanced;
740            leaf authentication-type {
741              description "SNMPv3 USM authentication type";
742              type enumeration {
743                enum "none" {
744                  description "No authentication";
745                }
746                enum "md5" {
747                  description "MD5 hash algorithm";
748                }
749                enum "sha" {
750                  description "SHA hash algorithm";
751                }
752              }
753            }
754            leaf authentication-password {
755              description "SNMPv3 USM authentication password";
756              type jt:unreadable;
757            }
758            leaf privacy-type {
759              description "SNMPv3 USM privacy type";
760              type enumeration {
761                enum "none" {
762                  description "No privacy";
763                }
764                enum "des" {
765                  description "DES algorithm";
766                }
767              }
768            }
769            leaf privacy-password {
770              description "SNMPv3 USM privacy password";
771              type jt:unreadable;
772            }
773            list clients {
774              key name;
775              ordered-by user;
776              description "List of source address prefix ranges to accept";
777              leaf name {
778                description "Address or prefix";
779                type jt:ipprefix;
780              }
781              leaf restrict {
782                description "Deny access";
783                type empty;
784              }
785            }
786          }
787          list group {
788            key name;
789            ordered-by user;
790            description "SNMPv3 USM group information";
791            leaf name {
792              description "SNMPv3 USM group name";
793              type string {
794                junos:posix-pattern "^.{1,32}$";
795                junos:pattern-message "Must be a string of 32 characters or less";
796              }
797            }
798            uses apply-advanced;
799            leaf-list user {
800              ordered-by user;
801              description "SNMPv3 USM username";
802              type string;
803            }
804            leaf model {
805              description "SNMPv3 security model";
806              type enumeration {
807                enum "usm" {
808                  description "User-based security model";
809                }
810              }
811            }
812          }
813          list context {
814            key name;
815            ordered-by user;
816            description "SNMPv3 context information";
817            leaf name {
818              description "SNMPv3 context name";
819              type string {
820                junos:posix-pattern "^.{0,32}$";
821                junos:pattern-message "Must be a string of 32 characters or less";
822              }
823            }
824            uses apply-advanced;
825            leaf description {
826              description "SNMPv3 context description";
827              type string;
828            }
829            list group {
830              key name;
831              ordered-by user;
832              description "Access group";
833              leaf name {
834                description "SNMPv3 USM group name";
835                type string {
836                  junos:posix-pattern "^.{1,32}$";
837                  junos:pattern-message "Must be a string of 32 characters or less";
838                }
839              }
840              uses apply-advanced;
841              leaf model {
842                description "SNMPv3 security model";
843                type enumeration {
844                  enum "usm" {
845                    description "User-based security model";
846                  }
847                }
848              }
849              leaf security-level {
850                description "SNMPv3 security level";
851                type enumeration {
852                  enum "none" {
853                    description "None: NoAuthNoPriv";
854                  }
855                  enum "authentication" {
856                    description "Authentication: AuthNoPriv";
857                  }
858                  enum "privacy" {
859                    description "Privacy: AuthPriv";
860                  }
861                }
862              }
863              leaf read-view {
864                description "Read view name";
865                type string {
866                  junos:posix-pattern "^.{1,32}$";
867                  junos:pattern-message "Must be a string of 32 characters or less";
868                }
869              }
870              leaf write-view {
871                description "Write view name";
872                type string {
873                  junos:posix-pattern "^.{1,32}$";
874                  junos:pattern-message "Must be a string of 32 characters or less";
875                }
876              }
877            }
878          }
879        }
880        list view {
881          key name;
882          ordered-by user;
883          description "Define MIB views";
884          leaf name {
885            description "MIB view name";
886            type string {
887              junos:posix-pattern "^.{1,32}$";
888              junos:pattern-message "Must be a string of 32 characters or less";
889            }
890          }
891          uses apply-advanced;
892          list oid {
893            key name;
894            ordered-by user;
895            description "OID include/exclude list";
896            leaf name {
897              description "OID to include or exclude from view";
898              type string {
899                junos:posix-pattern "^(.?1|[a-zA-Z][a-zA-Z0-9]*)(.[0-9]+|[.][*]|[.][a-zA-Z])*$";
900                junos:pattern-message "Must be an OID of the form 1.x.*.z... or objname[.x.*.z]";
901              }
902            }
903            choice view-action {
904              case case_1 {
905                leaf include {
906                  description "Include this OID in the view";
907                  type empty;
908                }
909              }
910              case case_2 {
911                leaf exclude {
912                  description "Exclude this OID from the view";
913                  type empty;
914                }
915              }
916            }
917          }
918        }
919        list client-list {
920          key name;
921          ordered-by user;
922          description "Client list";
923          leaf name {
924            description "The name for the client list";
925            type string {
926              junos:posix-pattern "^.{1,128}$";
927              junos:pattern-message "Must be a string of 128 characters or less";
928            }
929          }
930          uses apply-advanced;
931          list client-address-list {
932            key name;
933            ordered-by user;
934            description "Client address list";
935            uses client-address-object;
936          }
937        }
938        list community {
939          key name;
940          ordered-by user;
941          description "Configure a community string";
942          leaf name {
943            description "Community name";
944            type string;
945          }
946          uses apply-advanced;
947          leaf view {
948            description "View name";
949            type string;
950          }
951          leaf authorization {
952            description "Authorization type";
953            type enumeration {
954              enum "read-only" {
955                description "Allow read-only access";
956              }
957              enum "read-write" {
958                description "Allow read and write access";
959              }
960            }
961          }
962          choice clients_choice {
963            case case_1 {
964              leaf client-list-name {
965                description "The name of client list or prefix list";
966                type string {
967                  junos:posix-pattern "^.{1,128}$";
968                  junos:pattern-message "Must be a string of 128 characters or less";
969                }
970              }
971            }
972            case case_2 {
973              list clients {
974                key name;
975                ordered-by user;
976                description "List of source address prefix ranges to accept";
977                leaf name {
978                  description "Address or prefix";
979                  type jt:ipprefix;
980                }
981                leaf restrict {
982                  description "Deny access";
983                  type empty;
984                }
985              }
986            }
987          }
988          list routing-instances {
989            key name;
990            ordered-by user;
991            description "Use logical-system/routing-instance for v1/v2c clients";
992            status deprecated;
993            leaf name {
994              description "Routing instance of v1/v2c clients";
995              junos:must "(\"snmp routing-instance-access\")";
996              junos:must-message "[snmp routing-instance-access] must be configured";
997              type string {
998                junos:posix-pattern "!^(([*]{1,})|(__.*__)|(.{194,}))$";
999                junos:pattern-message "Must be a non-reserved string of 193 characters or less";
1000              }
1001            }
1002            uses apply-advanced;
1003            choice clients_choice {
1004              case case_1 {
1005                leaf client-list-name {
1006                  description "The name of client list or prefix list";
1007                  type string {
1008                    junos:posix-pattern "^.{1,128}$";
1009                    junos:pattern-message "Must be a string of 128 characters or less";
1010                  }
1011                }
1012              }
1013              case case_2 {
1014                list clients {
1015                  key name;
1016                  ordered-by user;
1017                  description "List of source address prefix ranges to accept";
1018                  leaf name {
1019                    description "Address or prefix";
1020                    type jt:ipprefix;
1021                  }
1022                  leaf restrict {
1023                    description "Deny access";
1024                    type empty;
1025                  }
1026                }
1027              }
1028            }
1029          }
1030          list routing-instance {
1031            key name;
1032            ordered-by user;
1033            description "Use routing-instance name for v1/v2c clients";
1034            leaf name {
1035              description "Routing instance of v1/v2c clients";
1036              junos:must "(\"snmp routing-instance-access\")";
1037              junos:must-message "[snmp routing-instance-access] must be configured";
1038              type string {
1039                junos:posix-pattern "!^((__.*__)|(all)|(.*[ ].*)|(\"\")|(.{129,}))$";
1040                junos:pattern-message "Must be a non-reserved string of 128 characters or less with no spaces.";
1041              }
1042            }
1043            uses apply-advanced;
1044            choice clients_choice {
1045              case case_1 {
1046                leaf client-list-name {
1047                  description "The name of client list or prefix list";
1048                  type string {
1049                    junos:posix-pattern "^.{1,128}$";
1050                    junos:pattern-message "Must be a string of 128 characters or less";
1051                  }
1052                }
1053              }
1054              case case_2 {
1055                list clients {
1056                  key name;
1057                  ordered-by user;
1058                  description "List of source address prefix ranges to accept";
1059                  leaf name {
1060                    description "Address or prefix";
1061                    type jt:ipprefix;
1062                  }
1063                  leaf restrict {
1064                    description "Deny access";
1065                    type empty;
1066                  }
1067                }
1068              }
1069            }
1070          }
1071          list logical-system {
1072            key name;
1073            ordered-by user;
1074            description "Use logical-system name for v1/v2c clients";
1075            leaf name {
1076              description "Use logical-system name for v1/v2c clients";
1077              junos:must "(\".. .. logical-system $$ routing-instance\")";
1078              junos:must-message "[routing-instance] must be configured for this logical-system";
1079              type string {
1080                junos:posix-pattern "^[a-zA-Z0-9_-]{1,63}$";
1081                junos:pattern-message "Logical-system name is a string consisting of up to 63 letters, numbers, dashes and underscores";
1082              }
1083            }
1084            uses apply-advanced;
1085            list routing-instance {
1086              key name;
1087              ordered-by user;
1088              description "Use routing-instance name for v1/v2c clients";
1089              leaf name {
1090                description "Routing instance of v1/v2c clients";
1091                junos:must "(\"snmp routing-instance-access\")";
1092                junos:must-message "[snmp routing-instance-access] must be configured";
1093                type string {
1094                  junos:posix-pattern "!^((__.*__)|(all)|(.*[ ].*)|(\"\")|(.{129,}))$";
1095                  junos:pattern-message "Must be a non-reserved string of 128 characters or less with no spaces.";
1096                }
1097              }
1098              uses apply-advanced;
1099              choice clients_choice {
1100                case case_1 {
1101                  leaf client-list-name {
1102                    description "The name of client list or prefix list";
1103                    type string {
1104                      junos:posix-pattern "^.{1,128}$";
1105                      junos:pattern-message "Must be a string of 128 characters or less";
1106                    }
1107                  }
1108                }
1109                case case_2 {
1110                  list clients {
1111                    key name;
1112                    ordered-by user;
1113                    description "List of source address prefix ranges to accept";
1114                    leaf name {
1115                      description "Address or prefix";
1116                      type jt:ipprefix;
1117                    }
1118                    leaf restrict {
1119                      description "Deny access";
1120                      type empty;
1121                    }
1122                  }
1123                }
1124              }
1125            }
1126          }
1127        }
1128        container trap-options {
1129          presence "enable trap-options";
1130          description "SNMP trap options";
1131          uses apply-advanced;
1132          container source-address {
1133            description "IPv4/IPv6 source address for trap PDUs";
1134            uses apply-advanced;
1135            choice address-choice {
1136              case case_1 {
1137                leaf lo0 {
1138                  description "Use lowest address on loopback interface";
1139                  type empty;
1140                }
1141              }
1142              case case_2 {
1143                leaf address {
1144                  description "Use specified address";
1145                  type jt:ipaddr;
1146                }
1147              }
1148            }
1149          }
1150          leaf enterprise-oid {
1151            description "Add snmpTrapEnterprise oid in varbind of all traps";
1152            type empty;
1153          }
1154          leaf context-oid {
1155            description "Add context oid in varbind of all traps at the end";
1156            type empty;
1157          }
1158          list routing-instances {
1159            key name;
1160            ordered-by user;
1161            description "Use routing-instance name for source-address";
1162            status deprecated;
1163            leaf name {
1164              description "Routing instance of trap destination";
1165              junos:must "(\".. source-address\")";
1166              junos:must-message "source-address must be configured";
1167              type string {
1168                junos:posix-pattern "!^(([*]{1,})|(__.*__)|(.{194,}))$";
1169                junos:pattern-message "Must be a non-reserved string of 193 characters or less";
1170              }
1171            }
1172            uses apply-advanced;
1173            container source-address {
1174              description "IPv4/IPv6 source address for trap PDUs";
1175              uses apply-advanced;
1176              choice address-choice {
1177                case case_1 {
1178                  leaf lo0 {
1179                    description "Use lowest address on loopback interface";
1180                    type empty;
1181                  }
1182                }
1183                case case_2 {
1184                  leaf address {
1185                    description "Use specified address";
1186                    type jt:ipaddr;
1187                  }
1188                }
1189              }
1190            }
1191          }
1192          list routing-instance {
1193            key name;
1194            ordered-by user;
1195            description "Use routing-instance name for source-address";
1196            leaf name {
1197              description "Routing instance of trap destination";
1198              junos:must "(\".. source-address\")";
1199              junos:must-message "source-address must be configured";
1200              type string {
1201                junos:posix-pattern "!^((__.*__)|(all)|(.*[ ].*)|(\"\")|(.{129,}))$";
1202                junos:pattern-message "Must be a non-reserved string of 128 characters or less with no spaces.";
1203              }
1204            }
1205            uses apply-advanced;
1206            container source-address {
1207              description "IPv4/IPv6 source address for trap PDUs";
1208              uses apply-advanced;
1209              choice address-choice {
1210                case case_1 {
1211                  leaf lo0 {
1212                    description "Use lowest address on loopback interface";
1213                    type empty;
1214                  }
1215                }
1216                case case_2 {
1217                  leaf address {
1218                    description "Use specified address";
1219                    type jt:ipaddr;
1220                  }
1221                }
1222              }
1223            }
1224          }
1225          list logical-system {
1226            key name;
1227            ordered-by user;
1228            description "Use logical-system name for source-address";
1229            leaf name {
1230              description "Use logical-system name for source-address";
1231              junos:must "(\".. .. logical-system $$ routing-instance\")";
1232              junos:must-message "[routing-instance] must be configured for this logical-system";
1233              type string {
1234                junos:posix-pattern "^[a-zA-Z0-9_-]{1,63}$";
1235                junos:pattern-message "Logical-system name is a string consisting of up to 63 letters, numbers, dashes and underscores";
1236              }
1237            }
1238            uses apply-advanced;
1239            list routing-instance {
1240              key name;
1241              ordered-by user;
1242              description "Use routing-instance name for source-address";
1243              leaf name {
1244                description "Routing instance of trap destination";
1245                junos:must "(\".. source-address\")";
1246                junos:must-message "source-address must be configured";
1247                type string {
1248                  junos:posix-pattern "!^((__.*__)|(all)|(.*[ ].*)|(\"\")|(.{129,}))$";
1249                  junos:pattern-message "Must be a non-reserved string of 128 characters or less with no spaces.";
1250                }
1251              }
1252              uses apply-advanced;
1253              container source-address {
1254                description "IPv4/IPv6 source address for trap PDUs";
1255                uses apply-advanced;
1256                choice address-choice {
1257                  case case_1 {
1258                    leaf lo0 {
1259                      description "Use lowest address on loopback interface";
1260                      type empty;
1261                    }
1262                  }
1263                  case case_2 {
1264                    leaf address {
1265                      description "Use specified address";
1266                      type jt:ipaddr;
1267                    }
1268                  }
1269                }
1270              }
1271            }
1272          }
1273          leaf agent-address {
1274            description "Agent address for v1 trap PDUs";
1275            type enumeration {
1276              enum "outgoing-interface" {
1277                description "Use address on outgoing interface";
1278              }
1279            }
1280          }
1281        }
1282        list trap-group {
1283          key name;
1284          ordered-by user;
1285          description "Configure traps and notifications";
1286          leaf name {
1287            description "Trap group name";
1288            type string;
1289          }
1290          uses apply-advanced;
1291          leaf version {
1292            description "SNMP version";
1293            type enumeration {
1294              enum "all" {
1295                description "Send SNMPv1 and SNMPv2 traps";
1296              }
1297              enum "v1" {
1298                description "Send SNMPv1 traps";
1299              }
1300              enum "v2" {
1301                description "Send SNMPv2 traps";
1302              }
1303            }
1304          }
1305          leaf destination-port {
1306            description "SNMP trap receiver port number";
1307            type union {
1308              type int32;
1309              type string {
1310                pattern "<.*>|$.*";
1311              }
1312            }
1313          }
1314          container categories {
1315            description "Trap categories";
1316            uses apply-advanced;
1317            leaf authentication {
1318              description "Authentication failures";
1319              type empty;
1320            }
1321            leaf chassis {
1322              description "Chassis or environment notifications";
1323              type empty;
1324            }
1325            leaf link {
1326              description "Link up-down transitions";
1327              type empty;
1328            }
1329            leaf remote-operations {
1330              description "Remote operations";
1331              type empty;
1332            }
1333            leaf routing {
1334              description "Routing protocol notifications";
1335              type empty;
1336            }
1337            leaf startup {
1338              description "System warm and cold starts";
1339              type empty;
1340            }
1341            leaf ggsn {
1342              description "GGSN notifications";
1343              type empty;
1344            }
1345            leaf rmon-alarm {
1346              description "RMON rising and falling alarms";
1347              type empty;
1348            }
1349            leaf vrrp-events {
1350              description "VRRP notifications";
1351              type empty;
1352            }
1353            leaf configuration {
1354              description "Configuration notifications";
1355              type empty;
1356            }
1357            leaf services {
1358              description "Services notifications";
1359              type empty;
1360            }
1361            leaf chassis-cluster {
1362              description "Clustering notifications";
1363              type empty;
1364            }
1365            leaf timing-events {
1366              description "Timing defects/events notifications";
1367              type empty;
1368            }
1369            leaf dot3oam-events {
1370              description "802.3ah notifications";
1371              type empty;
1372            }
1373            container sonet-alarms {
1374              presence "enable sonet-alarms";
1375              description "SONET alarm trap subcategories";
1376              uses apply-advanced;
1377              leaf loss-of-light {
1378                description "Loss of light alarm notification";
1379                type empty;
1380              }
1381              leaf pll-lock {
1382                description "PLL lock alarm notification";
1383                type empty;
1384              }
1385              leaf loss-of-frame {
1386                description "Loss of frame alarm notification";
1387                type empty;
1388              }
1389              leaf loss-of-signal {
1390                description "Loss of signal alarm notification";
1391                type empty;
1392              }
1393              leaf severely-errored-frame {
1394                description "Severely errored frame alarm notification";
1395                type empty;
1396              }
1397              leaf line-ais {
1398                description "Line AIS alarm notification";
1399                type empty;
1400              }
1401              leaf path-ais {
1402                description "Path AIS alarm notification";
1403                type empty;
1404              }
1405              leaf loss-of-pointer {
1406                description "Loss of pointer alarm notification";
1407                type empty;
1408              }
1409              leaf ber-defect {
1410                description "Sonet bit error rate alarm defect notification";
1411                type empty;
1412              }
1413              leaf ber-fault {
1414                description "Sonet bit error rate alarm fault notification";
1415                type empty;
1416              }
1417              leaf line-remote-defect-indication {
1418                description "Line Remote Defect Indication alarm notification";
1419                type empty;
1420              }
1421              leaf path-remote-defect-indication {
1422                description "Path Remote Defect Indication alarm notification";
1423                type empty;
1424              }
1425              leaf remote-error-indication {
1426                description "Remote Error Indication alarm notification";
1427                type empty;
1428              }
1429              leaf unequipped {
1430                description "Unequipped alarm notification";
1431                type empty;
1432              }
1433              leaf path-mismatch {
1434                description "Path mismatch alarm notification";
1435                type empty;
1436              }
1437              leaf loss-of-cell {
1438                description "Loss of Cell delineation alarm notification";
1439                type empty;
1440              }
1441              leaf vt-ais {
1442                description "VT AIS alarm notification";
1443                type empty;
1444              }
1445              leaf vt-loss-of-pointer {
1446                description "VT Loss Of Pointer alarm notification";
1447                type empty;
1448              }
1449              leaf vt-remote-defect-indication {
1450                description "VT Remote Defect Indication alarm notification";
1451                type empty;
1452              }
1453              leaf vt-unequipped {
1454                description "VT Unequipped alarm notification";
1455                type empty;
1456              }
1457              leaf vt-label-mismatch {
1458                description "VT label mismatch error notification";
1459                type empty;
1460              }
1461              leaf vt-loss-of-cell {
1462                description "VT Loss of Cell delineation notification";
1463                type empty;
1464              }
1465            }
1466            container otn-alarms {
1467              presence "enable otn-alarms";
1468              description "OTN alarm trap subcategories";
1469              uses apply-advanced;
1470              leaf oc-los {
1471                description "Loss of signal alarm notification";
1472                type empty;
1473              }
1474              leaf oc-lof {
1475                description "Loss of frame alarm notification";
1476                type empty;
1477              }
1478              leaf oc-lom {
1479                description "Loss of multiframe alarm notification";
1480                type empty;
1481              }
1482              leaf wavelength-lock {
1483                description "Wavelength lock alarm notification";
1484                type empty;
1485              }
1486              leaf otu-ais {
1487                description "OTU Alarm indication signal alarm notification";
1488                type empty;
1489              }
1490              leaf otu-bdi {
1491                description "OTU Backward defect indication alarm notification";
1492                type empty;
1493              }
1494              leaf otu-ttim {
1495                description "OTU Trace identification mismatch alarm notification";
1496                type empty;
1497              }
1498              leaf otu-iae {
1499                description "OTU Incoming alignment error alarm notification";
1500                type empty;
1501              }
1502              leaf otu-sd {
1503                description "OTU Signal degrade alarm notification";
1504                type empty;
1505              }
1506              leaf otu-sf {
1507                description "OTU Signal fail alarm notification";
1508                type empty;
1509              }
1510              leaf otu-fec-exe {
1511                description "OTU Fec excessive errors alarm notification";
1512                type empty;
1513              }
1514              leaf otu-fec-deg {
1515                description "OTU Fec degraded errors alarm notification";
1516                type empty;
1517              }
1518              leaf otu-bbe-threshold {
1519                description "OTU Background block error threshold alarm notification";
1520                type empty;
1521              }
1522              leaf otu-es-threshold {
1523                description "OTU Errored Second threshold alarm notification";
1524                type empty;
1525              }
1526              leaf otu-ses-threshold {
1527                description "OTU Severely Errored Second threshold alarm notification";
1528                type empty;
1529              }
1530              leaf otu-uas-threshold {
1531                description "OTU Unavailable Second threshold alarm notification";
1532                type empty;
1533              }
1534              leaf odu-ais {
1535                description "ODU Alarm indication signal alarm notification";
1536                type empty;
1537              }
1538              leaf odu-oci {
1539                description "ODU Open connection indicator alarm notification";
1540                type empty;
1541              }
1542              leaf odu-lck {
1543                description "ODU Locked alarm notification";
1544                type empty;
1545              }
1546              leaf odu-bdi {
1547                description "ODU Backward defect indication alarm notification";
1548                type empty;
1549              }
1550              leaf odu-ttim {
1551                description "ODU Trace identification mismatch alarm notification";
1552                type empty;
1553              }
1554              leaf odu-sd {
1555                description "ODU Signal degrade alarm notification";
1556                type empty;
1557              }
1558              leaf odu-sf {
1559                description "ODU Signal fail alarm notification";
1560                type empty;
1561              }
1562              leaf odu-rx-aps-change {
1563                description "ODU Receive APS change notification";
1564                type empty;
1565              }
1566              leaf odu-bbe-threshold {
1567                description "ODU Background block error threshold alarm notification";
1568                type empty;
1569              }
1570              leaf odu-es-threshold {
1571                description "ODU Errored Second threshold alarm notification";
1572                type empty;
1573              }
1574              leaf odu-ses-threshold {
1575                description "ODU Severely Errored Second threshold alarm notification";
1576                type empty;
1577              }
1578              leaf odu-uas-threshold {
1579                description "ODU Unavailable Second threshold alarm notification";
1580                type empty;
1581              }
1582              leaf opu-ptm {
1583                description "ODU Payload Type Mismatch alarm notification";
1584                type empty;
1585              }
1586            }
1587          }
1588          list targets {
1589            key name;
1590            ordered-by user;
1591            description "Targets for trap messages";
1592            leaf name {
1593              description "IP address";
1594              type jt:hostname;
1595            }
1596          }
1597          leaf routing-instance {
1598            description "Routing instance for trap destination";
1599            type string {
1600              junos:posix-pattern "!^(([*]{1,})|(__.*__)|(.{194,}))$";
1601              junos:pattern-message "Must be a non-reserved string of 193 characters or less";
1602            }
1603          }
1604          leaf logical-system {
1605            description "Logical-system name for trap destination";
1606            type string {
1607              junos:posix-pattern "^[a-zA-Z0-9_-]{1,63}$";
1608              junos:pattern-message "Logical-system name is a string consisting of up to 63 letters, numbers, dashes and underscores";
1609            }
1610          }
1611        }
1612        container routing-instance-access {
1613          presence "enable routing-instance-access";
1614          description "SNMP routing-instance options";
1615          uses apply-advanced;
1616          list access-list {
1617            key name;
1618            description "Allow/Deny SNMP access to routing-instances";
1619            leaf name {
1620              description "Routing-instance in format <name>, <prefix>* or *";
1621              junos:must "(!(\"snmp routing-instance-access access-list $$={default}\"))";
1622              junos:must-message "default routing-instance is always allowed";
1623              type string {
1624                junos:posix-pattern "!^((__.*__)|(.{194,}))$";
1625                junos:pattern-message "Must be a non-reserved string of 193 characters or less";
1626              }
1627            }
1628            leaf restrict {
1629              description "Deny access";
1630              type empty;
1631            }
1632          }
1633        }
1634        leaf logical-system-trap-filter {
1635          description "Allow only logical-system specific traps";
1636          type empty;
1637        }
1638        container traceoptions {
1639          description "Trace options for SNMP";
1640          uses apply-advanced;
1641          container memory-trace {
1642            presence "enable memory-trace";
1643            junos:must "(!(\"snmp traceoptions no-default-memory-trace\"))";
1644            junos:must-message "remove no-default-memory-trace config to activate memory-trace";
1645            description "Memory tracing information";
1646            uses apply-advanced;
1647            leaf size {
1648              description "Memory size reserved for tracing ";
1649              default "5120";
1650              units "kilobytes";
1651              type union {
1652                type string {
1653                  pattern "<.*>|$.*";
1654                }
1655                type uint32 {
1656                  range "1250 .. 12500";
1657                }
1658              }
1659            }
1660          }
1661          leaf no-remote-trace {
1662            description "Disable remote tracing";
1663            junos:must "(\"system tracing\")";
1664            junos:must-message "'no-remote-trace' is valid only when [system tracing] is configured";
1665            type empty;
1666          }
1667          container file {
1668            description "Trace file information";
1669            leaf size {
1670              description "Maximum trace file size";
1671              type string;
1672            }
1673            leaf files {
1674              description "Maximum number of trace files";
1675              default "10";
1676              type union {
1677                type string {
1678                  pattern "<.*>|$.*";
1679                }
1680                type uint32 {
1681                  range "2 .. 1000";
1682                }
1683              }
1684            }
1685            choice world-readable-choice {
1686              leaf world-readable {
1687                description "Allow any user to read the log file";
1688                type empty;
1689              }
1690              leaf no-world-readable {
1691                description "Don't allow any user to read the log file";
1692                type empty;
1693              }
1694            }
1695            leaf match {
1696              description "Regular expression for lines to be logged";
1697              type jt:regular-expression;
1698            }
1699          }
1700          list flag {
1701            key name;
1702            ordered-by user;
1703            description "Tracing parameters";
1704            leaf name {
1705              type enumeration {
1706                enum "timer" {
1707                  description "Trace internal timer events";
1708                }
1709                enum "protocol-timeouts" {
1710                  description "Trace SNMP request timeouts";
1711                }
1712                enum "pdu" {
1713                  description "Dump SNMP request/response packets";
1714                }
1715                enum "varbind-error" {
1716                  description "Trace varbind errors";
1717                }
1718                enum "routing-socket" {
1719                  description "Trace routing socket calls";
1720                }
1721                enum "interface-stats" {
1722                  description "Trace interface statistics (logical and physical)";
1723                }
1724                enum "subagent" {
1725                  description "Trace master-agent interations with sub-agents";
1726                }
1727                enum "general" {
1728                  description "Trace general events";
1729                }
1730                enum "nonvolatile-sets" {
1731                  description "Nonvolatile SNMP set request handling";
1732                }
1733                enum "all" {
1734                  description "Trace everything";
1735                }
1736              }
1737            }
1738          }
1739        }
1740        container rmon {
1741          presence "enable rmon";
1742          description "Remote Monitoring configuration";
1743          uses apply-advanced;
1744          list history {
1745            key name;
1746            ordered-by user;
1747            description "RMON history entries";
1748            leaf name {
1749              description "RMON history identifier";
1750              type union {
1751                type string {
1752                  pattern "<.*>|$.*";
1753                }
1754                type uint32 {
1755                  range "1 .. 65535";
1756                }
1757              }
1758            }
1759            uses apply-advanced;
1760            leaf interface {
1761              description "Enable RMON on this interface";
1762              type union {
1763                type jt:interface-name;
1764                type string {
1765                  pattern "<.*>|$.*";
1766                }
1767              }
1768            }
1769            leaf bucket-size {
1770              description "Requested buckets for the interface";
1771              default "50";
1772              type union {
1773                type string {
1774                  pattern "<.*>|$.*";
1775                }
1776                type uint32 {
1777                  range "1 .. 65535";
1778                }
1779              }
1780            }
1781            leaf interval {
1782              description "Interval between samples";
1783              default "1800";
1784              units "seconds";
1785              type union {
1786                type string {
1787                  pattern "<.*>|$.*";
1788                }
1789                type uint32 {
1790                  range "1 .. 2147483647";
1791                }
1792              }
1793            }
1794            leaf owner {
1795              description "Owner name of the entry";
1796              type string {
1797                junos:posix-pattern "^[[:alnum:]._-]{0,32}$";
1798                junos:pattern-message "Must be an alphanumberic string of 32 characters or less";
1799              }
1800            }
1801          }
1802          list alarm {
1803            key name;
1804            ordered-by user;
1805            description "RMON alarm entries";
1806            leaf name {
1807              description "RMON alarm identifier";
1808              type union {
1809                type string {
1810                  pattern "<.*>|$.*";
1811                }
1812                type uint32 {
1813                  range "1 .. 65535";
1814                }
1815              }
1816            }
1817            uses apply-advanced;
1818            leaf description {
1819              description "General description of alarm (stored in alarmOwner)";
1820              type string {
1821                junos:posix-pattern "^.{1,120}$";
1822                junos:pattern-message "Must be a string of 120 characters or less";
1823              }
1824            }
1825            leaf interval {
1826              description "Interval between samples";
1827              default "60";
1828              units "seconds";
1829              type union {
1830                type string {
1831                  pattern "<.*>|$.*";
1832                }
1833                type uint32 {
1834                  range "1 .. 2147483647";
1835                }
1836              }
1837            }
1838            leaf falling-threshold-interval {
1839              description "Interval between samples during falling-threshold test";
1840              default "2147483647";
1841              units "seconds";
1842              type union {
1843                type string {
1844                  pattern "<.*>|$.*";
1845                }
1846                type uint32 {
1847                  range "1 .. 2147483647";
1848                }
1849              }
1850            }
1851            leaf variable {
1852              description "OID of MIB variable to be monitored";
1853              type string {
1854                junos:posix-pattern "^([.]?1|[a-zA-Z][a-zA-Z0-9]*)([.]([a-zA-Z]|[0-9]+))*$";
1855                junos:pattern-message "Must be an OID of the form 1.x.y.z... or objname[.x.y.z] where x, y, & z are either numbers or a single letter";
1856              }
1857            }
1858            leaf sample-type {
1859              description "Method of sampling the selected variable";
1860              type enumeration {
1861                enum "absolute-value" {
1862                  description "Absolute sample value is used";
1863                }
1864                enum "delta-value" {
1865                  description "Difference between sampled values is used";
1866                }
1867              }
1868            }
1869            leaf request-type {
1870              description "Type of SNMP request to issue for alarm";
1871              default "get-request";
1872              type enumeration {
1873                enum "get-request" {
1874                  description "Get request";
1875                }
1876                enum "get-next-request" {
1877                  description "Get-next request";
1878                }
1879                enum "walk-request" {
1880                  description "Walk request";
1881                }
1882              }
1883            }
1884            leaf startup-alarm {
1885              description "The alarm that may be sent upon entry startup";
1886              default "rising-or-falling-alarm";
1887              type enumeration {
1888                enum "rising-alarm" {
1889                  description "Rising alarm may be sent at startup";
1890                }
1891                enum "falling-alarm" {
1892                  description "Falling alarm may be sent at startup";
1893                }
1894                enum "rising-or-falling-alarm" {
1895                  description "Rising or falling alarm may be sent at startup";
1896                }
1897              }
1898            }
1899            leaf rising-threshold {
1900              description "The rising threshold";
1901              type union {
1902                type int32;
1903                type string {
1904                  pattern "<.*>|$.*";
1905                }
1906              }
1907            }
1908            leaf falling-threshold {
1909              description "The falling threshold";
1910              default "2147483647";
1911              type union {
1912                type int32;
1913                type string {
1914                  pattern "<.*>|$.*";
1915                }
1916              }
1917            }
1918            leaf rising-event-index {
1919              description "Event triggered after rising threshold is crossed";
1920              default "0";
1921              type union {
1922                type string {
1923                  pattern "<.*>|$.*";
1924                }
1925                type int32 {
1926                  range "0 .. 65535";
1927                }
1928              }
1929            }
1930            leaf falling-event-index {
1931              description "Event triggered after falling threshold is crossed";
1932              default "0";
1933              type union {
1934                type string {
1935                  pattern "<.*>|$.*";
1936                }
1937                type int32 {
1938                  range "0 .. 65535";
1939                }
1940              }
1941            }
1942            leaf syslog-subtag {
1943              description "Tag to be added to syslog messages";
1944              type string {
1945                junos:posix-pattern "^[A-Z][A-Z0-9_]{0,79}$";
1946                junos:pattern-message "Must be a string of 80 upper case characters or less";
1947              }
1948            }
1949          }
1950          list event {
1951            key name;
1952            ordered-by user;
1953            description "RMON event entries";
1954            leaf name {
1955              description "RMON event identifier";
1956              type union {
1957                type string {
1958                  pattern "<.*>|$.*";
1959                }
1960                type uint32 {
1961                  range "1 .. 65535";
1962                }
1963              }
1964            }
1965            uses apply-advanced;
1966            leaf description {
1967              description "General description of event";
1968              type string {
1969                junos:posix-pattern "^.{1,127}$";
1970                junos:pattern-message "Must be a string of 127 characters or less";
1971              }
1972            }
1973            leaf type {
1974              description "The type of notification for this event";
1975              default "log-and-trap";
1976              type enumeration {
1977                enum "none" {
1978                  description "No notifications";
1979                }
1980                enum "log" {
1981                  description "Add entry to logTable";
1982                }
1983                enum "snmptrap" {
1984                  description "Send SNMP trap";
1985                }
1986                enum "log-and-trap" {
1987                  description "Send SNMP trap and make log entry";
1988                }
1989              }
1990            }
1991            leaf community {
1992              description "The community (trap group) for outgoing traps";
1993              type string {
1994                junos:posix-pattern "^.{1,127}$";
1995                junos:pattern-message "Must be a string of 127 characters or less";
1996              }
1997            }
1998          }
1999        }
2000        container health-monitor {
2001          presence "enable health-monitor";
2002          description "Health monitoring configuration";
2003          uses apply-advanced;
2004          leaf interval {
2005            description "Interval between samples";
2006            units "seconds";
2007            type union {
2008              type string {
2009                pattern "<.*>|$.*";
2010              }
2011              type uint32 {
2012                range "1 .. 2147483647";
2013              }
2014            }
2015          }
2016          leaf rising-threshold {
2017            description "Rising threshold applied to all monitored objects";
2018            units "percent";
2019            type union {
2020              type string {
2021                pattern "<.*>|$.*";
2022              }
2023              type uint32 {
2024                range "1 .. 100";
2025              }
2026            }
2027          }
2028          leaf falling-threshold {
2029            description "Falling threshold applied to all monitored objects";
2030            units "percent";
2031            type union {
2032              type string {
2033                pattern "<.*>|$.*";
2034              }
2035              type uint32 {
2036                range "0 .. 100";
2037              }
2038            }
2039          }
2040          container idp {
2041            presence "enable idp";
2042            description "IDP health monitor configuration";
2043            uses apply-advanced;
2044            leaf interval {
2045              description "Interval between samples";
2046              units "seconds";
2047              type union {
2048                type string {
2049                  pattern "<.*>|$.*";
2050                }
2051                type uint32 {
2052                  range "1 .. 2147483647";
2053                }
2054              }
2055            }
2056            leaf rising-threshold {
2057              description "Rising threshold applied to all monitored objects";
2058              units "percent";
2059              type union {
2060                type string {
2061                  pattern "<.*>|$.*";
2062                }
2063                type uint32 {
2064                  range "0 .. 100";
2065                }
2066              }
2067            }
2068            leaf falling-threshold {
2069              description "Falling threshold applied to all monitored objects";
2070              units "percent";
2071              type union {
2072                type string {
2073                  pattern "<.*>|$.*";
2074                }
2075                type uint32 {
2076                  range "0 .. 100";
2077                }
2078              }
2079            }
2080          }
2081        }
2082        container arp {
2083          presence "enable arp";
2084          description "JVision ARP settings";
2085          uses apply-advanced;
2086          leaf host-name-resolution {
2087            description "Enable host name resolution";
2088            type empty;
2089          }
2090        }
2091        container customization {
2092          description "Customize SNMP behaviour based on knob";
2093          uses apply-advanced;
2094          leaf ether-stats-ifd-only {
2095            description "To stop exposing IFLs as part of etherStatsTable";
2096            type empty;
2097          }
2098        }
2099      }
2100    }
2101    grouping apply-advanced {
2102      description "Apply advanced configuration logic";
2103      leaf-list apply-groups {
2104        ordered-by user;
2105        description "Groups from which to inherit configuration data";
2106        type string;
2107      }
2108      leaf-list apply-groups-except {
2109        ordered-by user;
2110        description "Don't inherit configuration data from these groups";
2111        type string;
2112      }
2113      list apply-macro {
2114        key name;
2115        ordered-by user;
2116        description "Macro and parameters for commit script expansion";
2117        uses apply-macro-type;
2118      }
2119    }
2120    grouping apply-macro-type {
2121      description "Macro data for commit-script expansion";
2122      leaf name {
2123        description "Name of the macro to be expanded";
2124        type string;
2125      }
2126      list data {
2127        key name;
2128        uses macro-data-type;
2129      }
2130    }
2131    grouping client-address-object {
2132      description "Client address";
2133      leaf name {
2134        description "Address or prefix";
2135        type jt:ipprefix;
2136      }
2137      uses apply-advanced;
2138      leaf restrict {
2139        description "Deny access";
2140        type empty;
2141      }
2142    }
2143    grouping comm-object {
2144      description "Specify snmp-community name";
2145      uses apply-advanced;
2146      leaf snmp-community {
2147        description "Specify community name";
2148        type string {
2149          length "1 .. 32";
2150        }
2151      }
2152      leaf no-default-comm-to-v3-config {
2153        description "No default snmp-community and v3 configuration";
2154        type empty;
2155      }
2156    }
2157    grouping macro-data-type {
2158      leaf name {
2159        description "Keyword part of the keyword-value pair";
2160        type string;
2161      }
2162      leaf value {
2163        description "Value part of the keyword-value pair";
2164        type string;
2165      }
2166    }
2167    grouping sec-object {
2168      description "Specify security-name";
2169      uses apply-advanced;
2170      leaf security-name {
2171        description "Specify v3 security-name";
2172        type string {
2173          length "1 .. 32";
2174        }
2175      }
2176      leaf context {
2177        description "Specify context name associated to this security-name";
2178        type string;
2179      }
2180    }
2181    grouping security-model-access {
2182      description "Security access configuration";
2183      leaf name {
2184        description "SNMPv3 VACM security model";
2185        type enumeration {
2186          enum "any" {
2187            description "Any security model";
2188          }
2189          enum "usm" {
2190            description "User-based security model";
2191          }
2192          enum "v1" {
2193            description "SNMPv1 model";
2194          }
2195          enum "v2c" {
2196            description "SNMPv2c model";
2197          }
2198        }
2199      }
2200      uses apply-advanced;
2201      list security-level {
2202        key name;
2203        ordered-by user;
2204        description "Security level access configuration";
2205        leaf name {
2206          description "SNMPv3 VACM security level";
2207          type enumeration {
2208            enum "none" {
2209              description "None (noAuthNoPriv)";
2210            }
2211            enum "authentication" {
2212              description "Authentication (authNoPriv)";
2213            }
2214            enum "privacy" {
2215              description "Privacy and authentication (authPriv)";
2216            }
2217          }
2218        }
2219        uses apply-advanced;
2220        leaf context-match {
2221          description "Type of match to perform on context-prefix";
2222          default "exact";
2223          type enumeration {
2224            enum "exact" {
2225              description "Exact match of prefix and context name";
2226            }
2227            enum "prefix" {
2228              description "Only match the context prefix";
2229            }
2230          }
2231        }
2232        leaf read-view {
2233          description "View used for read access";
2234          type string {
2235            junos:posix-pattern "^.{0,32}$";
2236            junos:pattern-message "Must be a string of 32 characters or less";
2237          }
2238        }
2239        leaf write-view {
2240          description "View used for write access";
2241          type string {
2242            junos:posix-pattern "^.{0,32}$";
2243            junos:pattern-message "Must be a string of 32 characters or less";
2244          }
2245        }
2246        leaf notify-view {
2247          description "View used to notifications";
2248          type string {
2249            junos:posix-pattern "^.{0,32}$";
2250            junos:pattern-message "Must be a string of 32 characters or less";
2251          }
2252        }
2253      }
2254    }
2255    grouping v3-user-config {
2256      description "SNMPv3 user configuration";
2257      leaf name {
2258        description "User name";
2259        type string {
2260          length "1 .. 32";
2261        }
2262      }
2263      uses apply-advanced;
2264      choice authentication {
2265        case case_1 {
2266          container authentication-md5 {
2267            description "Configure MD5 authentication";
2268            uses auth-object;
2269          }
2270        }
2271        case case_2 {
2272          container authentication-sha {
2273            description "Configure SHA authentication";
2274            uses auth-object;
2275          }
2276        }
2277        case case_3 {
2278          container authentication-sha224 {
2279            description "Configure SHA224 authentication";
2280            uses auth-object;
2281          }
2282        }
2283        case case_4 {
2284          container authentication-sha256 {
2285            description "Configure SHA256 authentication";
2286            uses auth-object;
2287          }
2288        }
2289        case case_5 {
2290          container authentication-sha384 {
2291            description "Configure SHA384 authentication";
2292            uses auth-object;
2293          }
2294        }
2295        case case_6 {
2296          container authentication-sha512 {
2297            description "Configure SHA512 authentication";
2298            uses auth-object;
2299          }
2300        }
2301        case case_7 {
2302          leaf authentication-none {
2303            description "Set no authentication for the user";
2304            type empty;
2305          }
2306        }
2307      }
2308      choice privacy {
2309        case case_1 {
2310          container privacy-des {
2311            description "Configure DES privacy";
2312            status deprecated;
2313            uses priv-object;
2314          }
2315        }
2316        case case_2 {
2317          container privacy-3des {
2318            description "Configure Triple DES privacy";
2319            uses priv-object;
2320          }
2321        }
2322        case case_3 {
2323          container privacy-aes128 {
2324            description "Configure AES128 privacy";
2325            uses priv-object;
2326          }
2327        }
2328        case case_4 {
2329          leaf privacy-none {
2330            description "Set no privacy for the user";
2331            type empty;
2332          }
2333        }
2334      }
2335    }
2336    grouping auth-object {
2337      description "Authentication parameters";
2338      uses apply-advanced;
2339      leaf authentication-password {
2340        description "User's authentication password";
2341        type string {
2342          length "8 .. 1024";
2343        }
2344      }
2345      leaf authentication-key {
2346        description "Encrypted key used for user authentication";
2347        type jt:unreadable;
2348      }
2349    }
2350    grouping priv-object {
2351      description "Privacy parameters";
2352      uses apply-advanced;
2353      leaf privacy-password {
2354        description "User's privacy password";
2355        type string {
2356          length "8 .. 1024";
2357        }
2358      }
2359      leaf privacy-key {
2360        description "Encrypted key used for user privacy";
2361        type jt:unreadable;
2362      }
2363    }
2364  }