Cleanup License statement
[oam/tr069-adapter.git] / netconf-server / schemas / common / tr069-operations.yang
1 module tr069-operations {
2   yang-version 1;
3   namespace "urn:tr069rpc:1.0";
4   prefix cr;
5
6   organization
7     "CommScope";
8   contact
9     "Radio access OneCell <5g@commscope.com>
10
11      CommScope Inc
12      1100 10th Ave Ct SE,
13      Hickory,
14      NC 28602,
15      USA";
16   description
17     "This module contains a YANG definition for the TR069 device operations.";
18
19   revision 2020-08-07 {
20     description
21       "PLEASE READ BELOW NOTES BEFORE USING THE RPCs:
22        1)  All the RPCs supported by TR-069 protocol are translated to NETCONF
23            RPCs except following RPCs.
24        i. GetRPCMethods
25            ii. GetParameterNames
26            iii. InitiateCR
27            iv. Download
28            v. ScheduleDownload
29            vi. Upload
30       ";
31     reference
32       "Subset of TR-069 protocol RPCs mapped to NETCONF RPCs";
33   }
34
35   grouping add-object-output {
36     description
37       "Grouping for add-object rpc output";
38     leaf status {
39       type enumeration {
40         enum 0 {
41           description
42             "The Object has been created.";
43         }
44         enum 1 {
45           description
46             "The Object creation has been validated and committed, but not yet applied (for example, if a reboot is required before the new Object can be applied).";
47         }
48       }
49       mandatory true;
50       description
51         "Status of the addObject";
52     }
53
54     leaf instance-number {
55       type int32;
56       description
57         "Instance Number when the status is passed.";
58     }
59     leaf label {
60       type string;
61       description
62         "label attribute for add-object output.";
63     }
64   }
65
66   grouping delete-object-output {
67     description
68       "Grouping for add-object rpc output";
69     leaf status {
70       type enumeration {
71         enum 0 {
72           description
73             "The Object has been deleted.";
74         }
75         enum 1 {
76           description
77             "The Object deletion has been validated and committed, but not yet applied (for example, if a reboot is required before the Object can be deleted).";
78         }
79       }
80       mandatory true;
81       description
82         "Status of the addObject";
83     }
84   }
85
86   grouping set-parameter-attributes-input {
87     description
88       "Grouping for set-parameter-attributes rpc input";
89     list config {
90       key "keyindex";
91       description
92         "config container object for set parameter attributes RPC.";
93       leaf keyindex {
94         type uint16;
95         description
96           "keyindex for each set parameter attribute";
97       }
98       anyxml parameter {
99         description
100           "parameter attribute";
101       }
102       leaf notification {
103         type int32;
104         mandatory true;
105         description
106           "notification attribute for a set parameter attribute";
107       }
108       leaf notification-change {
109         type boolean;
110         description
111           "notification change attribute for a set parameter attribute";
112       }
113         leaf-list access-list {
114           type string;
115           description
116             "access list attributes for a set parameter attribute";
117       }
118       leaf access-list-change {
119         type boolean;
120         description
121           "access list change attribute for a set parameter attribute";
122       }
123     }
124   }
125
126   grouping get-parameter-attributes-output {
127     description
128       "Grouping for get-parameter-attributes rpc output";
129     list data {
130       key "keyindex";
131       description
132         "get parameter attribute configuration Object";
133       leaf keyindex {
134         type uint16;
135         description
136           "keyindex attribute";
137       }
138       leaf parameter {
139        type string;
140         description
141           "parameter attribute";
142       }
143       leaf notification {
144         type int32;
145         mandatory true;
146         description
147           "notification parameter";
148       }
149       leaf-list access-list {
150           type string;
151           description
152             "access list of a attribute";
153       }
154     }
155   }
156   
157   grouping download-input {
158   description
159       "Grouping for download rpc input";
160     leaf command-key {
161          type string;
162          description
163            "command key";
164        } 
165        leaf file-type {
166         type string;
167         description
168            "file type";
169        }
170        leaf url {
171         type string;
172         description
173            "url string";
174        }
175        leaf username {
176         type string;
177         description
178            "Username";
179        }
180        leaf password {
181         type string;
182         description
183            "password";
184        }
185        leaf file-size {
186         type int32;
187         description
188            "file size";
189        }
190        leaf target-file-name {
191         type string;
192         description
193            "target file name";
194        }
195        leaf delay-in-seconds {
196         type int32;
197         description
198            "delay in seconds";
199        }
200        leaf success-url {
201         type string;
202         description
203            "success url";
204        }
205        leaf failure-url {
206         type string;
207         description
208            "failure url";
209        }  
210   }
211
212   rpc add-object {
213     description
214       "adds object for parameter on the device.";
215     input {
216       anyxml parameter {
217         description
218           "parameter attribute for add-object";
219       }
220     }
221     output {
222       uses add-object-output;
223     }
224   }
225
226   rpc delete-object {
227     description
228       "adds object for parameter on the device.";
229     input {
230       anyxml parameter {
231         description
232           "access container Object";
233       }
234     }
235     output {
236       uses delete-object-output;
237     }
238   }
239
240   rpc set-parameter-attributes {
241     description
242       "SPA for parameter on the device.";
243     input {
244       uses set-parameter-attributes-input;
245     }
246   }
247
248   rpc get-parameter-attributes {
249     description
250       "GPA for parameter on the device.";
251     input {
252       list filter {
253         key "keyindex";
254         description
255           "get-parameter-attributes Object as rpc input";
256         leaf keyindex {
257           type uint16;
258           description
259             "keyindex attribute for a get parameter attribute";
260         }
261         anyxml parameter {
262           description
263             "parameter GPA RPC input";
264         }
265       }
266     }
267     output {
268       uses get-parameter-attributes-output;
269     }
270   }
271
272   rpc reboot {
273     description
274       "Reboots the device.";
275   }
276
277   rpc reset {
278     description
279       "resets the device.";
280   }
281
282   rpc connection-status {
283     description
284       "device connection status.";
285     output {
286       leaf last-contact-time {
287         type string;
288         mandatory true;
289         description
290           "when device has last contacted the ONAP.";
291       }
292           leaf last-failure-attempt-time {
293         type string;
294         mandatory true;
295         description
296           "when the last access attempt has failed from ONAP.";
297       }
298       leaf last-access-status {
299         type enumeration {
300           enum SUCCESS {
301             description
302               "Last connection was successful.";
303           }
304           enum FAILED {
305             description
306               "Last device access was failed.";
307           }
308         }
309         mandatory true;
310         description
311           "Status of last device access.";
312       }
313       leaf error-message {
314         when "../current-status = 'FAILED'";
315         type string;
316         description
317           "Detailed error Message when the status is failed.";
318       }
319     }
320   }
321   rpc download {
322   description
323       "download.";
324       input {
325        uses download-input;
326      }
327   }
328 }