27ab9eef658cfa62c7a541f6c68e031259cb52f9
[oam/tr069-adapter.git] / netconf-server / schemas / common / o-ran-file-management.yang
1 module o-ran-file-management {\r
2   yang-version 1.1;\r
3   namespace "urn:o-ran:file-management:1.0";\r
4   prefix "o-ran-file-mgmt";\r
5 \r
6   import ietf-crypto-types {\r
7     prefix "ct";\r
8   }\r
9 \r
10 \r
11   organization "O-RAN Alliance";\r
12 \r
13   contact\r
14     "www.o-ran.org";\r
15 \r
16   description\r
17     "This module defines the configuration and operations for handling upload.\r
18 \r
19     Copyright 2019 the O-RAN Alliance.\r
20 \r
21     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'\r
22     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
23     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
24     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r
25     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
26     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
27     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
28     INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
29     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
30     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
31     POSSIBILITY OF SUCH DAMAGE.\r
32 \r
33     Redistribution and use in source and binary forms, with or without\r
34     modification, are permitted provided that the following conditions are met:\r
35 \r
36     * Redistributions of source code must retain the above copyright notice,\r
37     this list of conditions and the above disclaimer.\r
38     * Redistributions in binary form must reproduce the above copyright notice,\r
39     this list of conditions and the above disclaimer in the documentation\r
40     and/or other materials provided with the distribution.\r
41     * Neither the Members of the O-RAN Alliance nor the names of its\r
42     contributors may be used to endorse or promote products derived from\r
43     this software without specific prior written permission.";\r
44 \r
45   revision "2019-07-03" {\r
46     description\r
47       "version 1.1.0\r
48 \r
49       1) backward compatible changes to correct sFTP Server Authentication .\r
50       2) minor fixes according to lack of descriptions\r
51       3) backward compatible changes to introduce groupings";\r
52 \r
53     reference "ORAN-WG4.M.0-v01.00";\r
54   }\r
55 \r
56   revision "2019-02-04" {\r
57     description\r
58       "version 1.0.0\r
59 \r
60       1) imported model from xRAN\r
61       2) changed namespace and reference from xran to o-ran";\r
62 \r
63     reference "ORAN-WG4.M.0-v01.00";\r
64   }\r
65 \r
66   grouping file-path-grouping {\r
67     description "Complete logical path of the file to upload/download\r
68     (no wildcard is allowed) ex : /o-RAN/log/syslog.1";\r
69 \r
70     leaf local-logical-file-path {\r
71       type string;\r
72       mandatory true;\r
73       description "Local logical file path";\r
74     }\r
75 \r
76     leaf remote-file-path {\r
77       type string;\r
78       mandatory true;\r
79       description "URI specifying the remote-file-path on O-DU/NMS.\r
80       Format:sftp://<username>@<host>[:port]/path";\r
81     }\r
82   }\r
83 \r
84   grouping output-status-grouping {\r
85     description "Status grouping";\r
86 \r
87     leaf status {\r
88       type enumeration {\r
89         enum SUCCESS {\r
90             description "";}\r
91         enum FAILURE {\r
92             description "";}\r
93       }\r
94       description "Operation status";\r
95       }\r
96 \r
97     leaf reject-reason {\r
98       when "../status = 'FAILURE'";\r
99       type string;\r
100       description "";\r
101     }\r
102   }\r
103 \r
104   grouping credential-information {\r
105     description "Type of authentication to use for SFTP upload or download.";\r
106     choice credentials {\r
107       case password {\r
108         container password {\r
109           presence true;\r
110           leaf password {\r
111             type string;\r
112             mandatory true;\r
113             description\r
114               "password needed for O-RU authentication.";\r
115           }\r
116           description\r
117             "password for O-RU authentication method in use";\r
118         }\r
119         container server {\r
120           list keys {\r
121             key algorithm;\r
122             ordered-by user;\r
123             uses ct:public-key-grouping;\r
124             description\r
125               "List of allowed algorithms with its keys";\r
126           }\r
127           description\r
128             "Key for sFTP server authentication";\r
129         }\r
130       }\r
131       case certificate {\r
132         container certificate {\r
133           presence true;\r
134           description\r
135             "certificate authentication method in use";\r
136         }\r
137       }\r
138      description "";\r
139     }\r
140   }\r
141 \r
142   grouping retrieve-input {\r
143     description "Grouping for information retrieval RPC input";\r
144     leaf logical-path {\r
145       type string;\r
146       mandatory true;\r
147       description "O-RAN unit of which the files are to be listed.\r
148       ex :  O-RAN/log, o-RAN/PM, O-RAN/transceiver";\r
149     }\r
150     leaf file-name-filter {\r
151       type string;\r
152       description "Filter which are to be applied on the result list of file names (* is allowed as wild-card).";\r
153     }\r
154   }\r
155 \r
156   grouping retrieve-output {\r
157     description "Grouping for information retrieval RPC output";\r
158     uses output-status-grouping;\r
159     leaf-list file-list {\r
160       when "../status = 'SUCCESS'";\r
161       type string;\r
162       description "List of files in the unit with the filter applied.";\r
163     }\r
164   }\r
165 \r
166 // RPCs\r
167 \r
168   rpc file-upload {\r
169     description "File upload over SFTP from equipment to NETCONF client";\r
170     input {\r
171       uses file-path-grouping;\r
172       uses credential-information;\r
173     }\r
174     output {\r
175       uses output-status-grouping;\r
176     }\r
177   }\r
178 \r
179   rpc retrieve-file-list {\r
180     description "List all the files in the logical O-RAN unit (* is allowed as wild-card).";\r
181     input {\r
182       uses retrieve-input;\r
183 \r
184     }\r
185     output {\r
186       uses retrieve-output;\r
187     }\r
188   }\r
189 \r
190   notification file-upload-notification {\r
191     uses file-path-grouping;\r
192     uses output-status-grouping;\r
193     description "";\r
194   }\r
195 \r
196   rpc file-download {\r
197     description\r
198       "Management plane triggered to generate the download file of O-RU.";\r
199     input {\r
200       uses file-path-grouping;\r
201       uses credential-information;\r
202     }\r
203     output {\r
204       uses output-status-grouping;\r
205     }\r
206   }\r
207 \r
208   notification file-download-event {\r
209     uses file-path-grouping;\r
210     uses output-status-grouping;\r
211     description "";\r
212   }\r
213 }\r