Requirement:How to delete/modify an endpoint attribute using tips API?
For example: I have the endpoint attribute called "Location" with the Value "Lab" Can I delete/modify only the Location attribute?
Solution:You could send/post the API request using the respective tag of an attribute with an empty value, this will remove the attribute from the endpoint which you want to delete.
To modify an attribute value, just post the api request with the new value.
Note: This functionality is only supported from the ClearPass version 6.5.1
Configuration:
The below sample tips api request will change/update the Location attribute value to "Reception" in the database[Endpoints Repository].
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiRequest xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader version="3.0"/>
<Endpoints>
<Endpoint status="Known" macAddress="112233445566">
<EndpointTags tagName="Location" tagValue="Reception"/>
</Endpoint>
</Endpoints>
</TipsApiRequest>'
The below sample tips api request will remove/delete only the Location attribute from the database[Endpoints Repository].
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiRequest xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader version="3.0"/>
<Endpoints>
<Endpoint status="Known" macAddress="112233445566">
<EndpointTags tagName="Location" tagValue=""/>
</Endpoint>
</Endpoints>
</TipsApiRequest>'
VerificationTips API POST/GET requires authentication. You could use the default "apiadmin" account available under Administration >> Users and Privileges >> Admin Users.
Ex 1: Updating an endpoint Attribute.
curl -sk -o - -u apiadmin:password -d '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiRequest xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader version="3.0"/>
<Endpoints>
<Endpoint status="Known" macAddress="112233445566">
<EndpointTags tagName="Location" tagValue="Reception"/>
</Endpoint>
</Endpoints>
</TipsApiRequest>' https://<cppm-ip-address/hostname>/tipsapi/config/write/Endpoint
Ex 2: Deleting an endpoint attribute.
curl -sk -o - -u apiadmin:password -d '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TipsApiRequest xmlns="http://www.avendasys.com/tipsapiDefs/1.0">
<TipsHeader version="3.0"/>
<Endpoints>
<Endpoint status="Known" macAddress="112233445566">
<EndpointTags tagName="Location" tagValue=""/>
</Endpoint>
</Endpoints>
</TipsApiRequest>' https://<cppm-ip-address/hostname>/tipsapi/config/write/Endpoint
In the above output the Location attribute alone was removed/deleted.
The successful post from any Linux system will return the status code as shown below.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><TipsApiResponse xmlns="http://www.avendasys.com/tipsapiDefs/1.0"><TipsHeader exportTime="Wed Aug 26 19:57:38 IST 2015" version="6.5"/><StatusCode>Success</StatusCode><LogMessages><Message>Updated 1 endpoint(s)</Message></LogMessages></TipsApiResponse>