BUG-48: add a description of RPC messages
[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         This module exposes three programming instructions,add-lsp,
19         remove-lsp and update-lsp, which map to actively-stateful PCEP
20         operations using PCInitiate and PCUpd messages to initiate,
21         destroy and udpate LSP configuration. The lifecycle of these
22         instructions follows draft-crabbe-pce-pce-initiated-lsp and
23         draft-ietf-pce-stateful-pce, completing execution once the head-end
24         router has acknowledged operation success. Should the router become
25         disconnected, the instruction resolve to Cancelled if the message
26         has not been sent into the TCP socket, or Failed it they have.
27
28                 Copyright (c)2013 Cisco Systems, Inc. All rights reserved.";
29
30         revision "2013-10-24" {
31                 description
32                         "Initial revision.";
33                 reference "";
34         }
35
36         typedef pcc-sync-state {
37                 type enumeration {
38                         enum initial-resync {
39                                 description
40                                         "Initial state resynchronization is being performed.";
41                         }
42                         enum synchronized {
43                                 description
44                                         "State synchronization has been achieved.";
45                         }
46                 }
47         }
48
49         grouping topology-pcep-type {
50                 container topology-pcep {
51                         presence "indicates a PCEP-aware topology";
52                 }
53         }
54
55         augment "/nt:network-topology/nt:topology/nt:topology-types" {
56                 uses topology-pcep-type;
57         }
58
59         grouping pcep-client-attributes {
60         description "Data present in a node which is a PCEP client (PCC).";
61
62                 container path-computation-client {
63                         description
64                 "PCC-related run-time information. This container is only
65                 present when the node is connected through PCEP in a PCC
66                 role.";
67             config false;
68
69                         container stateful-tlv {
70                                 uses pcep:stateful-capability-tlv;
71                         }
72
73                         leaf state-sync {
74                                 when "../stateful-tlv";
75                                 type pcc-sync-state;
76                         }
77
78             list reported-lsps {
79                 leaf name {
80                     type pcep:symbolic-path-name;
81                 }
82                 key name;
83
84                 uses pcep:lsp-object;
85
86                 container path {
87                     uses pcep:path-definition;
88                 }
89             }
90         }
91         }
92
93         augment "/nt:network-topology/nt:topology/nt:node" {
94         when "../../nt:topology-types/topology-pcep";
95
96                 uses pcep-client-attributes;
97         }
98
99     rpc add-lsp {
100         input {
101             uses ntp:topology-instruction-input;
102
103             leaf node {
104                 type nt:node-ref;
105                 mandatory true;
106             }
107
108             leaf name {
109                 type pcep:symbolic-path-name;
110                 mandatory true;
111             }
112
113             container arguments {
114                 leaf administrative {
115                     type boolean;
116                     default true;
117                 }
118
119                                 container endpoints {
120                                         uses pcep:endpoints-object;
121                                 }
122
123                 uses pcep:path-definition;
124             }
125         }
126         output {
127             uses ntp:topology-instruction-output;
128         }
129     }
130
131     rpc remove-lsp {
132         input {
133             uses ntp:topology-instruction-input;
134
135             leaf node {
136                 type nt:node-ref;
137                 mandatory true;
138             }
139
140             leaf name {
141                 type pcep:symbolic-path-name;
142                 mandatory true;
143             }
144         }
145         output {
146             uses ntp:topology-instruction-output;
147         }
148     }
149
150     rpc update-lsp {
151         input {
152             uses ntp:topology-instruction-input;
153
154             leaf node {
155                 type nt:node-ref;
156                 mandatory true;
157             }
158
159             leaf name {
160                 type pcep:symbolic-path-name;
161                 mandatory true;
162             }
163
164             container arguments {
165                 leaf administrative {
166                     type boolean;
167                     default true;
168                 }
169
170                 uses pcep:path-definition;
171             }
172         }
173         output {
174             uses ntp:topology-instruction-output;
175         }
176     }
177 }
178