Software Development Kit (SDK) and API Discussions

system-cli gives xml.parsers.expat.ExpatError: not well-formed error

ana_sgr_1985
1,667 Views

Hi Everyone,

 

I am in peculiar situation where after migration of host from (change of IP), I want to flush the nblade access from the node/vserver for specific host and policy via automation:

 

I am trying to do that in using system-cli because there is no API available for this task ( in my knowledge, correct me if I am wrong here).

 

Here is my input NaElement:

 

<system-cli>

<priv>diagnostic</priv>

<args>

<arg>nblade</arg>

<arg>access-cache</arg>

<arg>flush</arg>

<arg>vserver</arg>

<arg>myVserver</arg>

<arg>node</arg>

<arg>myNode</arg>

<arg>address</arg>

<arg>myHostIPAddress</arg>

<arg>policy</arg>

<arg>myPolicy</arg>

</args>

</system-cli>

 

It errors out like this:

 

    p.Parse(xmlresponse, 1)

xml.parsers.expat.ExpatError: not well-formed (invalid token): line 5, column 0

 

It seems that line in xml input "<arg>access-cache</arg>" is not getting parsed. If I remove this line, API call goes through but obviously, I get command not found type output.

 

Is there a workaround for this?

 

Any and all suggestions are welcome.

 

Thanks

Anand

0 REPLIES 0
Public