bb1555d0848bf5dbbfe8343e04c540f232847494
[osm/SO.git] / rwcm / plugins / yang / rw-conman.yang
1
2 /*
3  * 
4  *   Copyright 2016 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 nsr {
43     prefix "nsr";
44   }
45
46   import vnfr {
47     prefix "vnfr";
48   }
49
50   import rw-vlr {
51     prefix "rwvlr";
52   }
53
54   import rw-yang-types {
55     prefix "rwt";
56   }
57
58   import ietf-inet-types {
59     prefix "inet";
60   }
61
62   import ietf-yang-types {
63     prefix "yang";
64   }
65
66   import mano-base {
67     prefix "manobase";
68   }
69
70   import mano-types {
71     prefix "manotypes";
72   }
73
74   import rw-config-agent {
75     prefix "rw-config-agent";
76   }
77
78   revision 2015-10-27 {
79     description
80       "Initial revision.";
81   }
82
83   // typedef ro-endpoint-method {
84   //   type enumeration {
85   //     enum netconf;
86   //     enum restconf;
87   //   }
88   // }
89   
90   grouping ro-endpoint {
91     // leaf ro-endpoint-method {
92     //   description "interface between CM & RO, defaults to netconf";
93     //   type ro-endpoint-method;
94     //   default netconf;
95     // }
96     leaf ro-ip-address {
97       type inet:ip-address;
98       description "IP Address";
99       default "127.0.0.1";
100     }
101     leaf ro-port {
102       type inet:port-number;
103       description "Port Number";
104       default 2022;
105     }
106     leaf ro-username {
107       description "RO endpoint username";
108       type string;
109       default "admin";
110     }
111     leaf ro-password {
112       description "RO endpoint password";
113       type string;
114       default "admin";
115     }
116   }
117
118   grouping vnf-cfg-items {
119     leaf configuration-file {
120       description "Location of the confguration file on CM system";
121       type string;
122     }
123     leaf translator-script {
124       description "Script that translates the templates in the configuration-file using VNFR information
125                    Currently, we only use IP address translations.
126                    configuration will use connection point name instead of IP addresses.";
127       type string;
128     }
129   }
130   
131   container cm-config {
132     description "Service Orchestrator specific configuration";
133     rwpb:msg-new "SoConfig";
134     rwcli:new-mode "cm-config";
135
136     container ro-endpoint {
137       description "Resource Orchestrator endpoint ip address";
138       rwpb:msg-new "RoEndpoint";
139       uses ro-endpoint;
140     }
141     
142     //uses vnf-cfg-items;
143
144     list nsr {
145       key "id";
146       leaf id {
147         description "Indicates NSR bringup complete, now initiate configuration of the NSR";
148         type yang:uuid;
149       }
150     }
151   }// cm-config
152   
153   // =================== SHOW ==================
154   typedef record-state {
155     type enumeration {
156       enum init;
157       enum received;
158       enum cfg-delay;
159       enum cfg-process;
160       enum cfg-process-failed;
161       enum cfg-sched;
162       enum connecting;
163       enum failed-connection;
164       enum netconf-connected;
165       enum netconf-ssh-connected;
166       enum restconf-connected;
167       enum cfg-send;
168       enum cfg-failed;
169       enum ready-no-cfg;
170       enum ready;
171     }
172   }
173
174   // TBD: Do we need this typedef, currently not used anywhere
175   typedef cfg-type {
176     type enumeration {
177       enum none;
178       enum scriptconf;
179       enum netconf;
180       enum restconf;
181       enum jujuconf;
182     }
183   }
184
185
186   // This is also used by RO (Resource Orchestrator) to indicate NSR is ready
187   // It will only fill in IDs
188   container cm-state {
189     rwpb:msg-new "CmOpdata";
190     config false;
191     description "CM NS & VNF states";
192
193     leaf states {
194       description "CM various states";
195       type string;
196     }
197     
198     list cm-nsr {
199       description "List of NS Records";
200       key "id";
201       leaf id {
202         type yang:uuid;
203       }
204       leaf name {
205         description "NSR name.";
206         type string;
207       }
208       leaf state {
209         description "State of NSR";
210         type record-state;
211       }
212       leaf state-details {
213         description "Details of the state of NSR, in case of errors";
214         type string;
215       }
216       
217       list cm-vnfr {
218         description "List of VNF Records within NS Record";
219         key "id";
220         leaf id {
221           type yang:uuid;
222         }
223         leaf name {
224           description "VNFR name.";
225           type string;
226         }
227         leaf state {
228           description "Last known state of this VNFR";
229           type record-state;
230         }
231         container mgmt-interface {
232           leaf ip-address {
233             type inet:ip-address;
234           }
235           leaf port {
236             type inet:port-number;
237           }
238         }
239         leaf cfg-type {
240           type string;
241         }
242         leaf cfg-location {
243           type inet:uri;
244         }
245         list connection-point {
246           key "name";
247           leaf name {
248             description "Connection Point name";
249             type string;
250           }
251           leaf ip-address {
252             description "IP address assigned to this connection point";
253             type inet:ip-address;
254           }
255         }
256       } // list VNFR
257     } // list NSR
258   } // cm-state
259   
260 } // rw-conman