We have an API to check which certificate will expire in a month: https://OPS-MANAGER-FQDN/api/v0/deployed/certificates?expires_within=6m
For an already rotated certificate, we don’t have an API.
Opsman
We can obtain certificates that have been rotated within the last month using the OM CLI. This involves getting a list of certificates and processing their creation dates.
In your workspace, create a YAML file that represents your Tanzu Operations Manager environment. Give the file a name. For example:
Add the following content to the file. For more information about configuring the file, see Generating an Env File in the Platform Automation Toolkit documentation.
Where: OPS-MANAGER-FQDN is the FQDN of your Tanzu Operations Manager deployment. export OM_ENV=PATH-TO-WORKING-DIRECTORY/om-cli-env.yml Run : om -k --env=$OM_ENV curl -s --path=/api/v0/deployed/certificates | jq \ --argjson cutoff "$(date -v-1m +%s)" ' .certificates[] | select(.valid_from != null) | select((.valid_from | fromdateiso8601) >= $cutoff) | { property_reference: (.property_reference // .variable_path), valid_from: .valid_from, valid_until: .valid_until, issuer: .issuer }'
|