How to retrieve SMTP credentials in BOSH Director and EAR (Elastic Application Runtime) tile?
How to retrieve SMTP credentials in BOSH Director?
Method 1:
If you have access to the Ops Manager UI or API, then access https://OpsManager-FQDN/api/v0/staged/director/properties?redact=false to retrieve the BOSH director configuration including the SMTP config/credentials looks like the following:
Method 2:
If you prefer the use of OM cli, then use om -k -e om-env.yml curl --path "/api/v0/staged/director/properties?redact=false" | jq '.director_configuration.hm_emailer_options' command to retrieve the SMTP configuration.
How to retrieve SMTP credentials in EAR tile?
Method 1:
If you have access to the Ops Manager UI or API, then access https://OpsManager-FQDN/api/v0/deployed/products/cf-abc123/credentials/.properties.smtp_credentials to retrieve the SMTP credentials. (Replace cf-abc123 with the actual deployment GUID for your EAR title)
Method 2:
If you prefer the use of credhub cli, then use credhub get -n "/opsmgr/cf-abc123/smtp_credentials" command to retrieve the SMTP credentials. (Replace cf-abc123 with the actual deployment GUID for your EAR title)
* Refer to How to access Tanzu Operations Manager CredHub with the CredHub CLI to connect to the OpsManager CredHUb CLI.