Use base64 encoding for netconf device passwords
[netconf.git] / apps / netconf-topology / src / main / yang / netconf-node-topology.yang
1 module netconf-node-topology {
2     namespace "urn:opendaylight:netconf-node-topology";
3     prefix "nettop";
4
5     import network-topology { prefix nt; revision-date 2013-10-21; }
6     import yang-ext { prefix ext; revision-date "2013-07-09";}
7     import netconf-node-optional { prefix nno; }
8     import odl-netconf-device { prefix ond; }
9
10     revision 2023-11-21 {
11         description "Separated RPC create-device input credentials from odl-netconf-device";
12     }
13
14     revision 2022-12-25 {
15         description "Refactored into odl-netconf-device";
16     }
17
18     revision "2015-01-14" {
19         description "Initial revision of Topology model";
20     }
21
22     grouping netconf-node-fields {
23       uses ond:connection-parameters;
24       uses ond:netconf-schema-storage;
25       uses ond:datastore-access;
26     }
27
28     grouping rpc-username-password {
29         leaf username {
30             type string;
31         }
32
33         leaf password {
34             type string;
35         }
36     }
37
38     grouping rpc-credentials {
39         choice rpc-credentials {
40             case login-pw {
41                 description "login-password credentials, encrypted.";
42
43                 container login-password {
44                     uses rpc-username-password;
45                 }
46             }
47             case login-pw-unencrypted {
48                 description "login-password credentials, not encrypted.";
49
50                 container login-password-unencrypted {
51                     uses rpc-username-password;
52                 }
53             }
54             case key-auth {
55                 description "key-based authentication, use the id for the pair thats stored in the keystore.";
56
57                 container key-based {
58                     leaf key-id {
59                         type string;
60                     }
61
62                     leaf username {
63                         type string;
64                     }
65                 }
66             }
67         }
68     }
69
70     rpc create-device {
71         status deprecated;
72         input {
73             uses rpc-credentials;
74             uses netconf-node-fields;
75             uses nno:netconf-node-augmented-optional-fields;
76             leaf node-id {
77                 type string;
78             }
79         }
80     }
81
82     rpc delete-device {
83         status deprecated;
84         input {
85             leaf node-id {
86                 type string;
87             }
88         }
89     }
90
91     augment "/nt:network-topology/nt:topology/nt:topology-types" {
92         container topology-netconf {
93             presence "The presence of the container node indicates a network
94                       of NETCONF devices";
95         }
96     }
97
98     augment "/nt:network-topology/nt:topology/nt:node" {
99         when "../../nt:topology-types/topology-netconf";
100         ext:augment-identifier "netconf-node";
101
102         uses ond:credentials;
103         uses netconf-node-fields;
104         uses ond:connection-oper;
105         ext:mount;
106     }
107 }