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