devaci 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- devaci/__init__.py +20 -0
- devaci/cobra/__init__.py +93 -0
- devaci/cobra/base.py +28 -0
- devaci/cobra/builders.py +1886 -0
- devaci/cobra/registry.py +24 -0
- devaci/console.py +34 -0
- devaci/data.py +81 -0
- devaci/deploy.py +320 -0
- devaci/exceptions.py +23 -0
- devaci/filters.py +103 -0
- devaci/jinja.py +42 -0
- devaci/py.typed +0 -0
- devaci/results.py +71 -0
- devaci-0.1.0.dist-info/METADATA +110 -0
- devaci-0.1.0.dist-info/RECORD +17 -0
- devaci-0.1.0.dist-info/WHEEL +4 -0
- devaci-0.1.0.dist-info/licenses/LICENSE +21 -0
devaci/cobra/builders.py
ADDED
|
@@ -0,0 +1,1886 @@
|
|
|
1
|
+
"""Cobra object builders, grouped by ACI domain.
|
|
2
|
+
|
|
3
|
+
Each handler is registered under the top-level YAML/template key it handles.
|
|
4
|
+
Migrated from ``devaci._legacy.cobra``. Local variables keep the PascalCase
|
|
5
|
+
style of the Cobra SDK to mirror the managed-object class names.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from typing import TYPE_CHECKING, Any
|
|
11
|
+
|
|
12
|
+
import cobra.model.aaa
|
|
13
|
+
import cobra.model.bgp
|
|
14
|
+
import cobra.model.cdp
|
|
15
|
+
import cobra.model.comm
|
|
16
|
+
import cobra.model.coop
|
|
17
|
+
import cobra.model.ctrlr
|
|
18
|
+
import cobra.model.datetime
|
|
19
|
+
import cobra.model.ep
|
|
20
|
+
import cobra.model.fabric
|
|
21
|
+
import cobra.model.fv
|
|
22
|
+
import cobra.model.fvns
|
|
23
|
+
import cobra.model.geo
|
|
24
|
+
import cobra.model.igmp
|
|
25
|
+
import cobra.model.infra
|
|
26
|
+
import cobra.model.infrazone
|
|
27
|
+
import cobra.model.isis
|
|
28
|
+
import cobra.model.l2ext
|
|
29
|
+
import cobra.model.l3ext
|
|
30
|
+
import cobra.model.lacp
|
|
31
|
+
import cobra.model.latency
|
|
32
|
+
import cobra.model.lldp
|
|
33
|
+
import cobra.model.mcp
|
|
34
|
+
import cobra.model.mgmt
|
|
35
|
+
import cobra.model.phys
|
|
36
|
+
import cobra.model.pim
|
|
37
|
+
import cobra.model.pki
|
|
38
|
+
import cobra.model.pol
|
|
39
|
+
import cobra.model.qos
|
|
40
|
+
import cobra.model.snmp
|
|
41
|
+
import cobra.model.stormctrl
|
|
42
|
+
import cobra.model.stp
|
|
43
|
+
import cobra.model.vz
|
|
44
|
+
|
|
45
|
+
from devaci.cobra.base import not_nan_str
|
|
46
|
+
from devaci.cobra.registry import register
|
|
47
|
+
|
|
48
|
+
if TYPE_CHECKING:
|
|
49
|
+
from devaci.cobra import CobraBuilder
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
# --------------------------------------------------------------------------- Tenant
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@register("fvTenant")
|
|
56
|
+
def fv_tenant(builder: CobraBuilder, value: Any) -> None:
|
|
57
|
+
"""Tenants > All Tenants."""
|
|
58
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
59
|
+
for fvTenant in value:
|
|
60
|
+
builder.config.addMo(cobra.model.fv.Tenant(Uni, **fvTenant))
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@register("fvAp")
|
|
64
|
+
def fv_ap(builder: CobraBuilder, value: Any) -> None:
|
|
65
|
+
"""Tenants > Application Profiles."""
|
|
66
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
67
|
+
for fvAp in value:
|
|
68
|
+
if not_nan_str(fvAp, ["name", "tenant"]):
|
|
69
|
+
Tenant = cobra.model.fv.Tenant(Uni, name=fvAp["tenant"])
|
|
70
|
+
Ap = cobra.model.fv.Ap(Tenant, **fvAp)
|
|
71
|
+
builder.config.addMo(Ap)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
@register("fvAEPg")
|
|
75
|
+
def fv_aepg(builder: CobraBuilder, value: Any) -> None:
|
|
76
|
+
"""Tenants > Application Profiles > Application EPGs."""
|
|
77
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
78
|
+
for fvAEPg in value:
|
|
79
|
+
Tenant = cobra.model.fv.Tenant(Uni, name=fvAEPg["tenant"])
|
|
80
|
+
Ap = cobra.model.fv.Ap(Tenant, name=fvAEPg["fvApName"])
|
|
81
|
+
AEPg = cobra.model.fv.AEPg(Ap, **fvAEPg)
|
|
82
|
+
builder.config.addMo(AEPg)
|
|
83
|
+
if "fvRsBd" in fvAEPg:
|
|
84
|
+
if not_nan_str(fvAEPg["fvRsBd"], ["tnFvBDName"]):
|
|
85
|
+
RsBd = cobra.model.fv.RsBd(AEPg, **fvAEPg["fvRsBd"])
|
|
86
|
+
builder.config.addMo(RsBd)
|
|
87
|
+
if "fvRsDomAtt" in fvAEPg:
|
|
88
|
+
for fvRsDomAtt in fvAEPg["fvRsDomAtt"]:
|
|
89
|
+
if not_nan_str(fvRsDomAtt, ["tDn"]):
|
|
90
|
+
RsDomAtt = cobra.model.fv.RsDomAtt(AEPg, **fvRsDomAtt)
|
|
91
|
+
builder.config.addMo(RsDomAtt)
|
|
92
|
+
if "fvRsPathAtt" in fvAEPg:
|
|
93
|
+
for fvRsPathAtt in fvAEPg["fvRsPathAtt"]:
|
|
94
|
+
if not_nan_str(fvRsPathAtt, ["tDn", "primaryEncap", "mode"]):
|
|
95
|
+
RsPathAtt = cobra.model.fv.RsPathAtt(AEPg, **fvRsPathAtt)
|
|
96
|
+
builder.config.addMo(RsPathAtt)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
@register("staticPath")
|
|
100
|
+
def static_path(builder: CobraBuilder, value: Any) -> None:
|
|
101
|
+
"""Tenants > Application Profiles > Application EPGs > EPG Name > Static Ports."""
|
|
102
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
103
|
+
for fvAp in value:
|
|
104
|
+
Tenant = cobra.model.fv.Tenant(Uni, name=fvAp["tenant"])
|
|
105
|
+
builder.config.addMo(Tenant)
|
|
106
|
+
Ap = cobra.model.fv.Ap(Tenant, **fvAp)
|
|
107
|
+
builder.config.addMo(Ap)
|
|
108
|
+
if "fvAEPg" in fvAp:
|
|
109
|
+
for fvAEPg in fvAp["fvAEPg"]:
|
|
110
|
+
AEPg = cobra.model.fv.AEPg(Ap, **fvAEPg)
|
|
111
|
+
if "fvRsPathAtt" in fvAEPg:
|
|
112
|
+
for fvRsPathAtt in fvAEPg["fvRsPathAtt"]:
|
|
113
|
+
RsPathAtt = cobra.model.fv.RsPathAtt(AEPg, **fvRsPathAtt)
|
|
114
|
+
builder.config.addMo(RsPathAtt)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
@register("fvRsPathAtt")
|
|
118
|
+
def fv_rs_path_att(builder: CobraBuilder, value: Any) -> None:
|
|
119
|
+
"""Tenants > Application Profiles > Application EPGs > EPG Name > Static Ports."""
|
|
120
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
121
|
+
for fvRsPathAtt in value:
|
|
122
|
+
if not_nan_str(
|
|
123
|
+
fvRsPathAtt, ["tenant", "fvApName", "fvAEPgName", "tDn", "primaryEncap", "mode"]
|
|
124
|
+
):
|
|
125
|
+
Tenant = cobra.model.fv.Tenant(Uni, name=fvRsPathAtt["tenant"])
|
|
126
|
+
builder.config.addMo(Tenant)
|
|
127
|
+
Ap = cobra.model.fv.Ap(Tenant, name=fvRsPathAtt["fvApName"])
|
|
128
|
+
builder.config.addMo(Ap)
|
|
129
|
+
AEPg = cobra.model.fv.AEPg(Ap, name=fvRsPathAtt["fvAEPgName"])
|
|
130
|
+
builder.config.addMo(AEPg)
|
|
131
|
+
RsPathAtt = cobra.model.fv.RsPathAtt(AEPg, **fvRsPathAtt)
|
|
132
|
+
builder.config.addMo(RsPathAtt)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
@register("tenant_application_uepg")
|
|
136
|
+
def tenant_application_uepg(builder: CobraBuilder, value: Any) -> None:
|
|
137
|
+
"""Tenants > Application Profiles > uSeg EPGs."""
|
|
138
|
+
for item in value:
|
|
139
|
+
mo = item
|
|
140
|
+
builder.config.addMo(mo)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
@register("tenant_application_esg")
|
|
144
|
+
def tenant_application_esg(builder: CobraBuilder, value: Any) -> None:
|
|
145
|
+
"""Tenants > Application Profiles > Endpoint Security Groups. TODO: implement."""
|
|
146
|
+
pass
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
@register("fvBD")
|
|
150
|
+
def fv_bd(builder: CobraBuilder, value: Any) -> None:
|
|
151
|
+
"""Tenants > Networking > Bridge Domains."""
|
|
152
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
153
|
+
for fvBD in value:
|
|
154
|
+
Tenant = cobra.model.fv.Tenant(Uni, name=fvBD["tenant"])
|
|
155
|
+
BD = cobra.model.fv.BD(Tenant, **fvBD)
|
|
156
|
+
builder.config.addMo(BD)
|
|
157
|
+
if "fvRsCtx" in fvBD:
|
|
158
|
+
if not_nan_str(fvBD["fvRsCtx"], ["tnFvCtxName"]):
|
|
159
|
+
RsCtx = cobra.model.fv.RsCtx(BD, **fvBD["fvRsCtx"])
|
|
160
|
+
builder.config.addMo(RsCtx)
|
|
161
|
+
if "igmpIfP" in fvBD:
|
|
162
|
+
if not_nan_str(fvBD["igmpIfP"], ["name"]):
|
|
163
|
+
IfP = cobra.model.igmp.IfP(BD, **fvBD["igmpIfP"])
|
|
164
|
+
builder.config.addMo(IfP)
|
|
165
|
+
if "fvRsBdToEpRet" in fvBD:
|
|
166
|
+
if not_nan_str(fvBD["fvRsBdToEpRet"], ["tnFvEpRetPolName"]):
|
|
167
|
+
RsBdToEpRet = cobra.model.fv.RsBdToEpRet(BD, **fvBD["fvRsBdToEpRet"])
|
|
168
|
+
builder.config.addMo(RsBdToEpRet)
|
|
169
|
+
if "fvRsIgmpsn" in fvBD:
|
|
170
|
+
if not_nan_str(fvBD["fvRsIgmpsn"], ["tnIgmpSnoopPolName"]):
|
|
171
|
+
RsIgmpsn = cobra.model.fv.RsIgmpsn(BD, **fvBD["fvRsIgmpsn"])
|
|
172
|
+
builder.config.addMo(RsIgmpsn)
|
|
173
|
+
if "fvRsMldsn" in fvBD:
|
|
174
|
+
if not_nan_str(fvBD["fvRsMldsn"], ["tnMldSnoopPolName"]):
|
|
175
|
+
RsMldsn = cobra.model.fv.RsMldsn(BD, **fvBD["fvRsMldsn"])
|
|
176
|
+
builder.config.addMo(RsMldsn)
|
|
177
|
+
if "fvRsBDToOut" in fvBD:
|
|
178
|
+
if not_nan_str(fvBD["fvRsBDToOut"], ["tnL3extOutName"]):
|
|
179
|
+
RsBDToOut = cobra.model.fv.RsBDToOut(BD, **fvBD["fvRsBDToOut"])
|
|
180
|
+
builder.config.addMo(RsBDToOut)
|
|
181
|
+
if "fvSubnet" in fvBD:
|
|
182
|
+
for fvSubnet in fvBD["fvSubnet"]:
|
|
183
|
+
if not_nan_str(fvSubnet, ["ip"]):
|
|
184
|
+
Subnet = cobra.model.fv.Subnet(BD, **fvSubnet)
|
|
185
|
+
builder.config.addMo(Subnet)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
@register("fvCtx")
|
|
189
|
+
def fv_ctx(builder: CobraBuilder, value: Any) -> None:
|
|
190
|
+
"""Tenants > Networking > VRFs."""
|
|
191
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
192
|
+
for fvCtx in value:
|
|
193
|
+
Tenant = cobra.model.fv.Tenant(Uni, name=fvCtx["tenant"])
|
|
194
|
+
Ctx = cobra.model.fv.Ctx(Tenant, **fvCtx)
|
|
195
|
+
builder.config.addMo(Ctx)
|
|
196
|
+
if "vzAny" in fvCtx:
|
|
197
|
+
Any = cobra.model.vz.Any(Ctx, **fvCtx["vzAny"])
|
|
198
|
+
builder.config.addMo(Any)
|
|
199
|
+
if "vzRsAnyToProv" in fvCtx["vzAny"]:
|
|
200
|
+
for vzRsAnyToProv in fvCtx["vzAny"]["vzRsAnyToProv"]:
|
|
201
|
+
if not_nan_str(vzRsAnyToProv, ["tnVzBrCPName"]):
|
|
202
|
+
RsAnyToProv = cobra.model.vz.RsAnyToProv(Any, **vzRsAnyToProv)
|
|
203
|
+
builder.config.addMo(RsAnyToProv)
|
|
204
|
+
if "vzRsAnyToCons" in fvCtx["vzAny"]:
|
|
205
|
+
for vzRsAnyToCons in fvCtx["vzAny"]["vzRsAnyToCons"]:
|
|
206
|
+
if not_nan_str(vzRsAnyToCons, ["tnVzBrCPName"]):
|
|
207
|
+
RsAnyToCons = cobra.model.vz.RsAnyToCons(Any, **vzRsAnyToCons)
|
|
208
|
+
builder.config.addMo(RsAnyToCons)
|
|
209
|
+
if "fvRsCtxToEpRet" in fvCtx:
|
|
210
|
+
if not_nan_str(fvCtx["fvRsCtxToEpRet"], ["tnFvEpRetPolName"]):
|
|
211
|
+
RsCtxToEpRet = cobra.model.fv.RsCtxToEpRet(Ctx, **fvCtx["fvRsCtxToEpRet"])
|
|
212
|
+
builder.config.addMo(RsCtxToEpRet)
|
|
213
|
+
if "fvRsCtxToExtRouteTagPol" in fvCtx:
|
|
214
|
+
if not_nan_str(fvCtx["fvRsCtxToExtRouteTagPol"], ["tnL3extRouteTagPolName"]):
|
|
215
|
+
RsCtxToExtRouteTagPol = cobra.model.fv.RsCtxToExtRouteTagPol(
|
|
216
|
+
Ctx, **fvCtx["fvRsCtxToExtRouteTagPol"]
|
|
217
|
+
)
|
|
218
|
+
builder.config.addMo(RsCtxToExtRouteTagPol)
|
|
219
|
+
if "fvRsOspfCtxPol" in fvCtx:
|
|
220
|
+
if not_nan_str(fvCtx["fvRsOspfCtxPol"], ["tnOspfCtxPolName"]):
|
|
221
|
+
RsOspfCtxPol = cobra.model.fv.RsOspfCtxPol(Ctx, **fvCtx["fvRsOspfCtxPol"])
|
|
222
|
+
builder.config.addMo(RsOspfCtxPol)
|
|
223
|
+
if "fvRsBgpCtxPol" in fvCtx:
|
|
224
|
+
if not_nan_str(fvCtx["fvRsBgpCtxPol"], ["tnBgpCtxPolName"]):
|
|
225
|
+
RsBgpCtxPol = cobra.model.fv.RsBgpCtxPol(Ctx, **fvCtx["fvRsBgpCtxPol"])
|
|
226
|
+
builder.config.addMo(RsBgpCtxPol)
|
|
227
|
+
if "fvRsVrfValidationPol" in fvCtx:
|
|
228
|
+
if not_nan_str(fvCtx["fvRsVrfValidationPol"], ["tnL3extVrfValidationPolName"]):
|
|
229
|
+
RsVrfValidationPol = cobra.model.fv.RsVrfValidationPol(
|
|
230
|
+
Ctx, **fvCtx["fvRsVrfValidationPol"]
|
|
231
|
+
)
|
|
232
|
+
builder.config.addMo(RsVrfValidationPol)
|
|
233
|
+
if "pimCtxP" in fvCtx:
|
|
234
|
+
if not_nan_str(fvCtx["pimCtxP"], ["mtu"]):
|
|
235
|
+
CtxP = cobra.model.pim.CtxP(Ctx, **fvCtx["pimCtxP"])
|
|
236
|
+
builder.config.addMo(CtxP)
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
@register("tenant_network_l2out")
|
|
240
|
+
def tenant_network_l2out(builder: CobraBuilder, value: Any) -> None:
|
|
241
|
+
"""Tenants > Networking > L2Outs. TODO: implement."""
|
|
242
|
+
pass
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
@register("l3extOut")
|
|
246
|
+
def l3ext_out(builder: CobraBuilder, value: Any) -> None:
|
|
247
|
+
"""Tenants > Networking > L3Outs. TODO: implement."""
|
|
248
|
+
pass
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
@register("tenant_network_srmpls_l3out")
|
|
252
|
+
def tenant_network_srmpls_l3out(builder: CobraBuilder, value: Any) -> None:
|
|
253
|
+
"""Tenants > Networking > SR-MPLS VRF L3Outs. TODO: implement."""
|
|
254
|
+
pass
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
@register("tenant_dot1q_tunnel")
|
|
258
|
+
def tenant_dot1q_tunnel(builder: CobraBuilder, value: Any) -> None:
|
|
259
|
+
"""Tenants > Networking > Dot1Q Tunnels. TODO: implement."""
|
|
260
|
+
pass
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
@register("fvnsAddrInst")
|
|
264
|
+
def fvns_addr_inst(builder: CobraBuilder, value: Any) -> None:
|
|
265
|
+
"""Tenants > mgmt > IP Address Pools."""
|
|
266
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
267
|
+
for fvnsAddrInst in value:
|
|
268
|
+
Tenant = cobra.model.fv.Tenant(Uni, name=fvnsAddrInst["tenant"])
|
|
269
|
+
AddrInst = cobra.model.fvns.AddrInst(Tenant, **fvnsAddrInst)
|
|
270
|
+
builder.config.addMo(AddrInst)
|
|
271
|
+
if "fvnsUcastAddrBlk" in fvnsAddrInst:
|
|
272
|
+
for fvnsUcastAddrBlk in fvnsAddrInst["fvnsUcastAddrBlk"]:
|
|
273
|
+
if not_nan_str(fvnsUcastAddrBlk, ["from"]):
|
|
274
|
+
UcastAddrBlk = cobra.model.fvns.UcastAddrBlk(AddrInst, **fvnsUcastAddrBlk)
|
|
275
|
+
builder.config.addMo(UcastAddrBlk)
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
@register("mgmtGrp")
|
|
279
|
+
def mgmt_grp(builder: CobraBuilder, value: Any) -> None:
|
|
280
|
+
"""Tenants > mgmt > Managed Node Connectivity Groups."""
|
|
281
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
282
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
283
|
+
FuncP = cobra.model.infra.FuncP(Infra)
|
|
284
|
+
for mgmtGrp in value:
|
|
285
|
+
Grp = cobra.model.mgmt.Grp(FuncP, **mgmtGrp)
|
|
286
|
+
builder.config.addMo(Grp)
|
|
287
|
+
if "mgmtOoBZone" in mgmtGrp:
|
|
288
|
+
OoBZone = cobra.model.mgmt.OoBZone(Grp)
|
|
289
|
+
if "mgmtRsOoB" in mgmtGrp["mgmtOoBZone"]:
|
|
290
|
+
RsOoB = cobra.model.mgmt.RsOoB(OoBZone, **mgmtGrp["mgmtOoBZone"]["mgmtRsOoB"])
|
|
291
|
+
builder.config.addMo(RsOoB)
|
|
292
|
+
if "mgmtRsAddrInst" in mgmtGrp["mgmtOoBZone"]:
|
|
293
|
+
RsAddrInst = cobra.model.mgmt.RsAddrInst(
|
|
294
|
+
OoBZone, **mgmtGrp["mgmtOoBZone"]["mgmtRsAddrInst"]
|
|
295
|
+
)
|
|
296
|
+
builder.config.addMo(RsAddrInst)
|
|
297
|
+
if "mgmtInBZone" in mgmtGrp:
|
|
298
|
+
InBZone = cobra.model.mgmt.InBZone(Grp)
|
|
299
|
+
if "mgmtRsInB" in mgmtGrp["mgmtInBZone"]:
|
|
300
|
+
RsInB = cobra.model.mgmt.RsInB(InBZone, **mgmtGrp["mgmtInBZone"]["mgmtRsInB"])
|
|
301
|
+
builder.config.addMo(RsInB)
|
|
302
|
+
if "mgmtRsAddrInst" in mgmtGrp["mgmtInBZone"]:
|
|
303
|
+
RsAddrInst = cobra.model.mgmt.RsAddrInst(
|
|
304
|
+
InBZone, **mgmtGrp["mgmtInBZone"]["mgmtRsAddrInst"]
|
|
305
|
+
)
|
|
306
|
+
builder.config.addMo(RsAddrInst)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
@register("mgmtNodeGrp")
|
|
310
|
+
def mgmt_node_grp(builder: CobraBuilder, value: Any) -> None:
|
|
311
|
+
"""Tenants > mgmt > Node Management Addresses."""
|
|
312
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
313
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
314
|
+
for mgmtNodeGrp in value:
|
|
315
|
+
NodeGrp = cobra.model.mgmt.NodeGrp(Infra, **mgmtNodeGrp)
|
|
316
|
+
builder.config.addMo(NodeGrp)
|
|
317
|
+
if "mgmtRsGrp" in mgmtNodeGrp:
|
|
318
|
+
for mgmtRsGrp in mgmtNodeGrp["mgmtRsGrp"]:
|
|
319
|
+
RsGrp = cobra.model.mgmt.RsGrp(NodeGrp, **mgmtRsGrp)
|
|
320
|
+
builder.config.addMo(RsGrp)
|
|
321
|
+
if "infraNodeBlk" in mgmtNodeGrp:
|
|
322
|
+
for infraNodeBlk in mgmtNodeGrp["infraNodeBlk"]:
|
|
323
|
+
if not_nan_str(infraNodeBlk, ["from_"]):
|
|
324
|
+
NodeBlk = cobra.model.infra.NodeBlk(NodeGrp, **infraNodeBlk)
|
|
325
|
+
builder.config.addMo(NodeBlk)
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
@register("tenant_contract_standard")
|
|
329
|
+
def tenant_contract_standard(builder: CobraBuilder, value: Any) -> None:
|
|
330
|
+
"""Tenants > Contracts > Standard. TODO: implement."""
|
|
331
|
+
pass
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
@register("tenant_contract_taboo")
|
|
335
|
+
def tenant_contract_taboo(builder: CobraBuilder, value: Any) -> None:
|
|
336
|
+
"""Tenants > Contracts > Taboos. TODO: implement."""
|
|
337
|
+
pass
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
@register("tenant_contract_imported")
|
|
341
|
+
def tenant_contract_imported(builder: CobraBuilder, value: Any) -> None:
|
|
342
|
+
"""Tenants > Contracts > Imported. TODO: implement."""
|
|
343
|
+
pass
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
@register("tenant_contract_filter")
|
|
347
|
+
def tenant_contract_filter(builder: CobraBuilder, value: Any) -> None:
|
|
348
|
+
"""Tenants > Contracts > Filters. TODO: implement."""
|
|
349
|
+
pass
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
@register("tenant_contract_oob")
|
|
353
|
+
def tenant_contract_oob(builder: CobraBuilder, value: Any) -> None:
|
|
354
|
+
"""Tenants > Contracts > Out-Of-Band Contracts. TODO: implement."""
|
|
355
|
+
pass
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
@register("tenant_policy_protocol_bfd")
|
|
359
|
+
def tenant_policy_protocol_bfd(builder: CobraBuilder, value: Any) -> None:
|
|
360
|
+
"""Tenants > Policies > Protocol > BFD. TODO: implement."""
|
|
361
|
+
pass
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
@register("tenant_policy_protocol_bgp")
|
|
365
|
+
def tenant_policy_protocol_bgp(builder: CobraBuilder, value: Any) -> None:
|
|
366
|
+
"""Tenants > Policies > Protocol > BGP. TODO: implement."""
|
|
367
|
+
pass
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
@register("tenant_policy_protocol_qos")
|
|
371
|
+
def tenant_policy_protocol_qos(builder: CobraBuilder, value: Any) -> None:
|
|
372
|
+
"""Tenants > Policies > Protocol > Custom QoS. TODO: implement."""
|
|
373
|
+
pass
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
@register("tenant_policy_protocol_dhcp")
|
|
377
|
+
def tenant_policy_protocol_dhcp(builder: CobraBuilder, value: Any) -> None:
|
|
378
|
+
"""Tenants > Policies > Protocol > DHCP. TODO: implement."""
|
|
379
|
+
pass
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
@register("tenant_policy_protocol_dataplane")
|
|
383
|
+
def tenant_policy_protocol_dataplane(builder: CobraBuilder, value: Any) -> None:
|
|
384
|
+
"""Tenants > Policies > Protocol > Data Plane Policing. TODO: implement."""
|
|
385
|
+
pass
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
@register("tenant_policy_protocol_eigrp")
|
|
389
|
+
def tenant_policy_protocol_eigrp(builder: CobraBuilder, value: Any) -> None:
|
|
390
|
+
"""Tenants > Policies > Protocol > EIGRP. TODO: implement."""
|
|
391
|
+
pass
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
@register("tenant_policy_protocol_endpoint_retention")
|
|
395
|
+
def tenant_policy_protocol_endpoint_retention(builder: CobraBuilder, value: Any) -> None:
|
|
396
|
+
"""Tenants > Policies > Protocol > End Point Retention. TODO: implement."""
|
|
397
|
+
pass
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
@register("tenant_policy_protocol_firsthop_security")
|
|
401
|
+
def tenant_policy_protocol_firsthop_security(builder: CobraBuilder, value: Any) -> None:
|
|
402
|
+
"""Tenants > Policies > Protocol > First Hop Security. TODO: implement."""
|
|
403
|
+
pass
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
@register("tenant_policy_protocol_hsrp")
|
|
407
|
+
def tenant_policy_protocol_hsrp(builder: CobraBuilder, value: Any) -> None:
|
|
408
|
+
"""Tenants > Policies > Protocol > HSRP. TODO: implement."""
|
|
409
|
+
pass
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
@register("tenant_policy_protocol_igmp")
|
|
413
|
+
def tenant_policy_protocol_igmp(builder: CobraBuilder, value: Any) -> None:
|
|
414
|
+
"""Tenants > Policies > Protocol > IGMP. TODO: implement."""
|
|
415
|
+
pass
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
@register("tenant_policy_protocol_ip_sla")
|
|
419
|
+
def tenant_policy_protocol_ip_sla(builder: CobraBuilder, value: Any) -> None:
|
|
420
|
+
"""Tenants > Policies > Protocol > IP SLA. TODO: implement."""
|
|
421
|
+
pass
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
@register("tenant_policy_protocol_pbr")
|
|
425
|
+
def tenant_policy_protocol_pbr(builder: CobraBuilder, value: Any) -> None:
|
|
426
|
+
"""Tenants > Policies > Protocol > L4-L7 Policy-Based Redirect. TODO: implement."""
|
|
427
|
+
pass
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
@register("tenant_policy_protocol_ospf")
|
|
431
|
+
def tenant_policy_protocol_ospf(builder: CobraBuilder, value: Any) -> None:
|
|
432
|
+
"""Tenants > Policies > Protocol > OSPF. TODO: implement."""
|
|
433
|
+
pass
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
@register("tenant_policy_protocol_pim")
|
|
437
|
+
def tenant_policy_protocol_pim(builder: CobraBuilder, value: Any) -> None:
|
|
438
|
+
"""Tenants > Policies > Protocol > PIM. TODO: implement."""
|
|
439
|
+
pass
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
@register("tenant_policy_protocol_routemap_multicast")
|
|
443
|
+
def tenant_policy_protocol_routemap_multicast(builder: CobraBuilder, value: Any) -> None:
|
|
444
|
+
"""Tenants > Policies > Protocol > Route Maps for Multicast. TODO: implement."""
|
|
445
|
+
pass
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
@register("tenant_policy_protocol_routemap_control")
|
|
449
|
+
def tenant_policy_protocol_routemap_control(builder: CobraBuilder, value: Any) -> None:
|
|
450
|
+
"""Tenants > Policies > Protocol > Route Maps for Route Control. TODO: implement."""
|
|
451
|
+
pass
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
@register("tenant_policy_protocol_route_tag")
|
|
455
|
+
def tenant_policy_protocol_route_tag(builder: CobraBuilder, value: Any) -> None:
|
|
456
|
+
"""Tenants > Policies > Protocol > Route Tag. TODO: implement."""
|
|
457
|
+
pass
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
@register("tenant_policy_troubleshooting_span")
|
|
461
|
+
def tenant_policy_troubleshooting_span(builder: CobraBuilder, value: Any) -> None:
|
|
462
|
+
"""Tenants > Policies > Troubleshooting SPAN. TODO: implement."""
|
|
463
|
+
pass
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
@register("tenant_policy_troubleshooting_traceroute")
|
|
467
|
+
def tenant_policy_troubleshooting_traceroute(builder: CobraBuilder, value: Any) -> None:
|
|
468
|
+
"""Tenants > Policies > Troubleshooting Traceroute. TODO: implement."""
|
|
469
|
+
pass
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
@register("tenant_policy_monitoring")
|
|
473
|
+
def tenant_policy_monitoring(builder: CobraBuilder, value: Any) -> None:
|
|
474
|
+
"""Tenants > Policies > Monitoring. TODO: implement."""
|
|
475
|
+
pass
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
@register("tenant_policy_netflow")
|
|
479
|
+
def tenant_policy_netflow(builder: CobraBuilder, value: Any) -> None:
|
|
480
|
+
"""Tenants > Policies > NetFlow. TODO: implement."""
|
|
481
|
+
pass
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
@register("tenant_policy_vmm")
|
|
485
|
+
def tenant_policy_vmm(builder: CobraBuilder, value: Any) -> None:
|
|
486
|
+
"""Tenants > Policies > VMM. TODO: implement."""
|
|
487
|
+
pass
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
@register("tenant_service_parameter")
|
|
491
|
+
def tenant_service_parameter(builder: CobraBuilder, value: Any) -> None:
|
|
492
|
+
"""Tenants > Policies > Services > L4-L7 > Service Parameters. TODO: implement."""
|
|
493
|
+
pass
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
@register("tenant_service_graph_template")
|
|
497
|
+
def tenant_service_graph_template(builder: CobraBuilder, value: Any) -> None:
|
|
498
|
+
"""Tenants > Policies > Services > L4-L7 > Service Graph Templates. TODO: implement."""
|
|
499
|
+
pass
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
@register("tenant_service_router_configuration")
|
|
503
|
+
def tenant_service_router_configuration(builder: CobraBuilder, value: Any) -> None:
|
|
504
|
+
"""Tenants > Policies > Services > L4-L7 > Router Configuration. TODO: implement."""
|
|
505
|
+
pass
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
@register("tenant_service_function_profile")
|
|
509
|
+
def tenant_service_function_profile(builder: CobraBuilder, value: Any) -> None:
|
|
510
|
+
"""Tenants > Policies > Services > L4-L7 > Function Profiles. TODO: implement."""
|
|
511
|
+
pass
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
@register("tenant_service_devices")
|
|
515
|
+
def tenant_service_devices(builder: CobraBuilder, value: Any) -> None:
|
|
516
|
+
"""Tenants > Policies > Services > L4-L7 > Devices. TODO: implement."""
|
|
517
|
+
pass
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
@register("tenant_service_imported_device")
|
|
521
|
+
def tenant_service_imported_device(builder: CobraBuilder, value: Any) -> None:
|
|
522
|
+
"""Tenants > Policies > Services > L4-L7 > Imported Devices. TODO: implement."""
|
|
523
|
+
pass
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
@register("tenant_service_device_policy")
|
|
527
|
+
def tenant_service_device_policy(builder: CobraBuilder, value: Any) -> None:
|
|
528
|
+
"""Tenants > Policies > Services > L4-L7 > Device Selection Policies. TODO: implement."""
|
|
529
|
+
pass
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
@register("tenant_service_deployed_graph_instance")
|
|
533
|
+
def tenant_service_deployed_graph_instance(builder: CobraBuilder, value: Any) -> None:
|
|
534
|
+
"""Tenants > Policies > Services > L4-L7 > Deployed Graph Instances. TODO: implement."""
|
|
535
|
+
pass
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
@register("tenant_service_deployed_device")
|
|
539
|
+
def tenant_service_deployed_device(builder: CobraBuilder, value: Any) -> None:
|
|
540
|
+
"""Tenants > Policies > Services > L4-L7 > Deployed Devices. TODO: implement."""
|
|
541
|
+
pass
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
@register("tenant_service_device_manager")
|
|
545
|
+
def tenant_service_device_manager(builder: CobraBuilder, value: Any) -> None:
|
|
546
|
+
"""Tenants > Policies > Services > L4-L7 > Device Managers. TODO: implement."""
|
|
547
|
+
pass
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
@register("tenant_service_chassis")
|
|
551
|
+
def tenant_service_chassis(builder: CobraBuilder, value: Any) -> None:
|
|
552
|
+
"""Tenants > Policies > Services > L4-L7 > Chassis. TODO: implement."""
|
|
553
|
+
pass
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
@register("tenant_node_management_epg")
|
|
557
|
+
def tenant_node_management_epg(builder: CobraBuilder, value: Any) -> None:
|
|
558
|
+
"""Tenants > Node Management EPGs. TODO: implement."""
|
|
559
|
+
pass
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
@register("tenant_external_management_profile")
|
|
563
|
+
def tenant_external_management_profile(builder: CobraBuilder, value: Any) -> None:
|
|
564
|
+
"""Tenants > External Management Network Instance Profiles. TODO: implement."""
|
|
565
|
+
pass
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
@register("tenant_node_management_address")
|
|
569
|
+
def tenant_node_management_address(builder: CobraBuilder, value: Any) -> None:
|
|
570
|
+
"""Tenants > Node Management Address. TODO: implement."""
|
|
571
|
+
pass
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
@register("tenant_node_management_static")
|
|
575
|
+
def tenant_node_management_static(builder: CobraBuilder, value: Any) -> None:
|
|
576
|
+
"""Tenants > Node Management Address > Static Node Management Address. TODO: implement."""
|
|
577
|
+
pass
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
@register("tenant_node_connection_group")
|
|
581
|
+
def tenant_node_connection_group(builder: CobraBuilder, value: Any) -> None:
|
|
582
|
+
"""Tenants > Managed Node Connectivity Groups. TODO: implement."""
|
|
583
|
+
pass
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
# --------------------------------------------------------------------------- Fabric
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
@register("fabricSetupPol")
|
|
590
|
+
def fabric_setup_pol(builder: CobraBuilder, value: Any) -> None:
|
|
591
|
+
"""Fabric > Inventory > Pod Fabric Setup Policy."""
|
|
592
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
593
|
+
Inst = cobra.model.ctrlr.Inst(Uni)
|
|
594
|
+
for fabricSetupPol in value:
|
|
595
|
+
SetupPol = cobra.model.fabric.SetupPol(Inst, **fabricSetupPol)
|
|
596
|
+
builder.config.addMo(SetupPol)
|
|
597
|
+
if "fabricSetupP" in fabricSetupPol:
|
|
598
|
+
for fabricSetupP in fabricSetupPol["fabricSetupP"]:
|
|
599
|
+
SetupP = cobra.model.fabric.SetupP(SetupPol, **fabricSetupP)
|
|
600
|
+
builder.config.addMo(SetupP)
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
@register("fabricRsOosPath")
|
|
604
|
+
def fabric_rs_oos_path(builder: CobraBuilder, value: Any) -> None:
|
|
605
|
+
"""Fabric > RsOosPath."""
|
|
606
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
607
|
+
Inst = cobra.model.fabric.Inst(Uni)
|
|
608
|
+
OOServicePol = cobra.model.fabric.OOServicePol(Inst)
|
|
609
|
+
for fabricRsOosPath in value:
|
|
610
|
+
RsOosPath = cobra.model.fabric.RsOosPath(OOServicePol, **fabricRsOosPath)
|
|
611
|
+
builder.config.addMo(RsOosPath)
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
@register("fabricSetupP")
|
|
615
|
+
def fabric_setup_p(builder: CobraBuilder, value: Any) -> None:
|
|
616
|
+
"""Fabric > Inventory > Pod Fabric Setup Policy."""
|
|
617
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
618
|
+
Inst = cobra.model.ctrlr.Inst(Uni)
|
|
619
|
+
SetupPol = cobra.model.fabric.SetupPol(Inst)
|
|
620
|
+
builder.config.addMo(SetupPol)
|
|
621
|
+
for fabricSetupP in value:
|
|
622
|
+
SetupP = cobra.model.fabric.SetupP(SetupPol, **fabricSetupP)
|
|
623
|
+
builder.config.addMo(SetupP)
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
@register("fabricNodeIdentPol")
|
|
627
|
+
def fabric_node_ident_pol(builder: CobraBuilder, value: Any) -> None:
|
|
628
|
+
"""Fabric > Inventory > Fabric Membership."""
|
|
629
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
630
|
+
Inst = cobra.model.ctrlr.Inst(Uni)
|
|
631
|
+
for fabricNodeIdentPol in value:
|
|
632
|
+
NodeIdentPol = cobra.model.fabric.NodeIdentPol(Inst, **fabricNodeIdentPol)
|
|
633
|
+
builder.config.addMo(NodeIdentPol)
|
|
634
|
+
if "fabricNodeIdentP" in fabricNodeIdentPol:
|
|
635
|
+
for fabricNodeIdentP in fabricNodeIdentPol["fabricNodeIdentP"]:
|
|
636
|
+
NodeIdentP = cobra.model.fabric.NodeIdentP(NodeIdentPol, **fabricNodeIdentP)
|
|
637
|
+
builder.config.addMo(NodeIdentP)
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
@register("fabricPodPGrp")
|
|
641
|
+
def fabric_pod_p_grp(builder: CobraBuilder, value: Any) -> None:
|
|
642
|
+
"""Fabric > Fabric Policies > Pods > Policy Groups."""
|
|
643
|
+
for item in value:
|
|
644
|
+
fabric_inst = cobra.model.fabric.Inst(builder.uni)
|
|
645
|
+
fabric_func_p = cobra.model.fabric.FuncP(fabric_inst)
|
|
646
|
+
mo = cobra.model.fabric.PodPGrp(fabric_func_p, **item)
|
|
647
|
+
if "fabricRtPodPGrp" in item:
|
|
648
|
+
cobra.model.fabric.RtPodPGrp(mo, **item["fabricRtPodPGrp"])
|
|
649
|
+
if "fabricRsSnmpPol" in item:
|
|
650
|
+
cobra.model.fabric.RsSnmpPol(mo, **item["fabricRsSnmpPol"])
|
|
651
|
+
if "fabricRsPodPGrpIsisDomP" in item:
|
|
652
|
+
cobra.model.fabric.RsPodPGrpIsisDomP(mo, **item["fabricRsPodPGrpIsisDomP"])
|
|
653
|
+
if "fabricRsPodPGrpCoopP" in item:
|
|
654
|
+
cobra.model.fabric.RsPodPGrpCoopP(mo, **item["fabricRsPodPGrpCoopP"])
|
|
655
|
+
if "fabricRsPodPGrpBGPRRP" in item:
|
|
656
|
+
cobra.model.fabric.RsPodPGrpBGPRRP(mo, **item["fabricRsPodPGrpBGPRRP"])
|
|
657
|
+
if "fabricRsTimePol" in item:
|
|
658
|
+
cobra.model.fabric.RsTimePol(mo, **item["fabricRsTimePol"])
|
|
659
|
+
if "fabricRsMacsecPol" in item:
|
|
660
|
+
cobra.model.fabric.RsMacsecPol(mo, **item["fabricRsMacsecPol"])
|
|
661
|
+
if "fabricRsCommPol" in item:
|
|
662
|
+
cobra.model.fabric.RsCommPol(mo, **item["fabricRsCommPol"])
|
|
663
|
+
builder.config.addMo(mo)
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
@register("fabricPodP")
|
|
667
|
+
def fabric_pod_p(builder: CobraBuilder, value: Any) -> None:
|
|
668
|
+
"""Fabric > Fabric Policies > Pods > Profiles."""
|
|
669
|
+
for item in value:
|
|
670
|
+
fabric_inst = cobra.model.fabric.Inst(builder.uni)
|
|
671
|
+
mo = cobra.model.fabric.PodP(fabric_inst, **item)
|
|
672
|
+
if "fabricPodS" in item:
|
|
673
|
+
for pod_s in item["fabricPodS"]:
|
|
674
|
+
mo_pod_s = cobra.model.fabric.PodS(mo, **pod_s)
|
|
675
|
+
if "fabricRsPodPGrp" in pod_s:
|
|
676
|
+
cobra.model.fabric.RsPodPGrp(mo_pod_s, **pod_s["fabricRsPodPGrp"])
|
|
677
|
+
if "fabricPodBlk" in pod_s:
|
|
678
|
+
cobra.model.fabric.PodBlk(mo_pod_s, **pod_s["fabricPodBlk"])
|
|
679
|
+
builder.config.addMo(mo)
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
@register("fabric_switch_leaf_profile")
|
|
683
|
+
def fabric_switch_leaf_profile(builder: CobraBuilder, value: Any) -> None:
|
|
684
|
+
"""Fabric > Fabric Policies > Switches > Leaf Switches > Profiles. TODO: implement."""
|
|
685
|
+
pass
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
@register("fabric_switch_leaf_policy_group")
|
|
689
|
+
def fabric_switch_leaf_policy_group(builder: CobraBuilder, value: Any) -> None:
|
|
690
|
+
"""Fabric > Fabric Policies > Switches > Leaf Switches > Policy Groups. TODO: implement."""
|
|
691
|
+
pass
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
@register("fabric_switch_spine_profile")
|
|
695
|
+
def fabric_switch_spine_profile(builder: CobraBuilder, value: Any) -> None:
|
|
696
|
+
"""Fabric > Fabric Policies > Switches > Spine Switches > Profiles. TODO: implement."""
|
|
697
|
+
pass
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
@register("fabric_switch_spine_policy_group")
|
|
701
|
+
def fabric_switch_spine_policy_group(builder: CobraBuilder, value: Any) -> None:
|
|
702
|
+
"""Fabric > Fabric Policies > Switches > Spine Switches > Policy Groups. TODO: implement."""
|
|
703
|
+
pass
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
@register("fabric_module_leaf_profile")
|
|
707
|
+
def fabric_module_leaf_profile(builder: CobraBuilder, value: Any) -> None:
|
|
708
|
+
"""Fabric > Fabric Policies > Modules > Leaf Modules > Profiles. TODO: implement."""
|
|
709
|
+
pass
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
@register("fabric_module_leaf_policy_group")
|
|
713
|
+
def fabric_module_leaf_policy_group(builder: CobraBuilder, value: Any) -> None:
|
|
714
|
+
"""Fabric > Fabric Policies > Modules > Leaf Modules > Policy Groups. TODO: implement."""
|
|
715
|
+
pass
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
@register("fabric_module_spine_profile")
|
|
719
|
+
def fabric_module_spine_profile(builder: CobraBuilder, value: Any) -> None:
|
|
720
|
+
"""Fabric > Fabric Policies > Modules > Spine Modules > Profiles. TODO: implement."""
|
|
721
|
+
pass
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
@register("fabric_module_spine_policy_group")
|
|
725
|
+
def fabric_module_spine_policy_group(builder: CobraBuilder, value: Any) -> None:
|
|
726
|
+
"""Fabric > Fabric Policies > Modules > Spine Modules > Policy Groups. TODO: implement."""
|
|
727
|
+
pass
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
@register("fabric_interface_leaf_profile")
|
|
731
|
+
def fabric_interface_leaf_profile(builder: CobraBuilder, value: Any) -> None:
|
|
732
|
+
"""Fabric > Fabric Policies > Interfaces > Leaf Interfaces > Profiles. TODO: implement."""
|
|
733
|
+
pass
|
|
734
|
+
|
|
735
|
+
|
|
736
|
+
@register("fabric_interface_leaf_policy_group")
|
|
737
|
+
def fabric_interface_leaf_policy_group(builder: CobraBuilder, value: Any) -> None:
|
|
738
|
+
"""Fabric > Fabric Policies > Interfaces > Leaf Interfaces > Policy Groups. TODO: implement."""
|
|
739
|
+
pass
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
@register("fabric_interface_spine_profile")
|
|
743
|
+
def fabric_interface_spine_profile(builder: CobraBuilder, value: Any) -> None:
|
|
744
|
+
"""Fabric > Fabric Policies > Interfaces > Spine Interfaces > Profiles. TODO: implement."""
|
|
745
|
+
pass
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
@register("fabric_interface_spine_policy_group")
|
|
749
|
+
def fabric_interface_spine_policy_group(builder: CobraBuilder, value: Any) -> None:
|
|
750
|
+
"""Fabric > Fabric Policies > Interfaces > Spine Interfaces > Policy Groups. TODO: implement."""
|
|
751
|
+
pass
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
@register("datetimePol")
|
|
755
|
+
def datetime_pol(builder: CobraBuilder, value: Any) -> None:
|
|
756
|
+
"""Fabric > Fabric Policies > Policies > Pod > Date and Time."""
|
|
757
|
+
Inst = cobra.model.fabric.Inst(builder.uni)
|
|
758
|
+
for datetimePol in value:
|
|
759
|
+
Pol = cobra.model.datetime.Pol(Inst, **datetimePol)
|
|
760
|
+
builder.config.addMo(Pol)
|
|
761
|
+
if "datetimeNtpAuthKey" in datetimePol:
|
|
762
|
+
for datetimeNtpAuthKey in datetimePol["datetimeNtpAuthKey"]:
|
|
763
|
+
if not_nan_str(datetimeNtpAuthKey, ["id", "key", "trusted", "keyType"]):
|
|
764
|
+
NtpAuthKey = cobra.model.datetime.NtpAuthKey(Pol, **datetimeNtpAuthKey)
|
|
765
|
+
builder.config.addMo(NtpAuthKey)
|
|
766
|
+
if "datetimeNtpProv" in datetimePol:
|
|
767
|
+
for datetimeNtpProv in datetimePol["datetimeNtpProv"]:
|
|
768
|
+
if not_nan_str(datetimeNtpProv, ["name"]):
|
|
769
|
+
NtpProv = cobra.model.datetime.NtpProv(Pol, **datetimeNtpProv)
|
|
770
|
+
builder.config.addMo(NtpProv)
|
|
771
|
+
if "datetimeRsNtpProvToNtpAuthKey" in datetimeNtpProv:
|
|
772
|
+
for key in datetimeNtpProv["datetimeRsNtpProvToNtpAuthKey"]:
|
|
773
|
+
if not_nan_str(key, ["tnDatetimeNtpAuthKeyId"]):
|
|
774
|
+
RsNtpProvToNtpAuthKey = cobra.model.datetime.RsNtpProvToNtpAuthKey(
|
|
775
|
+
NtpProv, **key
|
|
776
|
+
)
|
|
777
|
+
builder.config.addMo(RsNtpProvToNtpAuthKey)
|
|
778
|
+
if "datetimeRsNtpProvToEpg" in datetimeNtpProv:
|
|
779
|
+
if not_nan_str(datetimeNtpProv["datetimeRsNtpProvToEpg"], ["tDn"]):
|
|
780
|
+
RsNtpProvToEpg = cobra.model.datetime.RsNtpProvToEpg(
|
|
781
|
+
NtpProv, **datetimeNtpProv["datetimeRsNtpProvToEpg"]
|
|
782
|
+
)
|
|
783
|
+
builder.config.addMo(RsNtpProvToEpg)
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
@register("snmpPol")
|
|
787
|
+
def snmp_pol(builder: CobraBuilder, value: Any) -> None:
|
|
788
|
+
"""Fabric > Fabric Policies > Policies > Pod > SNMP."""
|
|
789
|
+
Inst = cobra.model.fabric.Inst(builder.uni)
|
|
790
|
+
for snmpPol in value:
|
|
791
|
+
if not_nan_str(snmpPol, ["name"]):
|
|
792
|
+
Pol = cobra.model.snmp.Pol(Inst, **snmpPol)
|
|
793
|
+
builder.config.addMo(Pol)
|
|
794
|
+
if "snmpClientGrpP" in snmpPol:
|
|
795
|
+
for snmpClientGrpP in snmpPol["snmpClientGrpP"]:
|
|
796
|
+
if not_nan_str(snmpClientGrpP, ["name"]):
|
|
797
|
+
ClientGrpP = cobra.model.snmp.ClientGrpP(Pol, **snmpClientGrpP)
|
|
798
|
+
if "snmpRsEpg" in snmpClientGrpP:
|
|
799
|
+
if not_nan_str(snmpClientGrpP["snmpRsEpg"], ["tDn"]):
|
|
800
|
+
RsEpg = cobra.model.snmp.RsEpg(
|
|
801
|
+
ClientGrpP, **snmpClientGrpP["snmpRsEpg"]
|
|
802
|
+
)
|
|
803
|
+
builder.config.addMo(RsEpg)
|
|
804
|
+
if "snmpClientP" in snmpClientGrpP:
|
|
805
|
+
for snmpClientP in snmpClientGrpP["snmpClientP"]:
|
|
806
|
+
if not_nan_str(snmpClientP, ["name", "addr"]):
|
|
807
|
+
ClientP = cobra.model.snmp.ClientP(ClientGrpP, **snmpClientP)
|
|
808
|
+
builder.config.addMo(ClientP)
|
|
809
|
+
if "snmpUserP" in snmpPol:
|
|
810
|
+
for snmpUserP in snmpPol["snmpUserP"]:
|
|
811
|
+
if not_nan_str(
|
|
812
|
+
snmpUserP, ["name", "privType", "privKey", "authType", "authKey"]
|
|
813
|
+
):
|
|
814
|
+
UserP = cobra.model.snmp.UserP(Pol, **snmpUserP)
|
|
815
|
+
builder.config.addMo(UserP)
|
|
816
|
+
if "snmpCommunityP" in snmpPol:
|
|
817
|
+
for snmpCommunityP in snmpPol["snmpCommunityP"]:
|
|
818
|
+
if not_nan_str(snmpCommunityP, ["name"]):
|
|
819
|
+
CommunityP = cobra.model.snmp.CommunityP(Pol, **snmpCommunityP)
|
|
820
|
+
builder.config.addMo(CommunityP)
|
|
821
|
+
if "snmpTrapFwdServerP" in snmpPol:
|
|
822
|
+
for snmpTrapFwdServerP in snmpPol["snmpTrapFwdServerP"]:
|
|
823
|
+
if not_nan_str(snmpTrapFwdServerP, ["addr", "port"]):
|
|
824
|
+
TrapFwdServerP = cobra.model.snmp.TrapFwdServerP(Pol, **snmpTrapFwdServerP)
|
|
825
|
+
builder.config.addMo(TrapFwdServerP)
|
|
826
|
+
|
|
827
|
+
|
|
828
|
+
@register("commPol")
|
|
829
|
+
def comm_pol(builder: CobraBuilder, value: Any) -> None:
|
|
830
|
+
"""Fabric > Fabric Policies > Policies > Pod > Management Access."""
|
|
831
|
+
Inst = cobra.model.fabric.Inst(builder.uni)
|
|
832
|
+
for commPol in value:
|
|
833
|
+
Pol = cobra.model.comm.Pol(Inst, **commPol)
|
|
834
|
+
builder.config.addMo(Pol)
|
|
835
|
+
if "commTelnet" in commPol:
|
|
836
|
+
if not_nan_str(commPol["commTelnet"], ["name", "adminSt"]):
|
|
837
|
+
Telnet = cobra.model.comm.Telnet(Pol, **commPol["commTelnet"])
|
|
838
|
+
builder.config.addMo(Telnet)
|
|
839
|
+
if "commSsh" in commPol:
|
|
840
|
+
if not_nan_str(commPol["commSsh"], ["name", "adminSt"]):
|
|
841
|
+
Ssh = cobra.model.comm.Ssh(Pol, **commPol["commSsh"])
|
|
842
|
+
builder.config.addMo(Ssh)
|
|
843
|
+
if "commHttp" in commPol:
|
|
844
|
+
if not_nan_str(commPol["commHttp"], ["name", "adminSt"]):
|
|
845
|
+
Http = cobra.model.comm.Http(Pol, **commPol["commHttp"])
|
|
846
|
+
builder.config.addMo(Http)
|
|
847
|
+
if "commHttps" in commPol:
|
|
848
|
+
if not_nan_str(commPol["commHttps"], ["name", "adminSt"]):
|
|
849
|
+
Https = cobra.model.comm.Https(Pol, **commPol["commHttps"])
|
|
850
|
+
builder.config.addMo(Https)
|
|
851
|
+
if "commShellinabox" in commPol:
|
|
852
|
+
if not_nan_str(commPol["commShellinabox"], ["name", "adminSt"]):
|
|
853
|
+
Shellinabox = cobra.model.comm.Shellinabox(Pol, **commPol["commShellinabox"])
|
|
854
|
+
builder.config.addMo(Shellinabox)
|
|
855
|
+
|
|
856
|
+
|
|
857
|
+
@register("fabric_policy_switch_callhome")
|
|
858
|
+
def fabric_policy_switch_callhome(builder: CobraBuilder, value: Any) -> None:
|
|
859
|
+
"""Fabric > Fabric Policies > Policies > Switch > Callhome Inventory. TODO: implement."""
|
|
860
|
+
pass
|
|
861
|
+
|
|
862
|
+
|
|
863
|
+
# --------------------------------------------------------------------------- Infra
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
@register("infraNodeP")
|
|
867
|
+
def infra_node_p(builder: CobraBuilder, value: Any) -> None:
|
|
868
|
+
"""Fabric > Access Policies > Switches > Leaf Switches > Profiles."""
|
|
869
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
870
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
871
|
+
for infraNodeP in value:
|
|
872
|
+
NodeP = cobra.model.infra.NodeP(Infra, **infraNodeP)
|
|
873
|
+
builder.config.addMo(NodeP)
|
|
874
|
+
if "infraLeafS" in infraNodeP:
|
|
875
|
+
for infraLeafS in infraNodeP["infraLeafS"]:
|
|
876
|
+
if not_nan_str(infraLeafS, ["name"]):
|
|
877
|
+
LeafS = cobra.model.infra.LeafS(NodeP, **infraLeafS)
|
|
878
|
+
builder.config.addMo(LeafS)
|
|
879
|
+
if "infraNodeBlk" in infraLeafS:
|
|
880
|
+
if not_nan_str(infraLeafS["infraNodeBlk"], ["from_"]):
|
|
881
|
+
NodeBlk = cobra.model.infra.NodeBlk(LeafS, **infraLeafS["infraNodeBlk"])
|
|
882
|
+
builder.config.addMo(NodeBlk)
|
|
883
|
+
if "infraRsAccNodePGrp" in infraLeafS:
|
|
884
|
+
if not_nan_str(infraLeafS["infraRsAccNodePGrp"], ["tDn"]):
|
|
885
|
+
RsAccNodePGrp = cobra.model.infra.RsAccNodePGrp(
|
|
886
|
+
LeafS, **infraLeafS["infraRsAccNodePGrp"]
|
|
887
|
+
)
|
|
888
|
+
builder.config.addMo(RsAccNodePGrp)
|
|
889
|
+
if "infraRsAccPortP" in infraNodeP:
|
|
890
|
+
for infraRsAccPortP in infraNodeP["infraRsAccPortP"]:
|
|
891
|
+
if not_nan_str(infraRsAccPortP, ["tDn"]):
|
|
892
|
+
RsAccPortP = cobra.model.infra.RsAccPortP(NodeP, **infraRsAccPortP)
|
|
893
|
+
builder.config.addMo(RsAccPortP)
|
|
894
|
+
|
|
895
|
+
|
|
896
|
+
@register("infraAccNodePGrp")
|
|
897
|
+
def infra_acc_node_p_grp(builder: CobraBuilder, value: Any) -> None:
|
|
898
|
+
"""Fabric > Access Policies > Switches > Leaf Switches > Policy Groups."""
|
|
899
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
900
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
901
|
+
FuncP = cobra.model.infra.FuncP(Infra)
|
|
902
|
+
for infraAccNodePGrp in value:
|
|
903
|
+
AccNodePGrp = cobra.model.infra.AccNodePGrp(FuncP, **infraAccNodePGrp)
|
|
904
|
+
builder.config.addMo(AccNodePGrp)
|
|
905
|
+
if "infraRsTopoctrlFwdScaleProfPol" in infraAccNodePGrp:
|
|
906
|
+
if not_nan_str(
|
|
907
|
+
infraAccNodePGrp["infraRsTopoctrlFwdScaleProfPol"],
|
|
908
|
+
["tnTopoctrlFwdScaleProfilePolName"],
|
|
909
|
+
):
|
|
910
|
+
RsTopoctrlFwdScaleProfPol = cobra.model.infra.RsTopoctrlFwdScaleProfPol(
|
|
911
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsTopoctrlFwdScaleProfPol"]
|
|
912
|
+
)
|
|
913
|
+
builder.config.addMo(RsTopoctrlFwdScaleProfPol)
|
|
914
|
+
if "infraRsLeafTopoctrlUsbConfigProfilePol" in infraAccNodePGrp:
|
|
915
|
+
if not_nan_str(
|
|
916
|
+
infraAccNodePGrp["infraRsLeafTopoctrlUsbConfigProfilePol"],
|
|
917
|
+
["tnTopoctrlUsbConfigProfilePolName"],
|
|
918
|
+
):
|
|
919
|
+
RsLeafTopoctrlUsbConfigProfilePol = (
|
|
920
|
+
cobra.model.infra.RsLeafTopoctrlUsbConfigProfilePol(
|
|
921
|
+
AccNodePGrp,
|
|
922
|
+
**infraAccNodePGrp["infraRsLeafTopoctrlUsbConfigProfilePol"],
|
|
923
|
+
)
|
|
924
|
+
)
|
|
925
|
+
builder.config.addMo(RsLeafTopoctrlUsbConfigProfilePol)
|
|
926
|
+
if "infraRsLeafPGrpToLldpIfPol" in infraAccNodePGrp:
|
|
927
|
+
if not_nan_str(infraAccNodePGrp["infraRsLeafPGrpToLldpIfPol"], ["tnLldpIfPolName"]):
|
|
928
|
+
RsLeafPGrpToLldpIfPol = cobra.model.infra.RsLeafPGrpToLldpIfPol(
|
|
929
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsLeafPGrpToLldpIfPol"]
|
|
930
|
+
)
|
|
931
|
+
builder.config.addMo(RsLeafPGrpToLldpIfPol)
|
|
932
|
+
if "infraRsBfdIpv6InstPol" in infraAccNodePGrp:
|
|
933
|
+
if not_nan_str(infraAccNodePGrp["infraRsBfdIpv6InstPol"], ["tnBfdIpv6InstPolName"]):
|
|
934
|
+
RsBfdIpv6InstPol = cobra.model.infra.RsBfdIpv6InstPol(
|
|
935
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsBfdIpv6InstPol"]
|
|
936
|
+
)
|
|
937
|
+
builder.config.addMo(RsBfdIpv6InstPol)
|
|
938
|
+
if "infraRsSynceInstPol" in infraAccNodePGrp:
|
|
939
|
+
if not_nan_str(infraAccNodePGrp["infraRsSynceInstPol"], ["tnSynceInstPolName"]):
|
|
940
|
+
RsSynceInstPol = cobra.model.infra.RsSynceInstPol(
|
|
941
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsSynceInstPol"]
|
|
942
|
+
)
|
|
943
|
+
builder.config.addMo(RsSynceInstPol)
|
|
944
|
+
if "infraRsPoeInstPol" in infraAccNodePGrp:
|
|
945
|
+
if not_nan_str(infraAccNodePGrp["infraRsPoeInstPol"], ["tnPoeInstPolName"]):
|
|
946
|
+
RsPoeInstPol = cobra.model.infra.RsPoeInstPol(
|
|
947
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsPoeInstPol"]
|
|
948
|
+
)
|
|
949
|
+
builder.config.addMo(RsPoeInstPol)
|
|
950
|
+
if "infraRsBfdMhIpv4InstPol" in infraAccNodePGrp:
|
|
951
|
+
if not_nan_str(infraAccNodePGrp["infraRsBfdMhIpv4InstPol"], ["tnBfdMhIpv4InstPolName"]):
|
|
952
|
+
RsBfdMhIpv4InstPol = cobra.model.infra.RsBfdMhIpv4InstPol(
|
|
953
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsBfdMhIpv4InstPol"]
|
|
954
|
+
)
|
|
955
|
+
builder.config.addMo(RsBfdMhIpv4InstPol)
|
|
956
|
+
if "infraRsBfdMhIpv6InstPol" in infraAccNodePGrp:
|
|
957
|
+
if not_nan_str(infraAccNodePGrp["infraRsBfdMhIpv6InstPol"], ["tnBfdMhIpv6InstPolName"]):
|
|
958
|
+
RsBfdMhIpv6InstPol = cobra.model.infra.RsBfdMhIpv6InstPol(
|
|
959
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsBfdMhIpv6InstPol"]
|
|
960
|
+
)
|
|
961
|
+
builder.config.addMo(RsBfdMhIpv6InstPol)
|
|
962
|
+
if "infraRsEquipmentFlashConfigPol" in infraAccNodePGrp:
|
|
963
|
+
if not_nan_str(
|
|
964
|
+
infraAccNodePGrp["infraRsEquipmentFlashConfigPol"],
|
|
965
|
+
["tnEquipmentFlashConfigPolName"],
|
|
966
|
+
):
|
|
967
|
+
RsEquipmentFlashConfigPol = cobra.model.infra.RsEquipmentFlashConfigPol(
|
|
968
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsEquipmentFlashConfigPol"]
|
|
969
|
+
)
|
|
970
|
+
builder.config.addMo(RsEquipmentFlashConfigPol)
|
|
971
|
+
if "infraRsMonNodeInfraPol" in infraAccNodePGrp:
|
|
972
|
+
if not_nan_str(infraAccNodePGrp["infraRsMonNodeInfraPol"], ["tnMonInfraPolName"]):
|
|
973
|
+
RsMonNodeInfraPol = cobra.model.infra.RsMonNodeInfraPol(
|
|
974
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsMonNodeInfraPol"]
|
|
975
|
+
)
|
|
976
|
+
builder.config.addMo(RsMonNodeInfraPol)
|
|
977
|
+
if "infraRsFcInstPol" in infraAccNodePGrp:
|
|
978
|
+
if not_nan_str(infraAccNodePGrp["infraRsFcInstPol"], ["tnFcInstPolName"]):
|
|
979
|
+
RsFcInstPol = cobra.model.infra.RsFcInstPol(
|
|
980
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsFcInstPol"]
|
|
981
|
+
)
|
|
982
|
+
builder.config.addMo(RsFcInstPol)
|
|
983
|
+
if "infraRsTopoctrlFastLinkFailoverInstPol" in infraAccNodePGrp:
|
|
984
|
+
if not_nan_str(
|
|
985
|
+
infraAccNodePGrp["infraRsTopoctrlFastLinkFailoverInstPol"],
|
|
986
|
+
["tnTopoctrlFastLinkFailoverInstPolName"],
|
|
987
|
+
):
|
|
988
|
+
RsTopoctrlFastLinkFailoverInstPol = (
|
|
989
|
+
cobra.model.infra.RsTopoctrlFastLinkFailoverInstPol(
|
|
990
|
+
AccNodePGrp,
|
|
991
|
+
**infraAccNodePGrp["infraRsTopoctrlFastLinkFailoverInstPol"],
|
|
992
|
+
)
|
|
993
|
+
)
|
|
994
|
+
builder.config.addMo(RsTopoctrlFastLinkFailoverInstPol)
|
|
995
|
+
if "infraRsMstInstPol" in infraAccNodePGrp:
|
|
996
|
+
if not_nan_str(infraAccNodePGrp["infraRsMstInstPol"], ["tnStpInstPolName"]):
|
|
997
|
+
RsMstInstPol = cobra.model.infra.RsMstInstPol(
|
|
998
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsMstInstPol"]
|
|
999
|
+
)
|
|
1000
|
+
builder.config.addMo(RsMstInstPol)
|
|
1001
|
+
if "infraRsFcFabricPol" in infraAccNodePGrp:
|
|
1002
|
+
if not_nan_str(infraAccNodePGrp["infraRsFcFabricPol"], ["tnFcFabricPolName"]):
|
|
1003
|
+
RsFcFabricPol = cobra.model.infra.RsFcFabricPol(
|
|
1004
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsFcFabricPol"]
|
|
1005
|
+
)
|
|
1006
|
+
builder.config.addMo(RsFcFabricPol)
|
|
1007
|
+
if "infraRsLeafCoppProfile" in infraAccNodePGrp:
|
|
1008
|
+
if not_nan_str(infraAccNodePGrp["infraRsLeafCoppProfile"], ["tnCoppLeafProfileName"]):
|
|
1009
|
+
RsLeafCoppProfile = cobra.model.infra.RsLeafCoppProfile(
|
|
1010
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsLeafCoppProfile"]
|
|
1011
|
+
)
|
|
1012
|
+
builder.config.addMo(RsLeafCoppProfile)
|
|
1013
|
+
if "infraRsIaclLeafProfile" in infraAccNodePGrp:
|
|
1014
|
+
if not_nan_str(infraAccNodePGrp["infraRsIaclLeafProfile"], ["tnIaclLeafProfileName"]):
|
|
1015
|
+
RsIaclLeafProfile = cobra.model.infra.RsIaclLeafProfile(
|
|
1016
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsIaclLeafProfile"]
|
|
1017
|
+
)
|
|
1018
|
+
builder.config.addMo(RsIaclLeafProfile)
|
|
1019
|
+
if "infraRsBfdIpv4InstPol" in infraAccNodePGrp:
|
|
1020
|
+
if not_nan_str(infraAccNodePGrp["infraRsBfdIpv4InstPol"], ["tnBfdIpv4InstPolName"]):
|
|
1021
|
+
RsBfdIpv4InstPol = cobra.model.infra.RsBfdIpv4InstPol(
|
|
1022
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsBfdIpv4InstPol"]
|
|
1023
|
+
)
|
|
1024
|
+
builder.config.addMo(RsBfdIpv4InstPol)
|
|
1025
|
+
if "infraRsL2NodeAuthPol" in infraAccNodePGrp:
|
|
1026
|
+
if not_nan_str(infraAccNodePGrp["infraRsL2NodeAuthPol"], ["tnL2NodeAuthPolName"]):
|
|
1027
|
+
RsL2NodeAuthPol = cobra.model.infra.RsL2NodeAuthPol(
|
|
1028
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsL2NodeAuthPol"]
|
|
1029
|
+
)
|
|
1030
|
+
builder.config.addMo(RsL2NodeAuthPol)
|
|
1031
|
+
if "infraRsLeafPGrpToCdpIfPol" in infraAccNodePGrp:
|
|
1032
|
+
if not_nan_str(infraAccNodePGrp["infraRsLeafPGrpToCdpIfPol"], ["tnCdpIfPolName"]):
|
|
1033
|
+
RsLeafPGrpToCdpIfPol = cobra.model.infra.RsLeafPGrpToCdpIfPol(
|
|
1034
|
+
AccNodePGrp, **infraAccNodePGrp["infraRsLeafPGrpToCdpIfPol"]
|
|
1035
|
+
)
|
|
1036
|
+
builder.config.addMo(RsLeafPGrpToCdpIfPol)
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
@register("infraSpineP")
|
|
1040
|
+
def infra_spine_p(builder: CobraBuilder, value: Any) -> None:
|
|
1041
|
+
"""Fabric > Access Policies > Switches > Spine Switches > Profiles."""
|
|
1042
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1043
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1044
|
+
for infraSpineP in value:
|
|
1045
|
+
SpineP = cobra.model.infra.SpineP(Infra, **infraSpineP)
|
|
1046
|
+
builder.config.addMo(SpineP)
|
|
1047
|
+
if "infraSpineS" in infraSpineP:
|
|
1048
|
+
for infraSpineS in infraSpineP["infraSpineS"]:
|
|
1049
|
+
SpineS = cobra.model.infra.SpineS(SpineP, **infraSpineS)
|
|
1050
|
+
builder.config.addMo(SpineS)
|
|
1051
|
+
if "infraRsSpineAccNodePGrp" in infraSpineS:
|
|
1052
|
+
RsSpineAccNodePGrp = cobra.model.infra.RsSpineAccNodePGrp(
|
|
1053
|
+
SpineS, **infraSpineS["infraRsSpineAccNodePGrp"]
|
|
1054
|
+
)
|
|
1055
|
+
builder.config.addMo(RsSpineAccNodePGrp)
|
|
1056
|
+
if "infraNodeBlk" in infraSpineS:
|
|
1057
|
+
NodeBlk = cobra.model.infra.NodeBlk(SpineS, **infraSpineS["infraNodeBlk"])
|
|
1058
|
+
builder.config.addMo(NodeBlk)
|
|
1059
|
+
if "infraRsSpAccPortP" in infraSpineP:
|
|
1060
|
+
RsSpAccPortP = cobra.model.infra.RsSpAccPortP(
|
|
1061
|
+
SpineP, **infraSpineP["infraRsSpAccPortP"]
|
|
1062
|
+
)
|
|
1063
|
+
builder.config.addMo(RsSpAccPortP)
|
|
1064
|
+
|
|
1065
|
+
|
|
1066
|
+
@register("infraSpineAccNodePGrp")
|
|
1067
|
+
def infra_spine_acc_node_p_grp(builder: CobraBuilder, value: Any) -> None:
|
|
1068
|
+
"""Fabric > Access Policies > Switches > Spine Switches > Policy Groups."""
|
|
1069
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1070
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1071
|
+
FuncP = cobra.model.infra.FuncP(Infra)
|
|
1072
|
+
for infraSpineAccNodePGrp in value:
|
|
1073
|
+
SpineAccNodePGrp = cobra.model.infra.SpineAccNodePGrp(FuncP, **infraSpineAccNodePGrp)
|
|
1074
|
+
builder.config.addMo(SpineAccNodePGrp)
|
|
1075
|
+
if "infraRsSpineCoppProfile" in infraSpineAccNodePGrp:
|
|
1076
|
+
RsSpineCoppProfile = cobra.model.infra.RsSpineCoppProfile(
|
|
1077
|
+
SpineAccNodePGrp, **infraSpineAccNodePGrp["infraRsSpineCoppProfile"]
|
|
1078
|
+
)
|
|
1079
|
+
builder.config.addMo(RsSpineCoppProfile)
|
|
1080
|
+
if "infraRsSpineBfdIpv4InstPol" in infraSpineAccNodePGrp:
|
|
1081
|
+
RsSpineBfdIpv4InstPol = cobra.model.infra.RsSpineBfdIpv4InstPol(
|
|
1082
|
+
SpineAccNodePGrp, **infraSpineAccNodePGrp["infraRsSpineBfdIpv4InstPol"]
|
|
1083
|
+
)
|
|
1084
|
+
builder.config.addMo(RsSpineBfdIpv4InstPol)
|
|
1085
|
+
if "infraRsSpineBfdIpv6InstPol" in infraSpineAccNodePGrp:
|
|
1086
|
+
RsSpineBfdIpv6InstPol = cobra.model.infra.RsSpineBfdIpv6InstPol(
|
|
1087
|
+
SpineAccNodePGrp, **infraSpineAccNodePGrp["infraRsSpineBfdIpv6InstPol"]
|
|
1088
|
+
)
|
|
1089
|
+
builder.config.addMo(RsSpineBfdIpv6InstPol)
|
|
1090
|
+
if "infraRsIaclSpineProfile" in infraSpineAccNodePGrp:
|
|
1091
|
+
RsIaclSpineProfile = cobra.model.infra.RsIaclSpineProfile(
|
|
1092
|
+
SpineAccNodePGrp, **infraSpineAccNodePGrp["infraRsIaclSpineProfile"]
|
|
1093
|
+
)
|
|
1094
|
+
builder.config.addMo(RsIaclSpineProfile)
|
|
1095
|
+
if "infraRsSpinePGrpToCdpIfPol" in infraSpineAccNodePGrp:
|
|
1096
|
+
RsSpinePGrpToCdpIfPol = cobra.model.infra.RsSpinePGrpToCdpIfPol(
|
|
1097
|
+
SpineAccNodePGrp, **infraSpineAccNodePGrp["infraRsSpinePGrpToCdpIfPol"]
|
|
1098
|
+
)
|
|
1099
|
+
builder.config.addMo(RsSpinePGrpToCdpIfPol)
|
|
1100
|
+
if "infraRsSpinePGrpToLldpIfPol" in infraSpineAccNodePGrp:
|
|
1101
|
+
RsSpinePGrpToLldpIfPol = cobra.model.infra.RsSpinePGrpToLldpIfPol(
|
|
1102
|
+
SpineAccNodePGrp, **infraSpineAccNodePGrp["infraRsSpinePGrpToLldpIfPol"]
|
|
1103
|
+
)
|
|
1104
|
+
builder.config.addMo(RsSpinePGrpToLldpIfPol)
|
|
1105
|
+
|
|
1106
|
+
|
|
1107
|
+
@register("infraSpAccPortP")
|
|
1108
|
+
def infra_sp_acc_port_p(builder: CobraBuilder, value: Any) -> None:
|
|
1109
|
+
"""Fabric > Access Policies > Interfaces > Spine Interfaces > Profiles."""
|
|
1110
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1111
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1112
|
+
for infraSpAccPortP in value:
|
|
1113
|
+
SpAccPortP = cobra.model.infra.SpAccPortP(Infra, **infraSpAccPortP)
|
|
1114
|
+
builder.config.addMo(SpAccPortP)
|
|
1115
|
+
if "infraSHPortS" in infraSpAccPortP:
|
|
1116
|
+
for infraSHPortS in infraSpAccPortP["infraSHPortS"]:
|
|
1117
|
+
SHPortS = cobra.model.infra.SHPortS(SpAccPortP, **infraSHPortS)
|
|
1118
|
+
builder.config.addMo(SHPortS)
|
|
1119
|
+
if "infraRsSpAccGrp" in infraSHPortS:
|
|
1120
|
+
RsSpAccGrp = cobra.model.infra.RsSpAccGrp(
|
|
1121
|
+
SHPortS, **infraSHPortS["infraRsSpAccGrp"]
|
|
1122
|
+
)
|
|
1123
|
+
builder.config.addMo(RsSpAccGrp)
|
|
1124
|
+
if "infraPortBlk" in infraSHPortS:
|
|
1125
|
+
for infraPortBlk in infraSHPortS["infraPortBlk"]:
|
|
1126
|
+
PortBlk = cobra.model.infra.PortBlk(SHPortS, **infraPortBlk)
|
|
1127
|
+
builder.config.addMo(PortBlk)
|
|
1128
|
+
|
|
1129
|
+
|
|
1130
|
+
@register("infraSpAccPortGrp")
|
|
1131
|
+
def infra_sp_acc_port_grp(builder: CobraBuilder, value: Any) -> None:
|
|
1132
|
+
"""Fabric > Access Policies > Interfaces > Spine Interfaces > Policy Groups."""
|
|
1133
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1134
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1135
|
+
FuncP = cobra.model.infra.FuncP(Infra)
|
|
1136
|
+
for infraSpAccPortGrp in value:
|
|
1137
|
+
SpAccPortGrp = cobra.model.infra.SpAccPortGrp(FuncP, **infraSpAccPortGrp)
|
|
1138
|
+
builder.config.addMo(SpAccPortGrp)
|
|
1139
|
+
if "infraRsHIfPol" in infraSpAccPortGrp:
|
|
1140
|
+
RsHIfPol = cobra.model.infra.RsHIfPol(
|
|
1141
|
+
SpAccPortGrp, **infraSpAccPortGrp["infraRsHIfPol"]
|
|
1142
|
+
)
|
|
1143
|
+
builder.config.addMo(RsHIfPol)
|
|
1144
|
+
if "infraRsCdpIfPol" in infraSpAccPortGrp:
|
|
1145
|
+
RsCdpIfPol = cobra.model.infra.RsCdpIfPol(
|
|
1146
|
+
SpAccPortGrp, **infraSpAccPortGrp["infraRsCdpIfPol"]
|
|
1147
|
+
)
|
|
1148
|
+
builder.config.addMo(RsCdpIfPol)
|
|
1149
|
+
if "infraRsMacsecIfPol" in infraSpAccPortGrp:
|
|
1150
|
+
RsMacsecIfPol = cobra.model.infra.RsMacsecIfPol(
|
|
1151
|
+
SpAccPortGrp, **infraSpAccPortGrp["infraRsMacsecIfPol"]
|
|
1152
|
+
)
|
|
1153
|
+
builder.config.addMo(RsMacsecIfPol)
|
|
1154
|
+
if "infraRsAttEntP" in infraSpAccPortGrp:
|
|
1155
|
+
RsAttEntP = cobra.model.infra.RsAttEntP(
|
|
1156
|
+
SpAccPortGrp, **infraSpAccPortGrp["infraRsAttEntP"]
|
|
1157
|
+
)
|
|
1158
|
+
builder.config.addMo(RsAttEntP)
|
|
1159
|
+
if "infraRsLinkFlapPol" in infraSpAccPortGrp:
|
|
1160
|
+
RsLinkFlapPol = cobra.model.infra.RsLinkFlapPol(
|
|
1161
|
+
SpAccPortGrp, **infraSpAccPortGrp["infraRsLinkFlapPol"]
|
|
1162
|
+
)
|
|
1163
|
+
builder.config.addMo(RsLinkFlapPol)
|
|
1164
|
+
if "infraRsCoppIfPol" in infraSpAccPortGrp:
|
|
1165
|
+
RsCoppIfPol = cobra.model.infra.RsCoppIfPol(
|
|
1166
|
+
SpAccPortGrp, **infraSpAccPortGrp["infraRsCoppIfPol"]
|
|
1167
|
+
)
|
|
1168
|
+
builder.config.addMo(RsCoppIfPol)
|
|
1169
|
+
|
|
1170
|
+
|
|
1171
|
+
@register("infraAccPortP")
|
|
1172
|
+
def infra_acc_port_p(builder: CobraBuilder, value: Any) -> None:
|
|
1173
|
+
"""Fabric > Access Policies > Interfaces > Leaf Interfaces > Profiles."""
|
|
1174
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1175
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1176
|
+
for infraAccPortP in value:
|
|
1177
|
+
AccPortP = cobra.model.infra.AccPortP(Infra, **infraAccPortP)
|
|
1178
|
+
builder.config.addMo(AccPortP)
|
|
1179
|
+
if "infraHPortS" in infraAccPortP:
|
|
1180
|
+
for infraHPortS in infraAccPortP["infraHPortS"]:
|
|
1181
|
+
HPortS = cobra.model.infra.HPortS(AccPortP, **infraHPortS)
|
|
1182
|
+
builder.config.addMo(HPortS)
|
|
1183
|
+
if "infraRsAccBaseGrp" in infraHPortS:
|
|
1184
|
+
if not_nan_str(infraHPortS["infraRsAccBaseGrp"], ["tDn"]):
|
|
1185
|
+
RsAccBaseGrp = cobra.model.infra.RsAccBaseGrp(
|
|
1186
|
+
HPortS, **infraHPortS["infraRsAccBaseGrp"]
|
|
1187
|
+
)
|
|
1188
|
+
builder.config.addMo(RsAccBaseGrp)
|
|
1189
|
+
if "infraPortBlk" in infraHPortS:
|
|
1190
|
+
for infraPortBlk in infraHPortS["infraPortBlk"]:
|
|
1191
|
+
if not_nan_str(infraPortBlk, ["fromPort"]):
|
|
1192
|
+
PortBlk = cobra.model.infra.PortBlk(HPortS, **infraPortBlk)
|
|
1193
|
+
builder.config.addMo(PortBlk)
|
|
1194
|
+
|
|
1195
|
+
|
|
1196
|
+
@register("infraFexP")
|
|
1197
|
+
def infra_fex_p(builder: CobraBuilder, value: Any) -> None:
|
|
1198
|
+
"""Fabric > Access Policies > Interfaces > Leaf Interfaces > FEX Profiles."""
|
|
1199
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1200
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1201
|
+
for infraFexP in value:
|
|
1202
|
+
FexP = cobra.model.infra.FexP(Infra, **infraFexP)
|
|
1203
|
+
builder.config.addMo(FexP)
|
|
1204
|
+
if "infraHPortS" in infraFexP:
|
|
1205
|
+
for infraHPortS in infraFexP["infraHPortS"]:
|
|
1206
|
+
HPortS = cobra.model.infra.HPortS(FexP, **infraHPortS)
|
|
1207
|
+
builder.config.addMo(HPortS)
|
|
1208
|
+
if "infraRsAccBaseGrp" in infraHPortS:
|
|
1209
|
+
RsAccBaseGrp = cobra.model.infra.RsAccBaseGrp(
|
|
1210
|
+
HPortS, **infraHPortS["infraRsAccBaseGrp"]
|
|
1211
|
+
)
|
|
1212
|
+
builder.config.addMo(RsAccBaseGrp)
|
|
1213
|
+
if "infraPortBlk" in infraHPortS:
|
|
1214
|
+
for block in infraHPortS["infraPortBlk"]:
|
|
1215
|
+
PortBlk = cobra.model.infra.PortBlk(HPortS, **block)
|
|
1216
|
+
builder.config.addMo(PortBlk)
|
|
1217
|
+
if "infraFexBndlGrp" in infraFexP:
|
|
1218
|
+
FexBndlGrp = cobra.model.infra.FexBndlGrp(FexP, **infraFexP["infraFexBndlGrp"])
|
|
1219
|
+
builder.config.addMo(FexBndlGrp)
|
|
1220
|
+
|
|
1221
|
+
|
|
1222
|
+
@register("infraAccPortGrp")
|
|
1223
|
+
def infra_acc_port_grp(builder: CobraBuilder, value: Any) -> None:
|
|
1224
|
+
"""Fabric > Access Policies > Interfaces > Leaf Interfaces > Policy Groups > Access."""
|
|
1225
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1226
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1227
|
+
FuncP = cobra.model.infra.FuncP(Infra)
|
|
1228
|
+
for infraAccPortGrp in value:
|
|
1229
|
+
AccPortGrp = cobra.model.infra.AccPortGrp(FuncP, **infraAccPortGrp)
|
|
1230
|
+
builder.config.addMo(AccPortGrp)
|
|
1231
|
+
if "infraRsAttEntP" in infraAccPortGrp:
|
|
1232
|
+
if not_nan_str(infraAccPortGrp["infraRsAttEntP"], ["tDn"]):
|
|
1233
|
+
RsAttEntP = cobra.model.infra.RsAttEntP(
|
|
1234
|
+
AccPortGrp, **infraAccPortGrp["infraRsAttEntP"]
|
|
1235
|
+
)
|
|
1236
|
+
builder.config.addMo(RsAttEntP)
|
|
1237
|
+
if "infraRsStpIfPol" in infraAccPortGrp:
|
|
1238
|
+
if not_nan_str(infraAccPortGrp["infraRsStpIfPol"], ["tnStpIfPolName"]):
|
|
1239
|
+
RsStpIfPol = cobra.model.infra.RsStpIfPol(
|
|
1240
|
+
AccPortGrp, **infraAccPortGrp["infraRsStpIfPol"]
|
|
1241
|
+
)
|
|
1242
|
+
builder.config.addMo(RsStpIfPol)
|
|
1243
|
+
if "infraRsQosLlfcIfPol" in infraAccPortGrp:
|
|
1244
|
+
if not_nan_str(infraAccPortGrp["infraRsQosLlfcIfPol"], ["tnQosLlfcIfPolName"]):
|
|
1245
|
+
RsQosLlfcIfPol = cobra.model.infra.RsQosLlfcIfPol(
|
|
1246
|
+
AccPortGrp, **infraAccPortGrp["infraRsQosLlfcIfPol"]
|
|
1247
|
+
)
|
|
1248
|
+
builder.config.addMo(RsQosLlfcIfPol)
|
|
1249
|
+
if "infraRsQosIngressDppIfPol" in infraAccPortGrp:
|
|
1250
|
+
if not_nan_str(infraAccPortGrp["infraRsQosIngressDppIfPol"], ["tnQosDppPolName"]):
|
|
1251
|
+
RsQosIngressDppIfPol = cobra.model.infra.RsQosIngressDppIfPol(
|
|
1252
|
+
AccPortGrp, **infraAccPortGrp["infraRsQosIngressDppIfPol"]
|
|
1253
|
+
)
|
|
1254
|
+
builder.config.addMo(RsQosIngressDppIfPol)
|
|
1255
|
+
if "infraRsStormctrlIfPol" in infraAccPortGrp:
|
|
1256
|
+
if not_nan_str(infraAccPortGrp["infraRsStormctrlIfPol"], ["tnStormctrlIfPolName"]):
|
|
1257
|
+
RsStormctrlIfPol = cobra.model.infra.RsStormctrlIfPol(
|
|
1258
|
+
AccPortGrp, **infraAccPortGrp["infraRsStormctrlIfPol"]
|
|
1259
|
+
)
|
|
1260
|
+
builder.config.addMo(RsStormctrlIfPol)
|
|
1261
|
+
if "infraRsQosEgressDppIfPol" in infraAccPortGrp:
|
|
1262
|
+
if not_nan_str(infraAccPortGrp["infraRsQosEgressDppIfPol"], ["tnQosDppPolName"]):
|
|
1263
|
+
RsQosEgressDppIfPol = cobra.model.infra.RsQosEgressDppIfPol(
|
|
1264
|
+
AccPortGrp, **infraAccPortGrp["infraRsQosEgressDppIfPol"]
|
|
1265
|
+
)
|
|
1266
|
+
builder.config.addMo(RsQosEgressDppIfPol)
|
|
1267
|
+
if "infraRsMonIfInfraPol" in infraAccPortGrp:
|
|
1268
|
+
if not_nan_str(infraAccPortGrp["infraRsMonIfInfraPol"], ["tnMonInfraPolName"]):
|
|
1269
|
+
RsMonIfInfraPol = cobra.model.infra.RsMonIfInfraPol(
|
|
1270
|
+
AccPortGrp, **infraAccPortGrp["infraRsMonIfInfraPol"]
|
|
1271
|
+
)
|
|
1272
|
+
builder.config.addMo(RsMonIfInfraPol)
|
|
1273
|
+
if "infraRsMcpIfPol" in infraAccPortGrp:
|
|
1274
|
+
if not_nan_str(infraAccPortGrp["infraRsMcpIfPol"], ["tnMcpIfPolName"]):
|
|
1275
|
+
RsMcpIfPol = cobra.model.infra.RsMcpIfPol(
|
|
1276
|
+
AccPortGrp, **infraAccPortGrp["infraRsMcpIfPol"]
|
|
1277
|
+
)
|
|
1278
|
+
builder.config.addMo(RsMcpIfPol)
|
|
1279
|
+
if "infraRsMacsecIfPol" in infraAccPortGrp:
|
|
1280
|
+
if not_nan_str(infraAccPortGrp["infraRsMacsecIfPol"], ["tnMacsecIfPolName"]):
|
|
1281
|
+
RsMacsecIfPol = cobra.model.infra.RsMacsecIfPol(
|
|
1282
|
+
AccPortGrp, **infraAccPortGrp["infraRsMacsecIfPol"]
|
|
1283
|
+
)
|
|
1284
|
+
builder.config.addMo(RsMacsecIfPol)
|
|
1285
|
+
if "infraRsQosSdIfPol" in infraAccPortGrp:
|
|
1286
|
+
if not_nan_str(infraAccPortGrp["infraRsQosSdIfPol"], ["tnQosSdIfPolName"]):
|
|
1287
|
+
RsQosSdIfPol = cobra.model.infra.RsQosSdIfPol(
|
|
1288
|
+
AccPortGrp, **infraAccPortGrp["infraRsQosSdIfPol"]
|
|
1289
|
+
)
|
|
1290
|
+
builder.config.addMo(RsQosSdIfPol)
|
|
1291
|
+
if "infraRsCdpIfPol" in infraAccPortGrp:
|
|
1292
|
+
if not_nan_str(infraAccPortGrp["infraRsCdpIfPol"], ["tnCdpIfPolName"]):
|
|
1293
|
+
RsCdpIfPol = cobra.model.infra.RsCdpIfPol(
|
|
1294
|
+
AccPortGrp, **infraAccPortGrp["infraRsCdpIfPol"]
|
|
1295
|
+
)
|
|
1296
|
+
builder.config.addMo(RsCdpIfPol)
|
|
1297
|
+
if "infraRsL2IfPol" in infraAccPortGrp:
|
|
1298
|
+
if not_nan_str(infraAccPortGrp["infraRsL2IfPol"], ["tnL2IfPolName"]):
|
|
1299
|
+
RsL2IfPol = cobra.model.infra.RsL2IfPol(
|
|
1300
|
+
AccPortGrp, **infraAccPortGrp["infraRsL2IfPol"]
|
|
1301
|
+
)
|
|
1302
|
+
builder.config.addMo(RsL2IfPol)
|
|
1303
|
+
if "infraRsQosDppIfPol" in infraAccPortGrp:
|
|
1304
|
+
if not_nan_str(infraAccPortGrp["infraRsQosDppIfPol"], ["tnQosDppPolName"]):
|
|
1305
|
+
RsQosDppIfPol = cobra.model.infra.RsQosDppIfPol(
|
|
1306
|
+
AccPortGrp, **infraAccPortGrp["infraRsQosDppIfPol"]
|
|
1307
|
+
)
|
|
1308
|
+
builder.config.addMo(RsQosDppIfPol)
|
|
1309
|
+
if "infraRsCoppIfPol" in infraAccPortGrp:
|
|
1310
|
+
if not_nan_str(infraAccPortGrp["infraRsCoppIfPol"], ["tnCoppIfPolName"]):
|
|
1311
|
+
RsCoppIfPol = cobra.model.infra.RsCoppIfPol(
|
|
1312
|
+
AccPortGrp, **infraAccPortGrp["infraRsCoppIfPol"]
|
|
1313
|
+
)
|
|
1314
|
+
builder.config.addMo(RsCoppIfPol)
|
|
1315
|
+
if "infraRsDwdmIfPol" in infraAccPortGrp:
|
|
1316
|
+
if not_nan_str(infraAccPortGrp["infraRsDwdmIfPol"], ["tnDwdmIfPolName"]):
|
|
1317
|
+
RsDwdmIfPol = cobra.model.infra.RsDwdmIfPol(
|
|
1318
|
+
AccPortGrp, **infraAccPortGrp["infraRsDwdmIfPol"]
|
|
1319
|
+
)
|
|
1320
|
+
builder.config.addMo(RsDwdmIfPol)
|
|
1321
|
+
if "infraRsLinkFlapPol" in infraAccPortGrp:
|
|
1322
|
+
if not_nan_str(infraAccPortGrp["infraRsLinkFlapPol"], ["tnFabricLinkFlapPolName"]):
|
|
1323
|
+
RsLinkFlapPol = cobra.model.infra.RsLinkFlapPol(
|
|
1324
|
+
AccPortGrp, **infraAccPortGrp["infraRsLinkFlapPol"]
|
|
1325
|
+
)
|
|
1326
|
+
builder.config.addMo(RsLinkFlapPol)
|
|
1327
|
+
if "infraRsLldpIfPol" in infraAccPortGrp:
|
|
1328
|
+
if not_nan_str(infraAccPortGrp["infraRsLldpIfPol"], ["tnLldpIfPolName"]):
|
|
1329
|
+
RsLldpIfPol = cobra.model.infra.RsLldpIfPol(
|
|
1330
|
+
AccPortGrp, **infraAccPortGrp["infraRsLldpIfPol"]
|
|
1331
|
+
)
|
|
1332
|
+
builder.config.addMo(RsLldpIfPol)
|
|
1333
|
+
if "infraRsFcIfPol" in infraAccPortGrp:
|
|
1334
|
+
if not_nan_str(infraAccPortGrp["infraRsFcIfPol"], ["tnFcIfPolName"]):
|
|
1335
|
+
RsFcIfPol = cobra.model.infra.RsFcIfPol(
|
|
1336
|
+
AccPortGrp, **infraAccPortGrp["infraRsFcIfPol"]
|
|
1337
|
+
)
|
|
1338
|
+
builder.config.addMo(RsFcIfPol)
|
|
1339
|
+
if "infraRsQosPfcIfPol" in infraAccPortGrp:
|
|
1340
|
+
if not_nan_str(infraAccPortGrp["infraRsQosPfcIfPol"], ["tnQosPfcIfPolName"]):
|
|
1341
|
+
RsQosPfcIfPol = cobra.model.infra.RsQosPfcIfPol(
|
|
1342
|
+
AccPortGrp, **infraAccPortGrp["infraRsQosPfcIfPol"]
|
|
1343
|
+
)
|
|
1344
|
+
builder.config.addMo(RsQosPfcIfPol)
|
|
1345
|
+
if "infraRsHIfPol" in infraAccPortGrp:
|
|
1346
|
+
if not_nan_str(infraAccPortGrp["infraRsHIfPol"], ["tnFabricHIfPolName"]):
|
|
1347
|
+
RsHIfPol = cobra.model.infra.RsHIfPol(
|
|
1348
|
+
AccPortGrp, **infraAccPortGrp["infraRsHIfPol"]
|
|
1349
|
+
)
|
|
1350
|
+
builder.config.addMo(RsHIfPol)
|
|
1351
|
+
if "infraRsL2PortSecurityPol" in infraAccPortGrp:
|
|
1352
|
+
if not_nan_str(
|
|
1353
|
+
infraAccPortGrp["infraRsL2PortSecurityPol"], ["tnL2PortSecurityPolName"]
|
|
1354
|
+
):
|
|
1355
|
+
RsL2PortSecurityPol = cobra.model.infra.RsL2PortSecurityPol(
|
|
1356
|
+
AccPortGrp, **infraAccPortGrp["infraRsL2PortSecurityPol"]
|
|
1357
|
+
)
|
|
1358
|
+
builder.config.addMo(RsL2PortSecurityPol)
|
|
1359
|
+
if "infraRsL2PortAuthPol" in infraAccPortGrp:
|
|
1360
|
+
if not_nan_str(infraAccPortGrp["infraRsL2PortAuthPol"], ["tnL2PortAuthPolName"]):
|
|
1361
|
+
RsL2PortAuthPol = cobra.model.infra.RsL2PortAuthPol(
|
|
1362
|
+
AccPortGrp, **infraAccPortGrp["infraRsL2PortAuthPol"]
|
|
1363
|
+
)
|
|
1364
|
+
builder.config.addMo(RsL2PortAuthPol)
|
|
1365
|
+
|
|
1366
|
+
|
|
1367
|
+
@register("infraAccBndlGrp")
|
|
1368
|
+
def infra_acc_bndl_grp(builder: CobraBuilder, value: Any) -> None:
|
|
1369
|
+
"""Fabric > Access Policies > Interfaces > Leaf Interfaces > Policy Groups > PC or VPC."""
|
|
1370
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1371
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1372
|
+
FuncP = cobra.model.infra.FuncP(Infra)
|
|
1373
|
+
for infraAccBndlGrp in value:
|
|
1374
|
+
AccBndlGrp = cobra.model.infra.AccBndlGrp(FuncP, **infraAccBndlGrp)
|
|
1375
|
+
builder.config.addMo(AccBndlGrp)
|
|
1376
|
+
if "infraRsAttEntP" in infraAccBndlGrp:
|
|
1377
|
+
if not_nan_str(infraAccBndlGrp["infraRsAttEntP"], ["tDn"]):
|
|
1378
|
+
RsAttEntP = cobra.model.infra.RsAttEntP(
|
|
1379
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsAttEntP"]
|
|
1380
|
+
)
|
|
1381
|
+
builder.config.addMo(RsAttEntP)
|
|
1382
|
+
if "infraRsStpIfPol" in infraAccBndlGrp:
|
|
1383
|
+
if not_nan_str(infraAccBndlGrp["infraRsStpIfPol"], ["tnStpIfPolName"]):
|
|
1384
|
+
RsStpIfPol = cobra.model.infra.RsStpIfPol(
|
|
1385
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsStpIfPol"]
|
|
1386
|
+
)
|
|
1387
|
+
builder.config.addMo(RsStpIfPol)
|
|
1388
|
+
if "infraRsQosLlfcIfPol" in infraAccBndlGrp:
|
|
1389
|
+
if not_nan_str(infraAccBndlGrp["infraRsQosLlfcIfPol"], ["tnQosLlfcIfPolName"]):
|
|
1390
|
+
RsQosLlfcIfPol = cobra.model.infra.RsQosLlfcIfPol(
|
|
1391
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsQosLlfcIfPol"]
|
|
1392
|
+
)
|
|
1393
|
+
builder.config.addMo(RsQosLlfcIfPol)
|
|
1394
|
+
if "infraRsQosIngressDppIfPol" in infraAccBndlGrp:
|
|
1395
|
+
if not_nan_str(infraAccBndlGrp["infraRsQosIngressDppIfPol"], ["tnQosDppPolName"]):
|
|
1396
|
+
RsQosIngressDppIfPol = cobra.model.infra.RsQosIngressDppIfPol(
|
|
1397
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsQosIngressDppIfPol"]
|
|
1398
|
+
)
|
|
1399
|
+
builder.config.addMo(RsQosIngressDppIfPol)
|
|
1400
|
+
if "infraRsStormctrlIfPol" in infraAccBndlGrp:
|
|
1401
|
+
if not_nan_str(infraAccBndlGrp["infraRsStormctrlIfPol"], ["tnStormctrlIfPolName"]):
|
|
1402
|
+
RsStormctrlIfPol = cobra.model.infra.RsStormctrlIfPol(
|
|
1403
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsStormctrlIfPol"]
|
|
1404
|
+
)
|
|
1405
|
+
builder.config.addMo(RsStormctrlIfPol)
|
|
1406
|
+
if "infraRsQosEgressDppIfPol" in infraAccBndlGrp:
|
|
1407
|
+
if not_nan_str(infraAccBndlGrp["infraRsQosEgressDppIfPol"], ["tnQosDppPolName"]):
|
|
1408
|
+
RsQosEgressDppIfPol = cobra.model.infra.RsQosEgressDppIfPol(
|
|
1409
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsQosEgressDppIfPol"]
|
|
1410
|
+
)
|
|
1411
|
+
builder.config.addMo(RsQosEgressDppIfPol)
|
|
1412
|
+
if "infraRsMonIfInfraPol" in infraAccBndlGrp:
|
|
1413
|
+
if not_nan_str(infraAccBndlGrp["infraRsMonIfInfraPol"], ["tnMonInfraPolName"]):
|
|
1414
|
+
RsMonIfInfraPol = cobra.model.infra.RsMonIfInfraPol(
|
|
1415
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsMonIfInfraPol"]
|
|
1416
|
+
)
|
|
1417
|
+
builder.config.addMo(RsMonIfInfraPol)
|
|
1418
|
+
if "infraRsMcpIfPol" in infraAccBndlGrp:
|
|
1419
|
+
if not_nan_str(infraAccBndlGrp["infraRsMcpIfPol"], ["tnMcpIfPolName"]):
|
|
1420
|
+
RsMcpIfPol = cobra.model.infra.RsMcpIfPol(
|
|
1421
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsMcpIfPol"]
|
|
1422
|
+
)
|
|
1423
|
+
builder.config.addMo(RsMcpIfPol)
|
|
1424
|
+
if "infraRsMacsecIfPol" in infraAccBndlGrp:
|
|
1425
|
+
if not_nan_str(infraAccBndlGrp["infraRsMacsecIfPol"], ["tnMacsecIfPolName"]):
|
|
1426
|
+
RsMacsecIfPol = cobra.model.infra.RsMacsecIfPol(
|
|
1427
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsMacsecIfPol"]
|
|
1428
|
+
)
|
|
1429
|
+
builder.config.addMo(RsMacsecIfPol)
|
|
1430
|
+
if "infraRsQosSdIfPol" in infraAccBndlGrp:
|
|
1431
|
+
if not_nan_str(infraAccBndlGrp["infraRsQosSdIfPol"], ["tnQosSdIfPolName"]):
|
|
1432
|
+
RsQosSdIfPol = cobra.model.infra.RsQosSdIfPol(
|
|
1433
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsQosSdIfPol"]
|
|
1434
|
+
)
|
|
1435
|
+
builder.config.addMo(RsQosSdIfPol)
|
|
1436
|
+
if "infraRsCdpIfPol" in infraAccBndlGrp:
|
|
1437
|
+
if not_nan_str(infraAccBndlGrp["infraRsCdpIfPol"], ["tnCdpIfPolName"]):
|
|
1438
|
+
RsCdpIfPol = cobra.model.infra.RsCdpIfPol(
|
|
1439
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsCdpIfPol"]
|
|
1440
|
+
)
|
|
1441
|
+
builder.config.addMo(RsCdpIfPol)
|
|
1442
|
+
if "infraRsL2IfPol" in infraAccBndlGrp:
|
|
1443
|
+
if not_nan_str(infraAccBndlGrp["infraRsL2IfPol"], ["tnL2IfPolName"]):
|
|
1444
|
+
RsL2IfPol = cobra.model.infra.RsL2IfPol(
|
|
1445
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsL2IfPol"]
|
|
1446
|
+
)
|
|
1447
|
+
builder.config.addMo(RsL2IfPol)
|
|
1448
|
+
if "infraRsQosDppIfPol" in infraAccBndlGrp:
|
|
1449
|
+
if not_nan_str(infraAccBndlGrp["infraRsQosDppIfPol"], ["tnQosDppPolName"]):
|
|
1450
|
+
RsQosDppIfPol = cobra.model.infra.RsQosDppIfPol(
|
|
1451
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsQosDppIfPol"]
|
|
1452
|
+
)
|
|
1453
|
+
builder.config.addMo(RsQosDppIfPol)
|
|
1454
|
+
if "infraRsCoppIfPol" in infraAccBndlGrp:
|
|
1455
|
+
if not_nan_str(infraAccBndlGrp["infraRsCoppIfPol"], ["tnCoppIfPolName"]):
|
|
1456
|
+
RsCoppIfPol = cobra.model.infra.RsCoppIfPol(
|
|
1457
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsCoppIfPol"]
|
|
1458
|
+
)
|
|
1459
|
+
builder.config.addMo(RsCoppIfPol)
|
|
1460
|
+
if "infraRsLldpIfPol" in infraAccBndlGrp:
|
|
1461
|
+
if not_nan_str(infraAccBndlGrp["infraRsLldpIfPol"], ["tnLldpIfPolName"]):
|
|
1462
|
+
RsLldpIfPol = cobra.model.infra.RsLldpIfPol(
|
|
1463
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsLldpIfPol"]
|
|
1464
|
+
)
|
|
1465
|
+
builder.config.addMo(RsLldpIfPol)
|
|
1466
|
+
if "infraRsFcIfPol" in infraAccBndlGrp:
|
|
1467
|
+
if not_nan_str(infraAccBndlGrp["infraRsFcIfPol"], ["tnFcIfPolName"]):
|
|
1468
|
+
RsFcIfPol = cobra.model.infra.RsFcIfPol(
|
|
1469
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsFcIfPol"]
|
|
1470
|
+
)
|
|
1471
|
+
builder.config.addMo(RsFcIfPol)
|
|
1472
|
+
if "infraRsQosPfcIfPol" in infraAccBndlGrp:
|
|
1473
|
+
if not_nan_str(infraAccBndlGrp["infraRsQosPfcIfPol"], ["tnQosPfcIfPolName"]):
|
|
1474
|
+
RsQosPfcIfPol = cobra.model.infra.RsQosPfcIfPol(
|
|
1475
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsQosPfcIfPol"]
|
|
1476
|
+
)
|
|
1477
|
+
builder.config.addMo(RsQosPfcIfPol)
|
|
1478
|
+
if "infraRsHIfPol" in infraAccBndlGrp:
|
|
1479
|
+
if not_nan_str(infraAccBndlGrp["infraRsHIfPol"], ["tnFabricHIfPolName"]):
|
|
1480
|
+
RsHIfPol = cobra.model.infra.RsHIfPol(
|
|
1481
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsHIfPol"]
|
|
1482
|
+
)
|
|
1483
|
+
builder.config.addMo(RsHIfPol)
|
|
1484
|
+
if "infraRsL2PortSecurityPol" in infraAccBndlGrp:
|
|
1485
|
+
if not_nan_str(
|
|
1486
|
+
infraAccBndlGrp["infraRsL2PortSecurityPol"], ["tnL2PortSecurityPolName"]
|
|
1487
|
+
):
|
|
1488
|
+
RsL2PortSecurityPol = cobra.model.infra.RsL2PortSecurityPol(
|
|
1489
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsL2PortSecurityPol"]
|
|
1490
|
+
)
|
|
1491
|
+
builder.config.addMo(RsL2PortSecurityPol)
|
|
1492
|
+
if "infraRsL2PortAuthPol" in infraAccBndlGrp:
|
|
1493
|
+
if not_nan_str(infraAccBndlGrp["infraRsL2PortAuthPol"], ["tnL2PortAuthPolName"]):
|
|
1494
|
+
RsL2PortAuthPol = cobra.model.infra.RsL2PortAuthPol(
|
|
1495
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsL2PortAuthPol"]
|
|
1496
|
+
)
|
|
1497
|
+
builder.config.addMo(RsL2PortAuthPol)
|
|
1498
|
+
if "infraRsLacpPol" in infraAccBndlGrp:
|
|
1499
|
+
if not_nan_str(infraAccBndlGrp["infraRsLacpPol"], ["tnLacpLagPolName"]):
|
|
1500
|
+
RsLacpPol = cobra.model.infra.RsLacpPol(
|
|
1501
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsLacpPol"]
|
|
1502
|
+
)
|
|
1503
|
+
builder.config.addMo(RsLacpPol)
|
|
1504
|
+
if "infraRsLinkFlapPol" in infraAccBndlGrp:
|
|
1505
|
+
if not_nan_str(infraAccBndlGrp["infraRsLinkFlapPol"], ["tnFabricLinkFlapPolName"]):
|
|
1506
|
+
RsLinkFlapPol = cobra.model.infra.RsLinkFlapPol(
|
|
1507
|
+
AccBndlGrp, **infraAccBndlGrp["infraRsLinkFlapPol"]
|
|
1508
|
+
)
|
|
1509
|
+
builder.config.addMo(RsLinkFlapPol)
|
|
1510
|
+
|
|
1511
|
+
|
|
1512
|
+
@register("infraAttEntityP")
|
|
1513
|
+
def infra_att_entity_p(builder: CobraBuilder, value: Any) -> None:
|
|
1514
|
+
"""Fabric > Access Policies > Policies > Global > Attachable Access Entity Profiles."""
|
|
1515
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1516
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1517
|
+
for infraAttEntityP in value:
|
|
1518
|
+
AttEntityP = cobra.model.infra.AttEntityP(Infra, **infraAttEntityP)
|
|
1519
|
+
builder.config.addMo(AttEntityP)
|
|
1520
|
+
if "infraRsDomP" in infraAttEntityP:
|
|
1521
|
+
for infraRsDomP in infraAttEntityP["infraRsDomP"]:
|
|
1522
|
+
RsDomP = cobra.model.infra.RsDomP(AttEntityP, **infraRsDomP)
|
|
1523
|
+
builder.config.addMo(RsDomP)
|
|
1524
|
+
|
|
1525
|
+
|
|
1526
|
+
@register("fvnsVlanInstP")
|
|
1527
|
+
def fvns_vlan_inst_p(builder: CobraBuilder, value: Any) -> None:
|
|
1528
|
+
"""Fabric > Access Policies > Pools > VLAN."""
|
|
1529
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1530
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1531
|
+
for fvnsVlanInstP in value:
|
|
1532
|
+
VlanInstP = cobra.model.fvns.VlanInstP(Infra, **fvnsVlanInstP)
|
|
1533
|
+
builder.config.addMo(VlanInstP)
|
|
1534
|
+
if "fvnsEncapBlk" in fvnsVlanInstP:
|
|
1535
|
+
for fvnsEncapBlk in fvnsVlanInstP["fvnsEncapBlk"]:
|
|
1536
|
+
EncapBlk = cobra.model.fvns.EncapBlk(VlanInstP, **fvnsEncapBlk)
|
|
1537
|
+
builder.config.addMo(EncapBlk)
|
|
1538
|
+
|
|
1539
|
+
|
|
1540
|
+
@register("physDomP")
|
|
1541
|
+
def phys_dom_p(builder: CobraBuilder, value: Any) -> None:
|
|
1542
|
+
"""Fabric > Access Policies > Physical and External Domains > Physical Domain."""
|
|
1543
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1544
|
+
for physDomP in value:
|
|
1545
|
+
DomP = cobra.model.phys.DomP(Uni, **physDomP)
|
|
1546
|
+
builder.config.addMo(DomP)
|
|
1547
|
+
if "infraRsVlanNs" in physDomP:
|
|
1548
|
+
RsVlanNs = cobra.model.infra.RsVlanNs(DomP, **physDomP["infraRsVlanNs"])
|
|
1549
|
+
builder.config.addMo(RsVlanNs)
|
|
1550
|
+
|
|
1551
|
+
|
|
1552
|
+
@register("l3extDomP")
|
|
1553
|
+
def l3ext_dom_p(builder: CobraBuilder, value: Any) -> None:
|
|
1554
|
+
"""Fabric > Access Policies > Physical and External Domains > L3 Domains."""
|
|
1555
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1556
|
+
for l3extDomP in value:
|
|
1557
|
+
DomP = cobra.model.l3ext.DomP(Uni, **l3extDomP)
|
|
1558
|
+
builder.config.addMo(DomP)
|
|
1559
|
+
if "infraRsVlanNs" in l3extDomP:
|
|
1560
|
+
RsVlanNs = cobra.model.infra.RsVlanNs(DomP, **l3extDomP["infraRsVlanNs"])
|
|
1561
|
+
builder.config.addMo(RsVlanNs)
|
|
1562
|
+
|
|
1563
|
+
|
|
1564
|
+
@register("l2extDomP")
|
|
1565
|
+
def l2ext_dom_p(builder: CobraBuilder, value: Any) -> None:
|
|
1566
|
+
"""Fabric > Access Policies > Physical and External Domains > External Bridged Domains."""
|
|
1567
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1568
|
+
for l2extDomP in value:
|
|
1569
|
+
DomP = cobra.model.l2ext.DomP(Uni, **l2extDomP)
|
|
1570
|
+
builder.config.addMo(DomP)
|
|
1571
|
+
if "infraRsVlanNs" in l2extDomP:
|
|
1572
|
+
RsVlanNs = cobra.model.infra.RsVlanNs(DomP, **l2extDomP["infraRsVlanNs"])
|
|
1573
|
+
builder.config.addMo(RsVlanNs)
|
|
1574
|
+
|
|
1575
|
+
|
|
1576
|
+
# --------------------------------------------------------------------------- Policies
|
|
1577
|
+
|
|
1578
|
+
|
|
1579
|
+
@register("fabricProtPol")
|
|
1580
|
+
def fabric_prot_pol(builder: CobraBuilder, value: Any) -> None:
|
|
1581
|
+
"""Fabric > Access Policies > Policies > Switch > Virtual Port Channel default."""
|
|
1582
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1583
|
+
Inst = cobra.model.fabric.Inst(Uni)
|
|
1584
|
+
for fabricProtPol in value:
|
|
1585
|
+
ProtPol = cobra.model.fabric.ProtPol(Inst, **fabricProtPol)
|
|
1586
|
+
builder.config.addMo(ProtPol)
|
|
1587
|
+
if "fabricExplicitGEp" in fabricProtPol:
|
|
1588
|
+
for fabricExplicitGEp in fabricProtPol["fabricExplicitGEp"]:
|
|
1589
|
+
ExplicitGEp = cobra.model.fabric.ExplicitGEp(ProtPol, **fabricExplicitGEp)
|
|
1590
|
+
builder.config.addMo(ExplicitGEp)
|
|
1591
|
+
if "fabricRsVpcInstPol" in fabricExplicitGEp:
|
|
1592
|
+
RsVpcInstPol = cobra.model.fabric.RsVpcInstPol(
|
|
1593
|
+
ExplicitGEp, **fabricExplicitGEp["fabricRsVpcInstPol"]
|
|
1594
|
+
)
|
|
1595
|
+
builder.config.addMo(RsVpcInstPol)
|
|
1596
|
+
if "fabricNodePEp" in fabricExplicitGEp:
|
|
1597
|
+
for fabricNodePEp in fabricExplicitGEp["fabricNodePEp"]:
|
|
1598
|
+
NodePEp = cobra.model.fabric.NodePEp(ExplicitGEp, **fabricNodePEp)
|
|
1599
|
+
builder.config.addMo(NodePEp)
|
|
1600
|
+
|
|
1601
|
+
|
|
1602
|
+
@register("fabricHIfPol")
|
|
1603
|
+
def fabric_h_if_pol(builder: CobraBuilder, value: Any) -> None:
|
|
1604
|
+
"""Fabric > Access Policies > Policies > Interface > Link Level."""
|
|
1605
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1606
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1607
|
+
for fabricHIfPol in value:
|
|
1608
|
+
HIfPol = cobra.model.fabric.HIfPol(Infra, **fabricHIfPol)
|
|
1609
|
+
builder.config.addMo(HIfPol)
|
|
1610
|
+
|
|
1611
|
+
|
|
1612
|
+
@register("qosPfcIfPol")
|
|
1613
|
+
def qos_pfc_if_pol(builder: CobraBuilder, value: Any) -> None:
|
|
1614
|
+
"""Fabric > Access Policies > Policies > Interface > Priority Flow Control."""
|
|
1615
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1616
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1617
|
+
for qosPfcIfPol in value:
|
|
1618
|
+
PfcIfPol = cobra.model.qos.PfcIfPol(Infra, **qosPfcIfPol)
|
|
1619
|
+
builder.config.addMo(PfcIfPol)
|
|
1620
|
+
|
|
1621
|
+
|
|
1622
|
+
@register("cdpIfPol")
|
|
1623
|
+
def cdp_if_pol(builder: CobraBuilder, value: Any) -> None:
|
|
1624
|
+
"""Fabric > Access Policies > Policies > Interface > CDP Interface."""
|
|
1625
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1626
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1627
|
+
for cdpIfPol in value:
|
|
1628
|
+
IfPol = cobra.model.cdp.IfPol(Infra, **cdpIfPol)
|
|
1629
|
+
builder.config.addMo(IfPol)
|
|
1630
|
+
|
|
1631
|
+
|
|
1632
|
+
@register("lldpIfPol")
|
|
1633
|
+
def lldp_if_pol(builder: CobraBuilder, value: Any) -> None:
|
|
1634
|
+
"""Fabric > Access Policies > Policies > Interface > LLDP Interface."""
|
|
1635
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1636
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1637
|
+
for lldpIfPol in value:
|
|
1638
|
+
IfPol = cobra.model.lldp.IfPol(Infra, **lldpIfPol)
|
|
1639
|
+
builder.config.addMo(IfPol)
|
|
1640
|
+
|
|
1641
|
+
|
|
1642
|
+
@register("lacpLagPol")
|
|
1643
|
+
def lacp_lag_pol(builder: CobraBuilder, value: Any) -> None:
|
|
1644
|
+
"""Fabric > Access Policies > Policies > Interface > Port Channel."""
|
|
1645
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1646
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1647
|
+
for lacpLagPol in value:
|
|
1648
|
+
LagPol = cobra.model.lacp.LagPol(Infra, **lacpLagPol)
|
|
1649
|
+
builder.config.addMo(LagPol)
|
|
1650
|
+
|
|
1651
|
+
|
|
1652
|
+
@register("stpIfPol")
|
|
1653
|
+
def stp_if_pol(builder: CobraBuilder, value: Any) -> None:
|
|
1654
|
+
"""Fabric > Access Policies > Policies > Interface > Spanning Tree Interface."""
|
|
1655
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1656
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1657
|
+
for stpIfPol in value:
|
|
1658
|
+
IfPol = cobra.model.stp.IfPol(Infra, **stpIfPol)
|
|
1659
|
+
builder.config.addMo(IfPol)
|
|
1660
|
+
|
|
1661
|
+
|
|
1662
|
+
@register("stormctrlIfPol")
|
|
1663
|
+
def stormctrl_if_pol(builder: CobraBuilder, value: Any) -> None:
|
|
1664
|
+
"""Fabric > Access Policies > Policies > Interface > Storm Control."""
|
|
1665
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1666
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1667
|
+
for stormctrlIfPol in value:
|
|
1668
|
+
IfPol = cobra.model.stormctrl.IfPol(Infra, **stormctrlIfPol)
|
|
1669
|
+
builder.config.addMo(IfPol)
|
|
1670
|
+
|
|
1671
|
+
|
|
1672
|
+
@register("mcpIfPol")
|
|
1673
|
+
def mcp_if_pol(builder: CobraBuilder, value: Any) -> None:
|
|
1674
|
+
"""Fabric > Access Policies > Policies > Interface > MCP Interface."""
|
|
1675
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1676
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1677
|
+
for mcpIfPol in value:
|
|
1678
|
+
IfPol = cobra.model.mcp.IfPol(Infra, **mcpIfPol)
|
|
1679
|
+
builder.config.addMo(IfPol)
|
|
1680
|
+
|
|
1681
|
+
|
|
1682
|
+
@register("bgpInstPol")
|
|
1683
|
+
def bgp_inst_pol(builder: CobraBuilder, value: Any) -> None:
|
|
1684
|
+
"""System Settings > All Tenants."""
|
|
1685
|
+
Inst = cobra.model.fabric.Inst(builder.uni)
|
|
1686
|
+
for bgpInstPol in value:
|
|
1687
|
+
InstPol = cobra.model.bgp.InstPol(Inst, **bgpInstPol)
|
|
1688
|
+
builder.config.addMo(InstPol)
|
|
1689
|
+
if "bgpAsP" in bgpInstPol:
|
|
1690
|
+
if not_nan_str(bgpInstPol["bgpAsP"], ["asn"]):
|
|
1691
|
+
AsP = cobra.model.bgp.AsP(InstPol, **bgpInstPol["bgpAsP"])
|
|
1692
|
+
builder.config.addMo(AsP)
|
|
1693
|
+
if "bgpRRP" in bgpInstPol:
|
|
1694
|
+
RRP = cobra.model.bgp.RRP(InstPol)
|
|
1695
|
+
builder.config.addMo(RRP)
|
|
1696
|
+
for bgpRRP in bgpInstPol["bgpRRP"]:
|
|
1697
|
+
if "bgpRRNodePEp" in bgpRRP:
|
|
1698
|
+
RRNodePEp = cobra.model.bgp.RRNodePEp(RRP, **bgpRRP["bgpRRNodePEp"])
|
|
1699
|
+
builder.config.addMo(RRNodePEp)
|
|
1700
|
+
if "ExtRRP" in bgpInstPol:
|
|
1701
|
+
ExtRRP = cobra.model.bgp.ExtRRP(InstPol)
|
|
1702
|
+
for extRRP in bgpInstPol["ExtRRP"]:
|
|
1703
|
+
RRNodePEp = cobra.model.bgp.RRNodePEp(ExtRRP, **extRRP)
|
|
1704
|
+
builder.config.addMo(RRNodePEp)
|
|
1705
|
+
|
|
1706
|
+
|
|
1707
|
+
@register("coopPol")
|
|
1708
|
+
def coop_pol(builder: CobraBuilder, value: Any) -> None:
|
|
1709
|
+
"""System Settings > COOP Group."""
|
|
1710
|
+
Inst = cobra.model.fabric.Inst(builder.uni)
|
|
1711
|
+
for coopPol in value:
|
|
1712
|
+
Pol = cobra.model.coop.Pol(Inst, **coopPol)
|
|
1713
|
+
builder.config.addMo(Pol)
|
|
1714
|
+
|
|
1715
|
+
|
|
1716
|
+
@register("datetimeFormat")
|
|
1717
|
+
def datetime_format(builder: CobraBuilder, value: Any) -> None:
|
|
1718
|
+
"""System Settings > Date and Time."""
|
|
1719
|
+
Inst = cobra.model.fabric.Inst(builder.uni)
|
|
1720
|
+
for datetimeFormat in value:
|
|
1721
|
+
Format = cobra.model.datetime.Format(Inst, **datetimeFormat)
|
|
1722
|
+
builder.config.addMo(Format)
|
|
1723
|
+
|
|
1724
|
+
|
|
1725
|
+
@register("aaaFabricSec")
|
|
1726
|
+
def aaa_fabric_sec(builder: CobraBuilder, value: Any) -> None:
|
|
1727
|
+
"""System Settings > Fabric Security."""
|
|
1728
|
+
UserEp = cobra.model.aaa.UserEp(builder.uni)
|
|
1729
|
+
for aaaFabricSec in value:
|
|
1730
|
+
FabricSec = cobra.model.aaa.FabricSec(UserEp, **aaaFabricSec)
|
|
1731
|
+
builder.config.addMo(FabricSec)
|
|
1732
|
+
|
|
1733
|
+
|
|
1734
|
+
@register("aaaPreLoginBanner")
|
|
1735
|
+
def aaa_pre_login_banner(builder: CobraBuilder, value: Any) -> None:
|
|
1736
|
+
"""System Settings > System Alias and Banners."""
|
|
1737
|
+
UserEp = cobra.model.aaa.UserEp(builder.uni)
|
|
1738
|
+
for aaaPreLoginBanner in value:
|
|
1739
|
+
PreLoginBanner = cobra.model.aaa.PreLoginBanner(UserEp, **aaaPreLoginBanner)
|
|
1740
|
+
builder.config.addMo(PreLoginBanner)
|
|
1741
|
+
|
|
1742
|
+
|
|
1743
|
+
@register("pkiExportEncryptionKey")
|
|
1744
|
+
def pki_export_encryption_key(builder: CobraBuilder, value: Any) -> None:
|
|
1745
|
+
"""System Settings > Fabric Security."""
|
|
1746
|
+
for pkiExportEncryptionKey in value:
|
|
1747
|
+
ExportEncryptionKey = cobra.model.pki.ExportEncryptionKey(
|
|
1748
|
+
builder.uni, **pkiExportEncryptionKey
|
|
1749
|
+
)
|
|
1750
|
+
builder.config.addMo(ExportEncryptionKey)
|
|
1751
|
+
|
|
1752
|
+
|
|
1753
|
+
@register("epLoopProtectP")
|
|
1754
|
+
def ep_loop_protect_p(builder: CobraBuilder, value: Any) -> None:
|
|
1755
|
+
"""System Settings > Enpoint Controls > The endpoint loop protection."""
|
|
1756
|
+
Infra = cobra.model.infra.Infra(builder.uni)
|
|
1757
|
+
for epLoopProtectP in value:
|
|
1758
|
+
LoopProtectP = cobra.model.ep.LoopProtectP(Infra, **epLoopProtectP)
|
|
1759
|
+
builder.config.addMo(LoopProtectP)
|
|
1760
|
+
|
|
1761
|
+
|
|
1762
|
+
@register("epControlP")
|
|
1763
|
+
def ep_control_p(builder: CobraBuilder, value: Any) -> None:
|
|
1764
|
+
"""System Settings > Enpoint Controls > Rogue EP Control."""
|
|
1765
|
+
Infra = cobra.model.infra.Infra(builder.uni)
|
|
1766
|
+
for epControlP in value:
|
|
1767
|
+
ControlP = cobra.model.ep.ControlP(Infra, **epControlP)
|
|
1768
|
+
builder.config.addMo(ControlP)
|
|
1769
|
+
|
|
1770
|
+
|
|
1771
|
+
@register("epIpAgingP")
|
|
1772
|
+
def ep_ip_aging_p(builder: CobraBuilder, value: Any) -> None:
|
|
1773
|
+
"""System Settings > Enpoint Controls > IP Aging."""
|
|
1774
|
+
Infra = cobra.model.infra.Infra(builder.uni)
|
|
1775
|
+
for epIpAgingP in value:
|
|
1776
|
+
IpAgingP = cobra.model.ep.IpAgingP(Infra, **epIpAgingP)
|
|
1777
|
+
builder.config.addMo(IpAgingP)
|
|
1778
|
+
|
|
1779
|
+
|
|
1780
|
+
@register("infraSetPol")
|
|
1781
|
+
def infra_set_pol(builder: CobraBuilder, value: Any) -> None:
|
|
1782
|
+
"""System Settings > Fabric-Wide Settings."""
|
|
1783
|
+
Infra = cobra.model.infra.Infra(builder.uni)
|
|
1784
|
+
for infraSetPol in value:
|
|
1785
|
+
SetPol = cobra.model.infra.SetPol(Infra, **infraSetPol)
|
|
1786
|
+
builder.config.addMo(SetPol)
|
|
1787
|
+
|
|
1788
|
+
|
|
1789
|
+
@register("isisDomPol")
|
|
1790
|
+
def isis_dom_pol(builder: CobraBuilder, value: Any) -> None:
|
|
1791
|
+
"""System Settings > ISIS Policy."""
|
|
1792
|
+
Inst = cobra.model.fabric.Inst(builder.uni)
|
|
1793
|
+
for isisDomPol in value:
|
|
1794
|
+
DomPol = cobra.model.isis.DomPol(Inst, **isisDomPol)
|
|
1795
|
+
builder.config.addMo(DomPol)
|
|
1796
|
+
|
|
1797
|
+
|
|
1798
|
+
@register("infraPortTrackPol")
|
|
1799
|
+
def infra_port_track_pol(builder: CobraBuilder, value: Any) -> None:
|
|
1800
|
+
"""System Settings > Port Tracking."""
|
|
1801
|
+
Infra = cobra.model.infra.Infra(builder.uni)
|
|
1802
|
+
for infraPortTrackPol in value:
|
|
1803
|
+
PortTrackPol = cobra.model.infra.PortTrackPol(Infra, **infraPortTrackPol)
|
|
1804
|
+
builder.config.addMo(PortTrackPol)
|
|
1805
|
+
|
|
1806
|
+
|
|
1807
|
+
@register("mcpInstPol")
|
|
1808
|
+
def mcp_inst_pol(builder: CobraBuilder, value: Any) -> None:
|
|
1809
|
+
"""Fabric > Access Policies > Global > MCP Instance Policy default."""
|
|
1810
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1811
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1812
|
+
for mcpInstPol in value:
|
|
1813
|
+
InstPol = cobra.model.mcp.InstPol(Infra, **mcpInstPol)
|
|
1814
|
+
builder.config.addMo(InstPol)
|
|
1815
|
+
|
|
1816
|
+
|
|
1817
|
+
@register("fabricNodeControl")
|
|
1818
|
+
def fabric_node_control(builder: CobraBuilder, value: Any) -> None:
|
|
1819
|
+
"""Fabric > Fabric Policies > Policies > Monitoring > Fabric Node Controls > default."""
|
|
1820
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1821
|
+
Inst = cobra.model.fabric.Inst(Uni)
|
|
1822
|
+
for fabricNodeControl in value:
|
|
1823
|
+
NodeControl = cobra.model.fabric.NodeControl(Inst, **fabricNodeControl)
|
|
1824
|
+
builder.config.addMo(NodeControl)
|
|
1825
|
+
|
|
1826
|
+
|
|
1827
|
+
@register("geoSite")
|
|
1828
|
+
def geo_site(builder: CobraBuilder, value: Any) -> None:
|
|
1829
|
+
"""Fabric > Fabric Policies > Policies > Geolocation."""
|
|
1830
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1831
|
+
Inst = cobra.model.fabric.Inst(Uni)
|
|
1832
|
+
for geoSite in value:
|
|
1833
|
+
Site = cobra.model.geo.Site(Inst, **geoSite)
|
|
1834
|
+
builder.config.addMo(Site)
|
|
1835
|
+
if "geoBuilding" in geoSite:
|
|
1836
|
+
for geoBuilding in geoSite["geoBuilding"]:
|
|
1837
|
+
Building = cobra.model.geo.Building(Site, **geoBuilding)
|
|
1838
|
+
builder.config.addMo(Building)
|
|
1839
|
+
if "geoFloor" in geoBuilding:
|
|
1840
|
+
for geoFloor in geoBuilding["geoFloor"]:
|
|
1841
|
+
Floor = cobra.model.geo.Floor(Building, **geoFloor)
|
|
1842
|
+
builder.config.addMo(Floor)
|
|
1843
|
+
if "geoRoom" in geoFloor:
|
|
1844
|
+
for geoRoom in geoFloor["geoRoom"]:
|
|
1845
|
+
Room = cobra.model.geo.Room(Floor, **geoRoom)
|
|
1846
|
+
builder.config.addMo(Room)
|
|
1847
|
+
if "geoRow" in geoRoom:
|
|
1848
|
+
for geoRow in geoRoom["geoRow"]:
|
|
1849
|
+
Row = cobra.model.geo.Row(Room, **geoRow)
|
|
1850
|
+
builder.config.addMo(Row)
|
|
1851
|
+
if "geoRack" in geoRow:
|
|
1852
|
+
for geoRack in geoRow["geoRack"]:
|
|
1853
|
+
if not_nan_str(geoRack, ["name"]):
|
|
1854
|
+
Rack = cobra.model.geo.Rack(Row, **geoRack)
|
|
1855
|
+
builder.config.addMo(Rack)
|
|
1856
|
+
if "geoRsNodeLocation" in geoRack:
|
|
1857
|
+
for loc in geoRack["geoRsNodeLocation"]:
|
|
1858
|
+
if not_nan_str(loc, ["tDn"]):
|
|
1859
|
+
RsNodeLocation = (
|
|
1860
|
+
cobra.model.geo.RsNodeLocation(
|
|
1861
|
+
Rack, **loc
|
|
1862
|
+
)
|
|
1863
|
+
)
|
|
1864
|
+
builder.config.addMo(RsNodeLocation)
|
|
1865
|
+
|
|
1866
|
+
|
|
1867
|
+
@register("latencyPtpMode")
|
|
1868
|
+
def latency_ptp_mode(builder: CobraBuilder, value: Any) -> None:
|
|
1869
|
+
"""Fabric > Fabric Policies > Policies > Monitoring > Fabric Node Controls > default."""
|
|
1870
|
+
Inst = cobra.model.fabric.Inst(builder.uni)
|
|
1871
|
+
for latencyPtpMode in value:
|
|
1872
|
+
PtpMode = cobra.model.latency.PtpMode(Inst, **latencyPtpMode)
|
|
1873
|
+
builder.config.addMo(PtpMode)
|
|
1874
|
+
|
|
1875
|
+
|
|
1876
|
+
@register("infrazoneZoneP")
|
|
1877
|
+
def infrazone_zone_p(builder: CobraBuilder, value: Any) -> None:
|
|
1878
|
+
"""Fabric > Fabric Policies > Policies > Monitoring > Fabric Node Controls > default."""
|
|
1879
|
+
Uni = cobra.model.pol.Uni(builder.root)
|
|
1880
|
+
Infra = cobra.model.infra.Infra(Uni)
|
|
1881
|
+
ZoneP = cobra.model.infrazone.ZoneP(Infra, **value)
|
|
1882
|
+
builder.config.addMo(ZoneP)
|
|
1883
|
+
for infrazoneZone in value:
|
|
1884
|
+
if "Zone" in infrazoneZone:
|
|
1885
|
+
Zone = cobra.model.infrazone.Zone(ZoneP, **infrazoneZone["Zone"])
|
|
1886
|
+
builder.config.addMo(Zone)
|