dab83dd79e1129757eaf542f989bbb4a5a2c202f
[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 2023-04-28 {
16     description "This revision integrates device-status leaf, formerly hosted in callhome-device.yang";
17   }
18
19   revision 2020-10-15 {
20     description
21      "This revision adds connectivity details for one of the supported transport protocols";
22     reference
23      "RFC 8071: NETCONF Call Home and RESTCONF Call Home";
24   }
25
26   revision "2016-11-09" {
27     description "Initial version";
28   }
29
30   grouping credentials {
31     container credentials {
32       presence "Credentials to device.";
33       leaf username {
34         mandatory true;
35         description "Username to be used for authentication";
36         type string {
37           length "1..max";
38         }
39       }
40       leaf-list passwords {
41         description "Passwords to be used for authentication.";
42         type string;
43       }
44     }
45   }
46
47   container netconf-callhome-server {
48     description "Settings for call home server administration";
49
50     container global {
51       presence "global credentials are enabled.";
52       uses credentials;
53       leaf accept-all-ssh-keys {
54         type boolean;
55         default false;
56       }
57
58       leaf mount-point-naming-strategy {
59         type enumeration {
60             enum IP_PORT;
61             enum IP_ONLY;
62         }
63         default IP_PORT;
64         description "Mount name will be chosen as per this strategy in the absence of per device settings. Default is IP_PORT";
65       }
66     }
67
68     container allowed-devices {
69       description "A list of allowed devices";
70       list device {
71         key unique-id;
72         leaf unique-id {
73           description "Identifier of device, which will be used to identify device.";
74           type string;
75         }
76         leaf ssh-host-key {
77           description "BASE-64 encoded public key which device will use during connection.
78                        Deprecated, a 'host-key' from the  'ssh-client-params' containers should be used instead.";
79           status deprecated;
80           type string;
81         }
82         unique ssh-host-key;
83         uses credentials;
84
85         choice transport {
86           description "Provides connectivity details for one of the supported transport protocols";
87           case ssh {
88             container ssh-client-params {
89               leaf host-key {
90                 mandatory true;
91                 description "BASE-64 encoded public key which device will use during connection.";
92                 type string;
93               }
94               uses credentials;
95             }
96           }
97           case tls {
98             container tls-client-params {
99               leaf certificate-id {
100                 mandatory true;
101                 description "Certificate identifier which will be used during two-way TLS authentication.";
102                 type string;
103               }
104               leaf key-id {
105                 mandatory true;
106                 description "Key identifier inside the NetConf keystore which will be used during two-way TLS authentication.";
107                 type string;
108               }
109             }
110           }
111         }
112         unique transport/ssh/ssh-client-params/host-key;
113         unique transport/tls/tls-client-params/certificate-id;
114
115         leaf device-status {
116           config false;
117           type enumeration {
118             enum CONNECTED;
119             enum FAILED_AUTH_FAILURE;
120             enum FAILED_NOT_ALLOWED;
121             enum FAILED;
122             enum DISCONNECTED;
123           }
124           default DISCONNECTED;
125         }
126       }
127     }
128   }
129 }