Refactor folder structure.
[sim/o1-interface.git] / ntsimulator / yang / x-ran / xran-file-management.yang
1 module xran-file-management {
2   yang-version 1.1;
3   namespace "urn:xran:file-management:1.0";
4   prefix "xran-file-mgmt";
5
6
7   organization "xRAN Forum";
8
9   contact
10     "www.xran.org";
11
12   description
13     "This module defines the configuration and operations for handling upload.
14
15     Copyright 2018 the xRAN Forum.
16
17     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
18     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19     IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20     ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21     LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22     CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23     SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24     INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27     POSSIBILITY OF SUCH DAMAGE.
28
29     Redistribution and use in source and binary forms, with or without
30     modification, are permitted provided that the following conditions are met:
31
32     * Redistributions of source code must retain the above copyright notice,
33     this list of conditions and the above disclaimer.
34     * Redistributions in binary form must reproduce the above copyright notice,
35     this list of conditions and the above disclaimer in the documentation
36     and/or other materials provided with the distribution.
37     * Neither the Members of the xRAN Forum nor the names of its
38     contributors may be used to endorse or promote products derived from
39     this software without specific prior written permission.";
40
41   revision "2018-07-20" {
42     description
43       "version 1.0.0 - First release of the xRAN YANG M-Plane models.
44
45       This version of the model supports v01.00 of the corrsponding xRAN
46       M-Plane Specification.";
47     reference "XRAN-FH.MP.0-v01.00";
48   }
49
50   grouping file-path-grouping {
51     description "Complete logical path of the file on the RU to upload/download
52         (no wildcard is allowed) ex : /xRAN/log/syslog.1";
53
54     leaf local-logical-file-path {
55       type string;
56       mandatory true;
57           description "Local logical file path";
58     }
59
60     leaf remote-file-path {
61       type string;
62       mandatory true;
63           description "URI specifying the remote-file-path on lls-CU/NMS.
64       Format:sftp://user[:password]@host[:port]/path";
65     }
66   }
67
68   grouping output-status-grouping {
69     description "Status grouping";
70
71     leaf status {
72       type enumeration {
73         enum SUCCESS {
74                         description "";}
75         enum FAILURE {
76                         description "";}
77       }
78       description "Operation status";
79           }
80
81     leaf reject-reason {
82       when "../status = 'FAILURE'";
83           type string;
84           description "";
85         }
86   }
87
88   grouping credential-information{
89     description "Type of authentication to use for SFTP upload or download.";
90     choice credentials {
91       case password {
92         container password {
93           presence true;
94           leaf password {
95             type string;
96             mandatory true;
97             description
98               "password needed for authentication.";
99           }
100           description
101           "password authentication method in use";
102         }
103       }
104       case certificate {
105         container certificate {
106           presence true;
107           description
108             "certificate authentication method in use";
109         }
110       }
111          description "";
112     }
113   }
114
115   rpc file-upload {
116     description "File upload over SFTP from RU to NETCONF client";
117     input {
118       uses file-path-grouping;
119       uses credential-information;
120     }
121     output {
122       uses output-status-grouping;
123     }
124   }
125
126   rpc retrieve-file-list {
127     description "List all the files in the logical xRAN unit (* is allowed as wild-card).";
128     input {
129       leaf logical-path {
130         type string;
131         mandatory true;
132                 description "xRAN unit of which the files are to be listed.
133         ex :  xRAN/log, xRAN/PM, xRAN/transceiver";
134       }
135       leaf file-name-filter {
136         type string;
137                 description "Filter which are to be applied on the result list of file names (* is allowed as wild-card).";
138       }
139
140     }
141     output {
142       uses output-status-grouping;
143       leaf-list file-list {
144         when "../status = 'SUCCESS'";
145         type string;
146                 description "List of files in the xRAN unit with the filter applied.";
147       }
148     }
149   }
150
151   notification file-upload-notification {
152     uses file-path-grouping;
153     uses output-status-grouping;
154         description "";
155   }
156
157   rpc file-download {
158     description
159       "Management plane triggered to generate the download file of RU.";
160     input {
161       uses file-path-grouping;
162       uses credential-information;
163     }
164     output {
165       uses output-status-grouping;
166     }
167   }
168
169   notification file-download-event {
170     uses file-path-grouping;
171     uses output-status-grouping;
172         description "";
173   }
174 }