Changing Access List Entries Programmatically - TADDM/taddm-wiki GitHub Wiki
The following code snippet shows how to change an access list entry password programmatically in Java. The access entry must first be deleted before the update call in order for the password to be properly updated. The example shown below is for changing a vCenter access list entry.
final String AUTHCLASS_VC = "com.collation.platform.security.auth.VCAuth";
String accessEntryName = "myVCenterCredentials";
DiscoveryAccessEntry vCenter = api.getDiscoveryAccessEntry(AUTHCLASS_VC, accessEntryName);
if (vCenter != null)
{
api.deleteDiscoveryAccessEntry(vCenter.getAuthClassName(), vCenter.getName());
String newPassword = "mynewpassword";
vCenter.setProperty(DiscoveryAccessEntry.PROPERTY_PASSWORD, newPassword);
DiscoveryAccessEntry updatedDAE = api.updateDiscoveryAccessEntry(vCenter);
}