626038d1169192917c469b3e0e32b47519985154
[sim/o1-interface.git] / ntsimulator / deploy / base / yang / nts-network-function.yang
1 module nts-network-function {
2   yang-version 1.1;
3   namespace "urn:o-ran-sc:params:xml:ns:yang:nts:network:function";
4   prefix ntsnf;
5
6   import nts-common {
7     prefix ntsc;
8   }
9   import ietf-yang-types {
10     prefix yang;
11   }
12
13   organization
14     "O-RAN-SC";
15   contact
16     " Web: <https://wiki.o-ran-sc.org/display/SIM/SIM>
17         Editors:
18         Alex Stancu <mailto:alexandru.stancu@highstreet-technologies.com>
19         Adrian Lita <mailto:adrian.lita@highstreet-technologies.com>
20         Martin Skorupski <mailto:martin.skorupski@highstreet-technologies.com>";
21   description
22     "This module contains YANG definitions for the Network Topology Simulator - Network Functions";
23
24   revision 2021-03-26 {
25     description
26       "Added info container, and expanted feature control mechanism and status.";
27     reference
28       "O-RAN-SC SIM project";
29   }
30   revision 2021-03-17 {
31     description
32       "Renamed datastore-random-populate RPC to datastore-populate";
33     reference
34       "O-RAN-SC SIM project";
35   }
36   revision 2020-12-11 {
37     description
38       "Added function-type to simulated function.";
39     reference
40       "O-RAN-SC SIM project";
41   }
42   revision 2020-11-30 {
43     description
44       "Cleared revision for nts-common import.";
45     reference
46       "O-RAN-SC SIM project";
47   }
48   revision 2020-10-28 {
49     description
50       "Add RPC for clearing the fault counters.";
51     reference
52       "O-RAN-SC SIM project";
53   }
54   revision 2020-10-13 {
55     description
56       "Add RPC for datastore populating and feature control.";
57     reference
58       "O-RAN-SC SIM project";
59   }
60   revision 2020-09-07 {
61     description
62       "Initial revision for the Network Topology Simulator - Next Generation";
63     reference
64       "O-RAN-SC SIM project";
65   }
66
67   rpc datastore-populate {
68     description
69       "Operation to populate the datastore with data for all the containing YANG models, based on settings in config.json";
70     output {
71       uses ntsc:rpc-status-g;
72     }
73   }
74
75   rpc feature-control {
76     description
77       "Operation to control the features in a Network Function.";
78     input {
79       leaf start-features {
80         type ntsc:feature-type;
81         description
82           "A bit-wise list with features to be activated.";
83       }
84       leaf stop-features {
85         type ntsc:feature-type;
86         description
87           "A bit-wise list with features to be deactivated.";
88       }
89     }
90     output {
91       uses ntsc:rpc-status-g;
92     }
93   }
94
95   rpc invoke-notification {
96     description
97       "Operation to control the features in a Network Function.";
98     input {
99       leaf notification-format {
100         type enumeration {
101           enum xml {
102             description
103               "The notification string is formatted as XML.";
104           }
105           enum json {
106             description
107               "The notification string is formatted as JSON.";
108           }
109         }
110         mandatory true;
111         description
112           "The format of the notification string.";
113       }
114       leaf notification-object {
115         type string;
116         mandatory true;
117         description
118           "A JSON string containing the notification object to be sent by the device.";
119       }
120     }
121     output {
122       uses ntsc:rpc-status-g;
123     }
124   }
125
126   rpc invoke-ves-pm-file-ready {
127     description
128       "Operation to generate a VES  notification from a Network Function.";
129     input {
130       leaf file-location {
131         type string;
132         mandatory true;
133         description
134           "A string containing the location of the file on the server.";
135       }
136     }
137     output {
138       uses ntsc:rpc-status-g;
139     }
140   }
141
142   rpc clear-fault-counters {
143     description
144       "Operation to clear the fault counters.";
145     output {
146       uses ntsc:rpc-status-g;
147     }
148   }
149
150   container info {
151     config false;
152     description
153       "Information about NTS application and modules.";
154     leaf build-time {
155       type yang:date-and-time;
156       description
157         "Build time of NTS application.";
158     }
159     leaf version {
160       type string;
161       description
162         "NTS version of current network-function.";
163     }
164     leaf started-features {
165       type ntsc:feature-type;
166       description
167         "A bit-wise list with currently started features.";
168     }
169   }
170   container simulation {
171     description
172       "Root level container which controls the Network Function.";
173     container network-function {
174       description
175         "Container which encompasses the details of the network function.";
176       leaf function-type {
177         type string;
178         description
179           "Type of network function that is simulated.";
180       }
181       uses ntsc:mount-point-details-g;
182       uses ntsc:faults-g;
183       uses ntsc:netconf-config-g;
184       uses ntsc:ves-config-g;
185     }
186     container sdn-controller {
187       description
188         "Groups details about the SDN Controller.";
189       uses ntsc:controller-g;
190     }
191     container ves-endpoint {
192       description
193         "Groups details about the VES Collector endpoint.";
194       uses ntsc:ves-endpoint-g;
195     }
196   }
197 }