Add supoprt for D release use-case.
[sim/o1-interface.git] / ntsimulator / deploy / o-ran-ru-fh / yang / o-ran-file-management@2019-07-03.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-07-03" {
46     description
47       "version 1.1.0
48
49       1) backward compatible changes to correct sFTP Server Authentication .
50       2) minor fixes according to lack of descriptions
51       3) backward compatible changes to introduce groupings";
52
53     reference "ORAN-WG4.M.0-v01.00";
54   }
55
56   revision "2019-02-04" {
57     description
58       "version 1.0.0
59
60       1) imported model from xRAN
61       2) changed namespace and reference from xran to o-ran";
62
63     reference "ORAN-WG4.M.0-v01.00";
64   }
65
66   grouping file-path-grouping {
67     description "Complete logical path of the file to upload/download
68     (no wildcard is allowed) ex : /o-RAN/log/syslog.1";
69
70     leaf local-logical-file-path {
71       type string;
72       mandatory true;
73       description "Local logical file path";
74     }
75
76     leaf remote-file-path {
77       type string;
78       mandatory true;
79       description "URI specifying the remote-file-path on O-DU/NMS.
80       Format:sftp://<username>@<host>[:port]/path";
81     }
82   }
83
84   grouping output-status-grouping {
85     description "Status grouping";
86
87     leaf status {
88       type enumeration {
89         enum SUCCESS {
90             description "";}
91         enum FAILURE {
92             description "";}
93       }
94       description "Operation status";
95       }
96
97     leaf reject-reason {
98       when "../status = 'FAILURE'";
99       type string;
100       description "";
101     }
102   }
103
104   grouping credential-information {
105     description "Type of authentication to use for SFTP upload or download.";
106     choice credentials {
107       case password {
108         container password {
109           presence true;
110           leaf password {
111             type string;
112             mandatory true;
113             description
114               "password needed for O-RU authentication.";
115           }
116           description
117             "password for O-RU authentication method in use";
118         }
119         container server {
120           list keys {
121             key algorithm;
122             ordered-by user;
123             uses ct:public-key-grouping;
124             description
125               "List of allowed algorithms with its keys";
126           }
127           description
128             "Key for sFTP server authentication";
129         }
130       }
131       case certificate {
132         container certificate {
133           presence true;
134           description
135             "certificate authentication method in use";
136         }
137       }
138      description "";
139     }
140   }
141
142   grouping retrieve-input {
143     description "Grouping for information retrieval RPC input";
144     leaf logical-path {
145       type string;
146       mandatory true;
147       description "O-RAN unit of which the files are to be listed.
148       ex :  O-RAN/log, o-RAN/PM, O-RAN/transceiver";
149     }
150     leaf file-name-filter {
151       type string;
152       description "Filter which are to be applied on the result list of file names (* is allowed as wild-card).";
153     }
154   }
155
156   grouping retrieve-output {
157     description "Grouping for information retrieval RPC output";
158     uses output-status-grouping;
159     leaf-list file-list {
160       when "../status = 'SUCCESS'";
161       type string;
162       description "List of files in the unit with the filter applied.";
163     }
164   }
165
166 // RPCs
167
168   rpc file-upload {
169     description "File upload over SFTP from equipment to NETCONF client";
170     input {
171       uses file-path-grouping;
172       uses credential-information;
173     }
174     output {
175       uses output-status-grouping;
176     }
177   }
178
179   rpc retrieve-file-list {
180     description "List all the files in the logical O-RAN unit (* is allowed as wild-card).";
181     input {
182       uses retrieve-input;
183
184     }
185     output {
186       uses retrieve-output;
187     }
188   }
189
190   notification file-upload-notification {
191     uses file-path-grouping;
192     uses output-status-grouping;
193     description "";
194   }
195
196   rpc file-download {
197     description
198       "Management plane triggered to generate the download file of O-RU.";
199     input {
200       uses file-path-grouping;
201       uses credential-information;
202     }
203     output {
204       uses output-status-grouping;
205     }
206   }
207
208   notification file-download-event {
209     uses file-path-grouping;
210     uses output-status-grouping;
211     description "";
212   }
213 }