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