Merge from OSM SO master
[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   import rw-project-mano {
91     prefix "rw-project-mano";
92   }
93
94   revision 2017-02-08 {
95     description
96       "Update model to support projects.";
97   }
98
99   revision 2015-10-27 {
100     description
101       "Initial revision.";
102   }
103
104   // typedef ro-endpoint-method {
105   //   type enumeration {
106   //     enum netconf;
107   //     enum restconf;
108   //   }
109   // }
110   
111   grouping ro-endpoint {
112     // leaf ro-endpoint-method {
113     //   description "interface between CM & RO, defaults to netconf";
114     //   type ro-endpoint-method;
115     //   default netconf;
116     // }
117     leaf ro-ip-address {
118       type inet:ip-address;
119       description "IP Address";
120       default "127.0.0.1";
121     }
122     leaf ro-port {
123       type inet:port-number;
124       description "Port Number";
125       default 2022;
126     }
127     leaf ro-username {
128       description "RO endpoint username";
129       type string;
130       default "admin";
131     }
132     leaf ro-password {
133       description "RO endpoint password";
134       type string;
135       default "admin";
136     }
137   }
138
139   grouping vnf-cfg-items {
140     leaf configuration-file {
141       description "Location of the confguration file on CM system";
142       type string;
143     }
144     leaf translator-script {
145       description "Script that translates the templates in the configuration-file using VNFR information
146                    Currently, we only use IP address translations.
147                    configuration will use connection point name instead of IP addresses.";
148       type string;
149     }
150   }
151   
152   augment "/rw-project:project" {
153     container cm-config {
154       description "Service Orchestrator specific configuration";
155       rwpb:msg-new "SoConfig";
156       rwcli:new-mode "cm-config";
157
158       container ro-endpoint {
159         description "Resource Orchestrator endpoint ip address";
160         rwpb:msg-new "RoEndpoint";
161         uses ro-endpoint;
162       }
163     
164       //uses vnf-cfg-items;
165
166       list nsr {
167         key "id";
168         leaf id {
169           description "Indicates NSR bringup complete, now initiate configuration of the NSR";
170           type yang:uuid;
171         }
172       }
173     }// cm-config
174   }
175   
176   // =================== SHOW ==================
177   typedef record-state {
178     type enumeration {
179       enum init;
180       enum received;
181       enum cfg-delay;
182       enum cfg-process;
183       enum cfg-process-failed;
184       enum cfg-sched;
185       enum connecting;
186       enum failed-connection;
187       enum netconf-connected;
188       enum netconf-ssh-connected;
189       enum restconf-connected;
190       enum cfg-send;
191       enum cfg-failed;
192       enum ready-no-cfg;
193       enum ready;
194     }
195   }
196
197   // TBD: Do we need this typedef, currently not used anywhere
198   typedef cfg-type {
199     type enumeration {
200       enum none;
201       enum scriptconf;
202       enum netconf;
203       enum restconf;
204       enum jujuconf;
205     }
206   }
207
208
209   // This is also used by RO (Resource Orchestrator) to indicate NSR is ready
210   // It will only fill in IDs
211   augment "/rw-project:project" {
212     container cm-state {
213       rwpb:msg-new "CmOpdata";
214       config false;
215       description "CM NS & VNF states";
216
217       leaf states {
218         description "CM various states";
219         type string;
220       }
221     
222       list cm-nsr {
223         description "List of NS Records";
224         key "id";
225         leaf id {
226           type yang:uuid;
227         }
228         leaf name {
229           description "NSR name.";
230           type string;
231         }
232         leaf state {
233           description "State of NSR";
234           type record-state;
235         }
236         leaf state-details {
237           description "Details of the state of NSR, in case of errors";
238           type string;
239         }
240       
241         list cm-vnfr {
242           description "List of VNF Records within NS Record";
243           key "id";
244           leaf id {
245             type yang:uuid;
246           }
247           leaf name {
248             description "VNFR name.";
249             type string;
250           }
251           leaf state {
252             description "Last known state of this VNFR";
253             type record-state;
254           }
255           container mgmt-interface {
256             leaf ip-address {
257               type inet:ip-address;
258             }
259             leaf port {
260               type inet:port-number;
261             }
262           }
263           leaf cfg-type {
264             type string;
265           }
266           leaf cfg-location {
267             type inet:uri;
268           }
269           list connection-point {
270             key "name";
271             leaf name {
272               description "Connection Point name";
273               type string;
274             }
275             leaf ip-address {
276               description "IP address assigned to this connection point";
277               type inet:ip-address;
278             }
279           }
280         } // list VNFR
281       } // list NSR
282     } // cm-state
283   }
284
285 } // rw-conman