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