2ca3e96a462faa7ed3a45e5b8d770d620b38a5a3
[netconf.git] / netconf / callhome-model / src / main / yang / odl-netconf-callhome-server.yang
1 module odl-netconf-callhome-server {
2
3   namespace "urn:opendaylight:params:xml:ns:yang:netconf-callhome-server";
4   prefix "callhome";
5
6   organization
7    "OpenDaylight Project";
8
9   contact
10    "netconf-dev@lists.opendaylight.org";
11
12   description
13    "This module defines the northbound interface for OpenDaylight NETCONF Callhome.";
14
15   revision "2016-11-09" {
16     description "Initial version";
17   }
18
19   grouping credentials {
20     container credentials {
21       presence "Credentials to device.";
22       leaf username {
23         mandatory true;
24         description "Username to be used for authentication";
25         type string {
26           length "1..max";
27         }
28       }
29       leaf-list passwords {
30         description "Passwords to be used for authentication.";
31         type string;
32       }
33     }
34   }
35
36   container netconf-callhome-server {
37     description "Settings for call home server administration";
38
39     container global {
40       presence "global credentials are enabled.";
41       uses credentials;
42       leaf accept-all-ssh-keys {
43         type boolean;
44         default false;
45       }
46
47       leaf mount-point-naming-strategy {
48         type enumeration {
49             enum IP_PORT;
50             enum IP_ONLY;
51         }
52         default IP_PORT;
53         description "Mount name will be chosen as per this strategy in the absence of per device settings. Default is IP_PORT";
54       }
55     }
56
57     container allowed-devices {
58       description "A list of allowed devices";
59       list device {
60         key unique-id;
61         leaf unique-id {
62           description "Identifier of device, which will be used to identify device.";
63           type string;
64         }
65         leaf ssh-host-key {
66           description "BASE-64 encoded public key which device will use during connection.
67                        Deprecated, a 'host-key' from the  'ssh-client-params' containers should be used instead.";
68           status deprecated;
69           type string;
70         }
71         unique ssh-host-key;
72         uses credentials;
73
74         choice transport {
75           description "Provides connectivity details for one of the supported transport protocols";
76           case ssh {
77             container ssh-client-params {
78               leaf host-key {
79                 mandatory true;
80                 description "BASE-64 encoded public key which device will use during connection.";
81                 type string;
82               }
83               uses credentials;
84             }
85           }
86           case tls {
87             container tls-client-params {
88               leaf certificate-id {
89                 mandatory true;
90                 description "Certificate identifier which will be used during two-way TLS authentication.";
91                 type string;
92               }
93               leaf key-id {
94                 mandatory true;
95                 description "Key identifier inside the NetConf keystore which will be used during two-way TLS authentication.";
96                 type string;
97               }
98             }
99           }
100         }
101         unique certificate-id;
102         unique host-key;
103       }
104     }
105   }
106 }