Support of WG4 OpenFronthaul Management-Plane VES
[scp/oam/modeling.git] / data-model / yang / published / o-ran / ru-fh / o-ran-file-management@2022-08-15.yang
1 module o-ran-file-management {
2   yang-version 1.1;
3   namespace "urn:o-ran:file-management:1.0";
4   prefix "o-ran-file-mgmt";
5
6   import ietf-crypto-types {
7     prefix "ct";
8     revision-date "2019-04-29";
9   }
10
11
12   organization "O-RAN Alliance";
13
14   contact
15     "www.o-ran.org";
16
17   description
18     "This module defines the configuration and operations for handling upload.
19
20     Copyright 2021 the O-RAN Alliance.
21
22     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
23     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29     INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32     POSSIBILITY OF SUCH DAMAGE.
33
34     Redistribution and use in source and binary forms, with or without
35     modification, are permitted provided that the following conditions are met:
36
37     * Redistributions of source code must retain the above copyright notice,
38     this list of conditions and the above disclaimer.
39     * Redistributions in binary form must reproduce the above copyright notice,
40     this list of conditions and the above disclaimer in the documentation
41     and/or other materials provided with the distribution.
42     * Neither the Members of the O-RAN Alliance nor the names of its
43     contributors may be used to endorse or promote products derived from
44     this software without specific prior written permission.";
45
46   revision "2022-08-15" {
47     description
48       "version 10.0.0
49
50       1) added password for FTPES
51       2) clarified path/folder description ";
52
53     reference "ORAN-WG4.M.0-v10.00";
54   }
55
56   revision "2021-12-01" {
57     description
58       "version 7.1.0
59
60       1) typographical corrections";
61
62     reference "ORAN-WG4.M.0-v07.00";
63   }
64
65   revision "2021-07-26" {
66     description
67       "version 7.0.0
68
69       1) added FTPES support";
70
71     reference "ORAN-WG4.M.0-v07.00";
72   }
73
74   revision "2019-07-03" {
75     description
76       "version 1.1.0
77
78       1) backward compatible changes to correct sFTP Server Authentication .
79       2) minor fixes according to lack of descriptions
80       3) backward compatible changes to introduce groupings";
81
82     reference "ORAN-WG4.M.0-v01.00";
83   }
84
85   revision "2019-02-04" {
86     description
87       "version 1.0.0
88
89       1) imported model from xRAN
90       2) changed namespace and reference from xran to o-ran";
91
92     reference "ORAN-WG4.M.0-v01.00";
93   }
94
95   grouping file-path-grouping {
96     description "Grouping, that provides local path and remote path for the
97     purpose of File Management scenarios.";
98
99
100     leaf local-logical-file-path {
101       type string;
102       mandatory true;
103       description "URI specifying the complete logical path relative to the root of the logical file system
104       structure (the common root for o-ran/log, o-ran/pm, o-ran/transceiver or o-ran/beamforming) of the file
105       to upload/download (no wildcard is allowed), including a file name and its extension.
106       Example: 'o-ran/log/file_1.abc', where 'o-ran/log/' represents relative path to folder containing log files
107       as specified by O-RAN, 'file_1' represents desired filename and 'abc' represents desired filename's extension.
108       The content shall conform to RFC3986 'Uniform Resource Identifier (URI): Generic Syntax'";
109     }
110
111     leaf remote-file-path {
112       type string;
113       mandatory true;
114       description "URI specifying the remote-file-path on O-DU/SMO or on stand-alone file server.
115       The content shall conform to RFC3986 'Uniform Resource Identifier (URI): Generic Syntax'.
116       When upload/download is via sftp, the format shall be of the form
117       sftp://<username>@<host>[:port]/path
118       When upload/download is via ftpes, the format shall be of the form
119       ftpes://<username>@<host>[:port]/path
120
121       Note, ftpes is not an IANA registered URI scheme, but used here to signal
122       that a file transfer should be performed over FTPES";
123     }
124   }
125
126   grouping output-status-grouping {
127     description "Status grouping";
128
129     leaf status {
130       type enumeration {
131         enum SUCCESS {
132             description "";}
133         enum FAILURE {
134             description "";}
135       }
136       description "Operation status";
137       }
138
139     leaf reject-reason {
140       when "../status = 'FAILURE'";
141       type string;
142       description "";
143     }
144   }
145
146   grouping credential-information {
147     description "Type of authentication to use for file upload or download.";
148     choice credentials {
149       case password {
150         container password {
151           presence true;
152           leaf password {
153             type string;
154             mandatory true;
155             description
156               "password used for O-RU authentication to sFTP server for the associated username defined in the remote-file-path.";
157           }
158           description
159             "password for O-RU authentication method in use. This information
160             shall be ignored by an O-RU that is using FTPES based file transfer";
161         }
162         container server {
163           list keys {
164             key algorithm;
165             ordered-by user;
166             uses ct:public-key-grouping;
167             description
168               "List of allowed algorithms with its keys";
169           }
170           description
171             "SSH Key for file server authentication";
172         }
173       }
174       case certificate {
175         container certificate {
176           presence true;
177           description
178             "certificate authentication method in use";
179         }
180
181       }
182      description "";
183     }
184     container application-layer-credential{
185
186       leaf appl-password {
187             type string;
188             description
189              "The parameter represents the password which may be needed for O-RU application level authentication.
190              For example, to perform authenticatation towards an FTPes server which does not allow anonymous account,
191              in addition to X.509v3 certificate for TLS authentication, password configured here need to be used together with username defined in the remote-file-path  ";
192       }
193       description
194         "Application layer credential information";
195     }
196   }
197
198   grouping retrieve-input {
199     description "Grouping for information retrieval RPC input";
200     leaf logical-path {
201       type string;
202       mandatory true;
203       description "URL specifying the logical path relative to the root of the logical file system
204       structure (the common root for o-ran/log, o-ran/pm, o-ran/transceiver or o-ran/beamforming)
205       of the files to be listed.";
206     }
207     leaf file-name-filter {
208       type string;
209       description "Filter which needs to be applied on the result list of file names (* is allowed as wild-card).";
210     }
211   }
212
213   grouping retrieve-output {
214     description "Grouping for information retrieval RPC output";
215     uses output-status-grouping;
216     leaf-list file-list {
217       when "../status = 'SUCCESS'";
218       type string;
219       description "List of files in the unit with the filter applied.";
220     }
221   }
222
223 // RPCs
224
225   rpc file-upload {
226     description "Management plane trigger to upload file from O-RU to file-server";
227     input {
228       uses file-path-grouping;
229       uses credential-information;
230     }
231     output {
232       uses output-status-grouping;
233     }
234   }
235
236   rpc retrieve-file-list {
237     description "List all the files in the logical O-RAN unit (* is allowed as wild-card).";
238     input {
239       uses retrieve-input;
240
241     }
242     output {
243       uses retrieve-output;
244     }
245   }
246
247   rpc file-download {
248     description
249       "Management plane trigger to download file from file-server to O-RU.";
250     input {
251       uses file-path-grouping;
252       uses credential-information;
253     }
254     output {
255       uses output-status-grouping;
256     }
257   }
258
259   notification file-upload-notification {
260     uses file-path-grouping;
261     uses output-status-grouping;
262     description "";
263   }
264
265   notification file-download-event {
266     uses file-path-grouping;
267     uses output-status-grouping;
268     description "";
269   }
270 }