08-05-2022 06:30 AM
Hi,
I am trying to attach an existing EPG to an existing AEP with the REST API.
This is the config I have:
"infraRsFuncToEpg":{
"attributes":{
"dn":"uni/infra/attentp-{{aep}}/gen-default/rsfuncToEpg-[uni/tn-{{tenant}}/ap-{{app_profile}}/{{epg}}]",
"encap":"vlan-{{vlan}}",
"instrImedcy":"lazy",
"mode":"regular",
"primaryEncap":"unknown",
"state":"formed",
"status":"",
"tDn":"uni/tn-{{tenant}}/ap-{{app_profile}}/{{epg}}",
}
}
I am getting the following error:
Any ideas?
Thank you in advance!
Quint
Solved! Go to Solution.
08-08-2022 05:56 AM
Hi,
Thanks to @RedNectar I found the solution.
I've added attribute to the infraGeneric. (See in red)
{
"totalCount": "1",
"imdata": [{
"infraAttEntityP": {
"attributes": {
"dn": "uni/infra/attentp-{{aep}}",
"name": "{{aep}}"
},
"children": [{
"infraGeneric": {
"attributes": {
"name": "default"
}
"children": [{
"infraRsFuncToEpg": {
"attributes": {
"encap": "vlan-{{vlan}}",
"instrImedcy": "lazy",
"mode": "regular",
"primaryEncap": "unknown",
"tDn": "uni/tn-{{tenant}}/ap-{{app_profile}}/epg-{{epg}}"
}
}
}]
}
}]
}
}]
}
08-05-2022 02:52 PM - edited 08-05-2022 10:29 PM
Hi @QuintH ,
You say you are using the REST API - but you JSON looks like it is full of variables, so you are not telling the WHOLE story - are you using Postman? Are you using Jinja? Are you you simply pushing the JSON using maybe a python script.
Try using the JSON below, in particular, note the letters epg-
in the line "tDn": "uni/tn-{{tenant}}/ap-{{app_profile}}/epg-{{epg}}"
{ "totalCount": "1", "imdata": [{ "infraAttEntityP": { "attributes": { "dn": "uni/infra/attentp-{{aep}}", "name": "{{aep}}" }, "children": [{ "infraGeneric": { "children": [{ "infraRsFuncToEpg": { "attributes": { "encap": "vlan-{{vlan}}", "instrImedcy": "lazy", "mode": "regular", "primaryEncap": "unknown", "tDn": "uni/tn-{{tenant}}/ap-{{app_profile}}/epg-{{epg}}" } } }] } }] } }] }
08-08-2022 02:55 AM
Hi @RedNectar !
Thank you for the quick answer!
Sorry that I did not mention it, but yes I am using Postman.
I tried your code but I get an error:
08-08-2022 02:20 PM
08-08-2022 05:56 AM
Hi,
Thanks to @RedNectar I found the solution.
I've added attribute to the infraGeneric. (See in red)
{
"totalCount": "1",
"imdata": [{
"infraAttEntityP": {
"attributes": {
"dn": "uni/infra/attentp-{{aep}}",
"name": "{{aep}}"
},
"children": [{
"infraGeneric": {
"attributes": {
"name": "default"
}
"children": [{
"infraRsFuncToEpg": {
"attributes": {
"encap": "vlan-{{vlan}}",
"instrImedcy": "lazy",
"mode": "regular",
"primaryEncap": "unknown",
"tDn": "uni/tn-{{tenant}}/ap-{{app_profile}}/epg-{{epg}}"
}
}
}]
}
}]
}
}]
}
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide