b6cf99c2ea1c061afd4a1e12007fad6a57d59f4c
[osm/SO.git] / rwcm / plugins / yang / rw-conman.yang
1
2 /*
3  * 
4  *   Copyright 2016-2017 RIFT.IO Inc
5  *
6  *   Licensed under the Apache License, Version 2.0 (the "License");
7  *   you may not use this file except in compliance with the License.
8  *   You may obtain a copy of the License at
9  *
10  *       http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *   Unless required by applicable law or agreed to in writing, software
13  *   distributed under the License is distributed on an "AS IS" BASIS,
14  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *   See the License for the specific language governing permissions and
16  *   limitations under the License.
17  *
18  */
19
20
21
22 /**
23  * @file rw-conman.yang
24  * @author Manish Patel
25  * @date 2015/10/27
26  * @brief Service Orchestrator configuration yang
27  */
28
29 module rw-conman
30 {
31   namespace "http://riftio.com/ns/riftware-1.0/rw-conman";
32   prefix "rw-conman";
33
34   import rw-pb-ext {
35     prefix "rwpb";
36   }
37
38   import rw-cli-ext {
39     prefix "rwcli";
40   }
41
42   import rw-project-vnfd {
43     prefix "rw-project-vnfd";
44   }
45
46   import rw-project-nsd {
47     prefix "rw-project-nsd";
48   }
49
50   import nsr {
51     prefix "nsr";
52   }
53
54   import vnfr {
55     prefix "vnfr";
56   }
57
58   import rw-vlr {
59     prefix "rwvlr";
60   }
61
62   import rw-yang-types {
63     prefix "rwt";
64   }
65
66   import ietf-inet-types {
67     prefix "inet";
68   }
69
70   import ietf-yang-types {
71     prefix "yang";
72   }
73
74   import mano-base {
75     prefix "manobase";
76   }
77
78   import mano-types {
79     prefix "manotypes";
80   }
81
82   import rw-config-agent {
83     prefix "rw-config-agent";
84   }
85
86   import rw-project {
87     prefix "rw-project";
88   }
89
90   revision 2017-02-08 {
91     description
92       "Update model to support projects.";
93   }
94
95   revision 2015-10-27 {
96     description
97       "Initial revision.";
98   }
99
100   // typedef ro-endpoint-method {
101   //   type enumeration {
102   //     enum netconf;
103   //     enum restconf;
104   //   }
105   // }
106   
107   grouping ro-endpoint {
108     // leaf ro-endpoint-method {
109     //   description "interface between CM & RO, defaults to netconf";
110     //   type ro-endpoint-method;
111     //   default netconf;
112     // }
113     leaf ro-ip-address {
114       type inet:ip-address;
115       description "IP Address";
116       default "127.0.0.1";
117     }
118     leaf ro-port {
119       type inet:port-number;
120       description "Port Number";
121       default 2022;
122     }
123     leaf ro-username {
124       description "RO endpoint username";
125       type string;
126       default "admin";
127     }
128     leaf ro-password {
129       description "RO endpoint password";
130       type string;
131       default "admin";
132     }
133   }
134
135   grouping vnf-cfg-items {
136     leaf configuration-file {
137       description "Location of the confguration file on CM system";
138       type string;
139     }
140     leaf translator-script {
141       description "Script that translates the templates in the configuration-file using VNFR information
142                    Currently, we only use IP address translations.
143                    configuration will use connection point name instead of IP addresses.";
144       type string;
145     }
146   }
147   
148   augment "/rw-project:project" {
149     container cm-config {
150       description "Service Orchestrator specific configuration";
151       rwpb:msg-new "SoConfig";
152       rwcli:new-mode "cm-config";
153
154       container ro-endpoint {
155         description "Resource Orchestrator endpoint ip address";
156         rwpb:msg-new "RoEndpoint";
157         uses ro-endpoint;
158       }
159     
160       //uses vnf-cfg-items;
161
162       list nsr {
163         key "id";
164         leaf id {
165           description "Indicates NSR bringup complete, now initiate configuration of the NSR";
166           type yang:uuid;
167         }
168       }
169     }// cm-config
170   }
171   
172   // =================== SHOW ==================
173   typedef record-state {
174     type enumeration {
175       enum init;
176       enum received;
177       enum cfg-delay;
178       enum cfg-process;
179       enum cfg-process-failed;
180       enum cfg-sched;
181       enum connecting;
182       enum failed-connection;
183       enum netconf-connected;
184       enum netconf-ssh-connected;
185       enum restconf-connected;
186       enum cfg-send;
187       enum cfg-failed;
188       enum ready-no-cfg;
189       enum ready;
190     }
191   }
192
193   // TBD: Do we need this typedef, currently not used anywhere
194   typedef cfg-type {
195     type enumeration {
196       enum none;
197       enum scriptconf;
198       enum netconf;
199       enum restconf;
200       enum jujuconf;
201     }
202   }
203
204
205   // This is also used by RO (Resource Orchestrator) to indicate NSR is ready
206   // It will only fill in IDs
207   augment "/rw-project:project" {
208     container cm-state {
209       rwpb:msg-new "CmOpdata";
210       config false;
211       description "CM NS & VNF states";
212
213       leaf states {
214         description "CM various states";
215         type string;
216       }
217     
218       list cm-nsr {
219         description "List of NS Records";
220         key "id";
221         leaf id {
222           type yang:uuid;
223         }
224         leaf name {
225           description "NSR name.";
226           type string;
227         }
228         leaf state {
229           description "State of NSR";
230           type record-state;
231         }
232         leaf state-details {
233           description "Details of the state of NSR, in case of errors";
234           type string;
235         }
236       
237         list cm-vnfr {
238           description "List of VNF Records within NS Record";
239           key "id";
240           leaf id {
241             type yang:uuid;
242           }
243           leaf name {
244             description "VNFR name.";
245             type string;
246           }
247           leaf state {
248             description "Last known state of this VNFR";
249             type record-state;
250           }
251           container mgmt-interface {
252             leaf ip-address {
253               type inet:ip-address;
254             }
255             leaf port {
256               type inet:port-number;
257             }
258           }
259           leaf cfg-type {
260             type string;
261           }
262           leaf cfg-location {
263             type inet:uri;
264           }
265           list connection-point {
266             key "name";
267             leaf name {
268               description "Connection Point name";
269               type string;
270             }
271             leaf ip-address {
272               description "IP address assigned to this connection point";
273               type inet:ip-address;
274             }
275           }
276         } // list VNFR
277       } // list NSR
278     } // cm-state
279   }
280
281 } // rw-conman