1e1c8ff1046ed1ca997f38a7659afed4b6c8f398
[transportpce.git] / ordmodels / device / src / main / yang / org-openroadm-file-transfer@2016-10-14.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   }
8
9   import org-openroadm-common-types {
10     prefix org-openroadm-common-types;
11   }
12
13   organization "Open ROADM MSA";
14   contact
15     "OpenROADM.org";
16   description
17     "YANG definitions for file management related rpcs.
18
19      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
20      AT&T Intellectual Property.  All other rights reserved.
21
22      Redistribution and use in source and binary forms, with or without modification,
23      are permitted provided that the following conditions are met:
24
25      * Redistributions of source code must retain the above copyright notice, this
26        list of conditions and the following disclaimer.
27      * Redistributions in binary form must reproduce the above copyright notice,
28        this list of conditions and the following disclaimer in the documentation and/or
29        other materials provided with the distribution.
30      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
31        contributors may be used to endorse or promote products derived from this software
32        without specific prior written permission.
33
34      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
35      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
37      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
38      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
39      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
40      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
41      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
42      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
43      POSSIBILITY OF SUCH DAMAGE.";
44
45   revision 2016-10-14 {
46     description
47       "Version 1.2";
48   }
49
50   rpc transfer {
51     description
52       "File transfer using FTP/SFTP";
53     input {
54       leaf action {
55         mandatory true;
56         description
57           "Type of action - download/upload.";
58         type enumeration {
59           enum "upload" {
60             description
61               "Specify the upload action. The server sends
62                the file identified by the local-file-path
63                to the remote-file-path.";
64           }
65           enum "download" {
66             description
67               "Specify the download action. The server retrieves
68                the file identified by the remote-file-path
69                to the local-file-path.";
70           }
71         }
72       }
73       leaf local-file-path {
74         type string;
75         mandatory true;
76         description
77           "Local file path.
78            Ex: /var/shared/example.txt";
79       }
80       leaf remote-file-path {
81         type inet:uri;
82         mandatory true;
83         description
84           "Remote file path.
85            A URI for the remote file path.
86
87            Format:sftp://user[:password]@host[:port]/path.
88            Ex: sftp://test:verify@[2001:db8:0:1::10]:22/home/user/sample";
89       }
90     }
91     output {
92       uses org-openroadm-common-types:rpc-response-status;
93     }
94   }
95   rpc show-file {
96     description
97       "Show one or more files in the specified directory.";
98     input {
99       leaf filename {
100         type string {
101           length "1..255";
102         }
103         description
104           "Specify file(s) to be listed (* is allowed as wild-card). ";
105       }
106     }
107     output {
108       leaf status {
109         type enumeration {
110           enum "Successful" {
111             value 1;
112           }
113           enum "Failed" {
114             value 2;
115           }
116         }
117         mandatory true;
118         description
119           "Successful or Failed";
120       }
121       leaf-list status-message {
122         type string;
123         description
124           "Gives a more detailed reason for success / failure";
125       }
126     }
127   }
128   rpc delete-file {
129     description
130       "Delete one or more files in the specified directory.";
131     input {
132       leaf filename {
133         type string {
134           length "1..255";
135         }
136         mandatory true;
137         description
138           "Specify file(s) to be deleted (* is allowed as wild-card).";
139       }
140     }
141     output {
142       uses org-openroadm-common-types:rpc-response-status;
143     }
144   }
145 }