New feature: Model changes for project support
[osm/SO.git] / common / plugins / yang / rw-config-agent.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 module rw-config-agent
22 {
23   namespace "http://riftio.com/ns/riftware-1.0/rw-config-agent";
24   prefix "rw-config-agent";
25
26   import rw-pb-ext {
27     prefix "rwpb";
28   }
29
30   import ietf-inet-types {
31     prefix "inet";
32   }
33
34   import rwcal {
35     prefix "rwcal";
36   }
37
38   import rw-project {
39     prefix "rw-project";
40   }
41
42   import mano-types {
43     prefix "manotypes";
44   }
45
46   revision 2017-02-08 {
47     description
48       "Update model to support projects.";
49   }
50
51   revision 2016-02-04 {
52     description
53       "Initial revision.";
54   }
55
56   typedef config-agent-account-type {
57     description "config agent account type";
58     type enumeration {
59       enum juju;
60       enum riftca;
61     }
62   }
63
64   augment "/rw-project:project" {
65     container config-agent {
66       rwpb:msg-new ConfigAgent;
67
68       list account {
69         rwpb:msg-new ConfigAgentAccount;
70         key "name";
71
72         description "List of configuration agent accounts";
73
74         leaf name {
75           description "Name of this config agent account";
76           type string;
77         }
78
79         leaf account-type {
80           description
81             "Default account type is Rift Configuration Agent (RiftCA)";
82           type config-agent-account-type;
83           default "riftca";
84         }
85
86         choice config-agent-account-type {
87           case juju {
88             description
89               "Configure the VNF through Juju.";
90             container juju {
91               leaf ip-address {
92                 description "Juju host IP address.";
93                 type inet:ip-address;
94               }
95               leaf port {
96                 description 
97                   "Juju host port number. Default 17070.";
98                 type inet:port-number;
99                 default 17070;
100               }
101               leaf user {
102                 description 
103                   "User name to connect to Juju host. Default user-admin.";
104                 type string;
105                 default "user-admin" ;
106               }
107               leaf secret {
108                 description 
109                   "Admin secret or password for Juju host.";
110                 type string;
111               }
112             }
113           }
114         }
115         uses rwcal:connection-status;
116       }
117     }
118   }
119
120   rpc update-cfg-agent-status {
121     description "Begin config agent account connection status";
122     input {
123       leaf cfg-agent-account {
124         mandatory true;
125         description
126           "The config agent account name to update connection status for";
127         type string;
128       }
129
130       uses manotypes:rpc-project-name;
131     }
132   }
133 }