Support of WG4 OpenFronthaul Management-Plane VES
[scp/oam/modeling.git] / data-model / yang / working / o-ran-sc / template / o-ran-sc-alarms-v1.yang
1 module o-ran-sc-alarms-v1 {
2   yang-version 1.1;
3   namespace "urn:o-ran-sc:yang:o-ran-sc-alarms-v1";
4   prefix oal;
5
6   import o-ran-sc-root-v1 {
7     prefix root;
8   }
9   import ietf-alarms {
10     prefix al;
11     reference
12       "RFC 8632: A YANG Data Model for Alarm Management";
13   }
14
15   organization
16     "O-RAN Software Community";
17   contact
18     "www.o-ran-sc.org";
19   description
20     "This module augments the  o-ran-sc-controlled-element and
21      o-ran-sc-controlled-function object by adding ietf-alarms.
22
23      Copyright 2021 the O-RAN Software Community.
24
25      Licensed under the Apache License, Version 2.0 (the 'License');
26      you may not use this file except in compliance with the License.
27      You may obtain a copy of the License at
28
29      http://www.apache.org/licenses/LICENSE-2.0
30
31      Unless required by applicable law or agreed to in writing, software
32      distributed under the License is distributed on an 'AS IS' BASIS,
33      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34      See the License for the specific language governing permissions and
35      limitations under the License.";
36
37   revision 2021-03-09 {
38     description
39       "The namespace was updated according to O-RAN-SC yang guidelines.
40        The namespace must end with the full module name.";
41     reference
42       "https://jira.o-ran-sc.org/browse/OAM-168";
43   }
44   revision 2020-03-09 {
45     description
46       "initial revision";
47     reference
48       "O-RAN-OAM-Interface-Specification (O1)";
49   }
50
51   grouping alarms-grp {
52     list alarm-reference {
53       key "resource alarm-type-id alarm-type-qualifier";
54       config false;
55       description
56         "References to related alarms. Note that the related alarm
57          might have been purged from the alarm list.";
58       leaf resource {
59         type leafref {
60           path "/al:alarms/al:alarm-list/al:alarm/al:resource";
61           require-instance false;
62         }
63         description
64           "The alarming resource for the related alarm.";
65       }
66       leaf alarm-type-id {
67         type leafref {
68           path "/al:alarms/al:alarm-list/al:alarm"
69              + "[al:resource=current()/../resource]"
70              + "/al:alarm-type-id";
71           require-instance false;
72         }
73         description
74           "The alarm type identifier for the related alarm.";
75       }
76       leaf alarm-type-qualifier {
77         type leafref {
78           path "/al:alarms/al:alarm-list/al:alarm"
79              + "[al:resource=current()/../resource]"
80              + "[al:alarm-type-id=current()/../alarm-type-id]"
81              + "/al:alarm-type-qualifier";
82           require-instance false;
83         }
84         description
85           "The alarm qualifier for the related alarm.";
86       }
87     }
88     description
89       "A group adding ietf-alarm references.";
90   }
91
92   augment "/root:controlled-element" {
93     uses alarms-grp;
94     description
95       "An augmentation, which adds ietf-alarms
96        to root:controlled-element.";
97   }
98
99   augment "/root:controlled-element/root:controlled-function" {
100     uses alarms-grp;
101     description
102       "An augmentation, which adds ietf-alarms
103        to root:controlled-function.";
104   }
105 }