Hello,
I'm trying to use the XML API to update a StaticHostList, and running into an error that I'm not sure how to interpret. Here's the initial Request, retrieved using "https://clearpass/tipsapi/config/read/StaticHostList":
<TipsApiResponse xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader exportTime="Thu May 26 16:59:31 PDT 2016" version="6.5"/>
<StatusCode>Success</StatusCode>
<StaticHostLists>
<StaticHostList description="MAC Addresses of devices violating security policy or other" name="quarantined devices" memberType="MACAddress" memberFormat="list" members="01:23:45:67:89:ab"/>
<StaticHostList description="" name="test" memberType="MACAddress" memberFormat="list" members="12:34:56:78:90:ab, 00:11:22:33:44:55, aa:bb:cc:dd:ee:ff"/>
</StaticHostLists>
</TipsApiResponse>
So, then I manipulate the StaticHostList entry that matches the name "test", to remove one of the entries. When that's done, I post the following to "https://clearpass/tipsapi/config/write/StaticHostList":
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiRequest xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader version="6.5"/>
<StaticHostLists>
<StaticHostList xmlns="http://www.avendasys.com/tipsapiDefs/1.0" description="" name="test" memberType="MACAddress" memberFormat="list" members="12:34:56:78:90:ab, aa:bb:cc:dd:ee:ff"/>
</StaticHostLists>
</TipsApiRequest>
But, this throws an error:
<TipsApiResponse xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader exportTime="Thu May 26 16:59:32 PDT 2016" version="6.5"/>
<StatusCode>Failure</StatusCode>
<TipsApiError>
<ErrorCode>InvalidXml</ErrorCode>
<Message>Error at: [lineNumber: 6, columnNumber: 19]</Message>
<Message> Element 'StaticHostLists' cannot have character [children], because the type's content type is element-only.</Message>
</TipsApiError>
</TipsApiResponse>
Can someone help me properly form this POST to remove the entry? I understand from an old post I found that elements like StaticHostList were such that you have to replace the entire entry. But, that code was using version 3.0. I've tried to consult the docs, but there aren't any relevent examples. The XML I'm posting is virtually the same as what I understand the format is if I were to upload an XML through the GUI.
Thanks