While attempting to execute addTargetApplication an error was seen for one attempt, while another worked. The one that failed included the following message:
CommandLineInterface.execute error in GET:Connection refused: connect java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at
Any supported PAM release.
The error "connection refused" message indicates that the wrong address might have been specified for PAM. Another possibility is that the address is correct. but CLI was not enabled on PAM.
Make sure to check the possible causes mentioned above if you see the problem.
See e.g. https://docops.ca.com/ca-privileged-access-manager/3-2-2/EN/programming/credential-manager-remote-cli-and-java-api/install-and-set-up-the-remote-cli-and-java-api#InstallandSetUptheRemoteCLIandJavaAPI-EnabletheCredentialManagerCLI on how to enable the remote CLI.