cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1250
Views
0
Helpful
2
Replies

ACI API - UCSD Invalid uri - escaped absolute path not valid

bradksmith01
Level 1
Level 1

I'm using generic API tasks to query ACI on interface objects.  I'm pretty far down in my queries, and successful so far, but one query in particular fails and returns the following....

 

Oddly, this same path works with Postman.  I am successfully authenticating to ACI, and carrying my cookie strings between tasks.  Any ideas ??

 

ACI API Test (Execute Generic API) failed with error - Invalid uri '/api/node/mo/topology/pod-1/node-201/sys/phys-[eth1/96]/phys.json': escaped absolute path not valid, selectedContext=<None>

 

 

2 Replies 2

bradksmith01
Level 1
Level 1
It seems this is an issue with the use of [ ] in the api path. Is there an escape character or something that can be used to get around this issue?

So, it’s a URL encoding issue. I did some research online, and found that UCS Director isn’t encoding the square braces natively, so it generates an error.

So this URI API Path - /api/node/mo/topology/pod-1/node-201/sys/phys-[eth1/96]/phys.json

The [ ] need to be encoded manually to this in Hex

Left Square Bracket ("[") 5B
Right Square Bracket ("]") 5D

/api/node/mo/topology/pod-1/node-201/sys/phys-%5Beth1/96%5D/phys.json

Once I replaced the [ with %5B and ] with %5D, UCS Director was able to properly send the API path to ACI and return the correct results.

Jul 14, 2019 18:42:31 CDT ALL ($) = {'totalCount':'1','imdata':[{'ethpmPhysIf':{'attributes':{'accessVlan':'unknown','allowedVlans':'','backplaneMac':'00:42:68:6D:4C:7A','bundleBupId':'1','bundleIndex':'unspecified','cfgAccessVlan':'unknown','cfgNativeVlan':'unknown','childAction':'','currErrIndex':'4294967295','diags':'none','dn':'topology/pod-1/node-201/sys/phys-[eth1/96]/phys','encap':'3','errDisTimerRunning':'no','errVlanStatusHt':'0','errVlans':'','hwBdId':'0','hwResourceId':'0','intfT':'phy','iod':'100','lastErrors':'0','lastLinkStChg':'1969-12-31T19:00:00.000-05:00','media':'2','modTs':'never','monPolDn':'uni/infra/moninfra-default','nativeVlan':'unknown','numOfSI':'0','operBitset':'4','operDceMode':'edge','operDuplex':'full','operEEERxWkTime':'0','operEEEState':'not-applicable','operEEETxWkTime':'0','operErrDisQual':'none','operFecMode':'disable-fec','operFlowCtrl':'0','operMdix':'auto','operMode':'trunk','operModeDetail':'unknown','operPhyEnSt':'unknown','operRouterMac':'00:00:00:00:00:00','operSpeed':'10G','operSt':'down','operStQual':'link-failure','operStQualCode':'0','operVlans':'','osSum':'failed','portCfgWaitFlags':'0','primaryVlan':'vlan-1','resetCtr':'0','siList':'','status':'','txT':'unknown','usage':'discovery','userCfgdFlags':'0','vdcId':'1'}}}]}

Jul 14, 2019 18:42:31 CDT Task #3 (ACI API Test (Execute Generic API)) completed successfully in 0 seconds
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Cisco UCS X-Series Energy Efficiency Offer