BUG-48: more implementation
[bgpcep.git] / pcep / topology-api / src / main / yang / network-topology-pcep.yang
1 module network-topology-pcep {
2         // vi: set et smarttab sw=4 tabstop=4:
3         yang-version 1;
4         namespace "urn:opendaylight:params:xml:ns:yang:topology:pcep";
5         prefix "pn";
6
7         import network-topology { prefix nt; revision-date 2013-10-21; }
8         import network-topology-programming { prefix ntp; revision-date 2013-11-02; }
9         import pcep-types { prefix pcep; revision-date 2013-10-05; }
10
11         organization "Cisco Systems, Inc.";
12         contact "Robert Varga <rovarga@cisco.com>";
13
14         description
15                 "This module contains the PCEP extensions to base topology model. It
16         exposes the LSPs for which a particular node is the head end.
17
18                 Copyright (c)2013 Cisco Systems, Inc. All rights reserved.";
19
20         revision "2013-10-24" {
21                 description
22                         "Initial revision.";
23                 reference "";
24         }
25
26         typedef pcc-sync-state {
27                 type enumeration {
28                         enum initial-resync {
29                                 description
30                                         "Initial state resynchronization is being performed.";
31                         }
32                         enum synchronized {
33                                 description
34                                         "State synchronization has been achieved.";
35                         }
36                 }
37         }
38
39         grouping topology-pcep-type {
40                 container topology-pcep {
41                         presence "indicates a PCEP-aware topology";
42                 }
43         }
44
45         augment "/nt:network-topology/nt:topology/nt:topology-types" {
46                 uses topology-pcep-type;
47         }
48
49         grouping pcep-client-attributes {
50         description "Data present in a node which is a PCEP client (PCC).";
51
52                 container path-computation-client {
53                         description
54                 "PCC-related run-time information. This container is only
55                 present when the node is connected through PCEP in a PCC
56                 role.";
57             config false;
58
59                         container stateful-tlv {
60                                 uses pcep:stateful-capability-tlv;
61                         }
62
63                         leaf state-sync {
64                                 when "../stateful-tlv";
65                                 type pcc-sync-state;
66                         }
67
68             list reported-lsps {
69                 leaf name {
70                     type pcep:symbolic-path-name;
71                 }
72                 key name;
73
74                 container lsp {
75                     uses pcep:lsp-object;
76                 }
77
78                 container path {
79                     uses pcep:path-definition;
80                 }
81             }
82         }
83         }
84
85         augment "/nt:network-topology/nt:topology/nt:node" {
86         when "../../nt:topology-types/topology-pcep";
87
88                 uses pcep-client-attributes;
89         }
90
91     rpc add-lsp {
92         input {
93             uses ntp:topology-instruction-input;
94
95             leaf node {
96                 type nt:node-ref;
97                 mandatory true;
98             }
99
100             leaf name {
101                 type pcep:symbolic-path-name;
102                 mandatory true;
103             }
104
105             container arguments {
106                 leaf administrative {
107                     type boolean;
108                     default true;
109                 }
110
111                                 container endpoints {
112                                         uses pcep:endpoints-object;
113                                 }
114
115                 uses pcep:path-definition;
116             }
117         }
118         output {
119             uses ntp:topology-instruction-output;
120         }
121     }
122
123     rpc remove-lsp {
124         input {
125             uses ntp:topology-instruction-input;
126
127             leaf node {
128                 type nt:node-ref;
129                 mandatory true;
130             }
131
132             leaf name {
133                 type pcep:symbolic-path-name;
134                 mandatory true;
135             }
136         }
137         output {
138             uses ntp:topology-instruction-output;
139         }
140     }
141
142     rpc update-lsp {
143         input {
144             uses ntp:topology-instruction-input;
145
146             leaf node {
147                 type nt:node-ref;
148                 mandatory true;
149             }
150
151             leaf name {
152                 type pcep:symbolic-path-name;
153                 mandatory true;
154             }
155
156             container arguments {
157                 leaf administrative {
158                     type boolean;
159                     default true;
160                 }
161
162                 uses pcep:path-definition;
163             }
164         }
165         output {
166             uses ntp:topology-instruction-output;
167         }
168     }
169 }
170