fix ServiceHandler SpotBugs false positives
[transportpce.git] / tests / honeynode / 2.2.1 / honeynode-plugin-api / src / main / yang / devices / org-openroadm-file-transfer@2018-10-19.yang
1 module org-openroadm-file-transfer {
2   namespace "http://org/openroadm/file-transfer";
3   prefix org-openroadm-file-txr;
4
5   import ietf-inet-types {
6     prefix inet;
7     revision-date 2013-07-15;
8   }
9   import org-openroadm-common-types {
10     prefix org-openroadm-common-types;
11     revision-date 2018-10-19;
12   }
13
14   organization
15     "Open ROADM MSA";
16   contact
17     "OpenROADM.org";
18   description
19     "YANG definitions for file management related rpcs.
20
21      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
22      AT&T Intellectual Property.  All other rights reserved.
23
24      Redistribution and use in source and binary forms, with or without modification,
25      are permitted provided that the following conditions are met:
26
27      * Redistributions of source code must retain the above copyright notice, this
28        list of conditions and the following disclaimer.
29      * Redistributions in binary form must reproduce the above copyright notice,
30        this list of conditions and the following disclaimer in the documentation and/or
31        other materials provided with the distribution.
32      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
33        contributors may be used to endorse or promote products derived from this software
34        without specific prior written permission.
35
36      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
37      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
38      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
39      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
40      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
41      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
42      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
43      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
44      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
45      POSSIBILITY OF SUCH DAMAGE.";
46
47   revision 2018-10-19 {
48     description
49       "Version 2.2.1";
50   }
51   revision 2017-12-15 {
52     description
53       "Version 2.2";
54   }
55   revision 2017-09-29 {
56     description
57       "Version 2.1";
58   }
59   revision 2017-07-28 {
60     description
61       "Version 2.0.1 - added revision-date to imports";
62   }
63   revision 2017-06-26 {
64     description
65       "Version 2.0";
66   }
67   revision 2016-10-14 {
68     description
69       "Version 1.2";
70   }
71
72   rpc transfer {
73     description
74       "File transfer using FTP/SFTP";
75     input {
76       leaf action {
77         type enumeration {
78           enum "upload" {
79             description
80               "Specify the upload action. The NE (SFTP/FTP client) sends
81                the file identified by the local-file-path
82                to the remote-file-path.";
83           }
84           enum "download" {
85             description
86               "Specify the download action. The NE (SFTP/FTP client) retrieves
87                the file identified by the remote-file-path
88                to the local-file-path.";
89           }
90         }
91         mandatory true;
92         description
93           "Type of action - download/upload.";
94       }
95       leaf local-file-path {
96         type string;
97         mandatory true;
98         description
99           "Local file path.
100            Ex: /var/shared/example.txt";
101       }
102       leaf remote-file-path {
103         type inet:uri;
104         mandatory true;
105         description
106           "Remote file path.
107            A URI for the remote file path.
108
109            Format:sftp://user[:password]@host[:port]/path.
110            Ex: sftp://test:verify@[2001:db8:0:1::10]:22/home/user/sample";
111       }
112     }
113     output {
114       uses org-openroadm-common-types:rpc-response-status;
115     }
116   }
117   rpc show-file {
118     description
119       "Show one or more files in the specified directory.";
120     input {
121       leaf filename {
122         type string {
123           length "1..255";
124         }
125         default "*";
126         description
127           "Specify file(s) to be listed (* is allowed as wild-card). ";
128       }
129     }
130     output {
131       leaf status {
132         type enumeration {
133           enum "Successful" {
134             value 1;
135           }
136           enum "Failed" {
137             value 2;
138           }
139         }
140         mandatory true;
141         description
142           "Successful or Failed";
143       }
144       leaf-list status-message {
145         type string;
146         description
147           "Gives a more detailed reason for success / failure";
148       }
149     }
150   }
151   rpc delete-file {
152     description
153       "Delete one or more files in the specified directory.";
154     input {
155       leaf filename {
156         type string {
157           length "1..255";
158         }
159         mandatory true;
160         description
161           "Specify file(s) to be deleted (* is allowed as wild-card).";
162       }
163     }
164     output {
165       uses org-openroadm-common-types:rpc-response-status;
166     }
167   }
168   notification transfer-notification {
169     description
170       "notification for transfer operation events.";
171     leaf local-file-path {
172       type string;
173       description
174         "Local file path used in transfer RPC.";
175     }
176     uses org-openroadm-common-types:extended-rpc-response-status;
177     container progress {
178       when "current()/../status = 'In-progress'";
179       description
180         "progress status when response is in-progress";
181       leaf bytes-transferred {
182         type uint64;
183         description
184           "bytes transferred.";
185       }
186       leaf percentage-complete {
187         type uint8;
188         description
189           "percentage completed.";
190       }
191     }
192   }
193 }