Skip to content

Commit ded9268

Browse files
committed
yc.o
1 parent 9830b95 commit ded9268

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+5272
-2099
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
module draft-extended-example {
2+
yang-version 1.1;
3+
namespace "urn:ietf:params:xml:ns:yang:draft-extended-example";
4+
prefix dr-ext-exp;
5+
6+
import draft-template {
7+
prefix dr-tmp;
8+
}
9+
10+
organization
11+
"INSA Lyon";
12+
contact
13+
"Editor: Vivekananda Boudia
14+
<mailto:[email protected]>";
15+
description
16+
"add external references to RFC8345";
17+
revision 2025-03-09 {
18+
description
19+
"Initial revision.";
20+
reference
21+
"";
22+
}
23+
24+
identity AUGMENT-EXAMPLE-TEMPLATE-TYPE {
25+
base dr-tmp:template-type;
26+
description
27+
"augment example for template type";
28+
}
29+
30+
identity AUGMENT-EXAMPLE-EXTRA-LABEL {
31+
base dr-tmp:extra-label;
32+
description
33+
"augment example for extra label";
34+
}
35+
36+
identity AUGMENT-EXAMPLE-REQUEST-TYPE {
37+
base dr-tmp:request-type;
38+
description
39+
"augment example for request type";
40+
}
41+
42+
grouping augment-example-request {
43+
description
44+
"augment example for a request";
45+
leaf foo {
46+
type string;
47+
description
48+
"leaf example";
49+
}
50+
}
51+
52+
augment "/dr-tmp:template/dr-tmp:template/dr-tmp:request/dr-tmp:request-builder" {
53+
when "derived-from-or-self(../dr-tmp:request-type, 'AUGMENT-EXAMPLE-REQUEST-TYPE')";
54+
uses augment-example-request;
55+
description
56+
"we add our example to the possible request type";
57+
}
58+
}
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
module draft-relation {
2+
yang-version 1.1;
3+
namespace "urn:ietf:params:xml:ns:yang:draft-relation";
4+
prefix dr-rel;
5+
6+
import ietf-inet-types {
7+
prefix inet;
8+
reference
9+
"RFC 6991: Common YANG Data Types";
10+
}
11+
import ietf-network {
12+
prefix nw;
13+
reference
14+
"RFC 8345: A YANG Data Model for Network Topologies";
15+
}
16+
import ietf-network-topology {
17+
prefix nt;
18+
reference
19+
"RFC 8345: A YANG Data Model for Network Topologies";
20+
}
21+
import draft-template {
22+
prefix dr-tmp;
23+
}
24+
25+
organization
26+
"INSA Lyon";
27+
contact
28+
"Editor: Vivekananda Boudia
29+
<mailto:[email protected]>";
30+
description
31+
"relations external of RFC8345";
32+
33+
revision 2025-03-09 {
34+
description
35+
"Initial revision";
36+
reference
37+
"";
38+
}
39+
40+
container relation {
41+
description
42+
"relation container";
43+
list relation {
44+
key "relation-id";
45+
description
46+
"relation list";
47+
leaf relation-id {
48+
type inet:uri;
49+
description
50+
"relation id";
51+
}
52+
choice network-element-ref {
53+
description
54+
"linking to RFC8345";
55+
leaf network-ref {
56+
type leafref {
57+
path "/nw:networks/nw:network/nw:network-id";
58+
}
59+
description
60+
"linking to network";
61+
}
62+
leaf node-ref {
63+
type leafref {
64+
path "/nw:networks/nw:network/nw:node/nw:node-id";
65+
}
66+
description
67+
"linking to node";
68+
}
69+
leaf link-ref {
70+
type leafref {
71+
path "/nw:networks/nw:network/nt:link/nt:link-id";
72+
}
73+
description
74+
"linking to link";
75+
}
76+
leaf tp-ref {
77+
type leafref {
78+
path "/nw:networks/nw:network/nw:node/nt:termination-point/nt:tp-id";
79+
}
80+
description
81+
"linking to termination point";
82+
}
83+
}
84+
leaf template-ref {
85+
type leafref {
86+
path "/dr-tmp:template/dr-tmp:template/dr-tmp:template-id";
87+
}
88+
description
89+
"reference to template";
90+
}
91+
leaf-list request-type-supported {
92+
type identityref {
93+
base dr-tmp:request-type;
94+
}
95+
description
96+
"template is generic and may include requests that are not supported by the network element
97+
here, we specify the types of requests that the network element supports
98+
if network element supports all template ALL-REQUEST may be used";
99+
}
100+
leaf path {
101+
type string;
102+
description
103+
"network element can be augmented and may contain containers nested within other containers.
104+
path is used for filtering.";
105+
}
106+
list parameter-value {
107+
key "param-ref request-type";
108+
description
109+
"parameter value from network element";
110+
leaf param-ref {
111+
type leafref {
112+
path "/dr-tmp:template/dr-tmp:template/dr-tmp:parameter/dr-tmp:param-id";
113+
}
114+
description
115+
"reference to template parameter";
116+
}
117+
leaf request-type {
118+
type identityref {
119+
base dr-tmp:request-type;
120+
}
121+
description
122+
"value can be different depending on the request";
123+
}
124+
leaf value {
125+
type string;
126+
description
127+
"value of the parameter";
128+
}
129+
}
130+
}
131+
}
132+
}
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
module draft-template {
2+
yang-version 1.1;
3+
namespace "urn:ietf:params:xml:ns:yang:draft-template";
4+
prefix dr-tmp;
5+
6+
import ietf-inet-types {
7+
prefix inet;
8+
reference
9+
"RFC 6991: Common YANG Data Types";
10+
}
11+
12+
organization
13+
"INSA Lyon";
14+
contact
15+
"Editor: Vivekananda Boudia
16+
<mailto:[email protected]>";
17+
description
18+
"template yang model";
19+
20+
revision 2025-03-09 {
21+
description
22+
"Initial revision";
23+
reference
24+
"";
25+
}
26+
27+
identity template-type {
28+
description
29+
"base identity for template type";
30+
}
31+
32+
identity CONFIG {
33+
base template-type;
34+
description
35+
"template used to retrieve configuration data";
36+
}
37+
38+
identity STATE {
39+
base template-type;
40+
description
41+
"template used to retrieve operational state data";
42+
}
43+
44+
identity extra-label {
45+
description
46+
"base identity for extra label";
47+
}
48+
49+
identity request-type {
50+
description
51+
"base identity for request type";
52+
}
53+
54+
identity ALL_REQUEST {
55+
base request-type;
56+
description
57+
"all request";
58+
}
59+
60+
identity NETCONF {
61+
base request-type;
62+
description
63+
"request that retrieves data using the NETCONF protocol";
64+
}
65+
66+
grouping netconf-request {
67+
description
68+
"netconf request";
69+
leaf xpath {
70+
type string;
71+
description
72+
"netconf xpath for request";
73+
}
74+
}
75+
76+
container template {
77+
description
78+
"template container";
79+
list template {
80+
key "template-id";
81+
description
82+
"template list";
83+
leaf template-id {
84+
type inet:uri;
85+
description
86+
"uniquely identifies a template";
87+
}
88+
leaf description {
89+
type string;
90+
description
91+
"template description";
92+
}
93+
container template-type {
94+
description
95+
"template type
96+
used for filtering";
97+
leaf base {
98+
type identityref {
99+
base template-type;
100+
}
101+
description
102+
"template base
103+
used for filtering";
104+
}
105+
leaf is-historical {
106+
type boolean;
107+
description
108+
"check is template is used to get historical data or not
109+
used for filtering";
110+
}
111+
leaf-list extra-label {
112+
type identityref {
113+
base extra-label;
114+
}
115+
description
116+
"extra label
117+
used for filtering";
118+
}
119+
}
120+
list parameter {
121+
key "param-id";
122+
description
123+
"list of parameter used by request";
124+
leaf param-id {
125+
type inet:uri;
126+
description
127+
"uniquely identifies a parameter";
128+
}
129+
leaf description {
130+
type string;
131+
description
132+
"parameter description";
133+
}
134+
}
135+
list request {
136+
key "request-type";
137+
description
138+
"request list";
139+
leaf request-type {
140+
type identityref {
141+
base request-type;
142+
}
143+
description
144+
"request type";
145+
}
146+
container request-builder {
147+
description
148+
"request container that allows users to retrieve data
149+
parameters must be enclosed in brackets.";
150+
}
151+
}
152+
container extra {
153+
description
154+
"use for augmentation";
155+
}
156+
}
157+
}
158+
159+
augment "/template/template/request/request-builder" {
160+
when "derived-from-or-self(../request-type, 'NETCONF')";
161+
uses netconf-request;
162+
description
163+
"adding netconf request to possible request";
164+
}
165+
}

0 commit comments

Comments
 (0)