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