03-16-2017 12:24 PM - edited 03-01-2019 05:10 AM
Hi,
I am trying to push this script from postman, getting syntex error, not getting the exact problem.
IN POST SECTION: http://{{apic}}/api/node/mo/uni/tn-{{tenant}}/BD-{{bd-name}}.json
{
"fvBD": {
"attributes": {
"dn": "uni/tn-{{tenant}}/BD-{{bd-name}}",
"mac": "00:22:BD:F8:19:FF",
"name": "{{bd-name}}",
"rn": "BD-{{bd-name}}",
"status": "created"
},
"children": [
{
"fvRsCtx": {
"attributes": {
"tnFvCtxName": "Main",
"status": "created,modified"
},
"children": []
}
}
]
}
}
Regards
Kumar
Solved! Go to Solution.
03-20-2017 12:25 AM
Hi Kumar,
ok, I see. Didn't know about environments and thought you were "hiding" your values...
Anyways:
Tried it with variables now and it didn't work for me either. However, if you change the POST url to https://{{apic}}/api/node/mo.json it does work.
But you need to have the tenant already in place then. If everything should be created if it doesn't exist yet, try this one:
{
"polUni" : {
"attributes" : {
}
"children : [{
"fvTenant" : {
"attributes" : {
"name" : "{{tenant}}"
}
"children : [{
"fvCtx" : {
"attributes" : {
"name" : "Main"
}
}
},
{
"fvBD": {
"attributes": {
"dn": "uni/tn-{{tenant}}/BD-{{bd-name}}"
},
"children": [
{
"fvRsCtx": {
"attributes": {
"tnFvCtxName": "Main"
}
}
}
]
}
}]
}
}]
}
}
Regards,
Nik
03-17-2017 09:11 AM
Hi Kumar,
I don't see the problem. Copied your script, exchanged the variables for actual names (shown in blue) and it works fine for me:
{
"fvBD": {
"attributes": {
"dn": "uni/tn-documentation/BD-bd-test",
"mac": "00:22:BD:F8:19:FF",
"name": "bd-test",
"rn": "BD-bd-test",
"status": "created"
},
"children": [
{
"fvRsCtx": {
"attributes": {
"tnFvCtxName": "Main",
"status": "created,modified"
},
"children": []
}
}
]
}
}
I get a 200 OK and the BD actually appears in my tenant.
Could you specify the error you get?
Did you authenticate first?
Did you send the script to the correct URL (https://<APIC_IP>/api/node/mo.json)?
By the way: You don't need most of the stuff, this would work just as fine:
{
"fvBD": {
"attributes": {
"dn": "uni/tn-documentation/BD-bd-test"
},
"children": [
{
"fvRsCtx": {
"attributes": {
"tnFvCtxName": "Main"
}
}
}
]
}
}
03-17-2017 09:27 AM
03-20-2017 12:25 AM
Hi Kumar,
ok, I see. Didn't know about environments and thought you were "hiding" your values...
Anyways:
Tried it with variables now and it didn't work for me either. However, if you change the POST url to https://{{apic}}/api/node/mo.json it does work.
But you need to have the tenant already in place then. If everything should be created if it doesn't exist yet, try this one:
{
"polUni" : {
"attributes" : {
}
"children : [{
"fvTenant" : {
"attributes" : {
"name" : "{{tenant}}"
}
"children : [{
"fvCtx" : {
"attributes" : {
"name" : "Main"
}
}
},
{
"fvBD": {
"attributes": {
"dn": "uni/tn-{{tenant}}/BD-{{bd-name}}"
},
"children": [
{
"fvRsCtx": {
"attributes": {
"tnFvCtxName": "Main"
}
}
}
]
}
}]
}
}]
}
}
Regards,
Nik
03-20-2017 09:28 AM
Issue with URL, fixed, thanks for fix,
seems to be code also has issue?? not sure what is difference between your code and my code
03-20-2017 11:57 PM
No, your code should be fine. I just left out attributes that are not required to get the job done (e.g. "mac": "00:22:BD:F8:19:FF" since it's the default anyway).
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