CredHub has two API endpoints to identify and reuse variables. To see all the credentials associated with your product, or you want to troubleshoot problems specific to one virtual machine (VM), you can use these APIs for those purposes.
The API endpoints perform these functions:
You can Use endpoints to view variables for any product in Tanzu Operations Manager, except the BOSH Director. These endpoints are read-only. You cannot use them to add, remove, or rotate variables.
This endpoint returns the list of variables associated with a product that are stored in CredHub. Not all variables are stored in CredHub. If you call a variable that is not stored in CredHub, the call returns an empty value.
$ curl "https://OPS-MAN-FQDN/api/variables"
-X GET \
-H "Authorization: Bearer EXAMPLE_UAA_ACCESS_TOKEN"
HTTP/1.1 200 OK { "variables": ["FIRST-EXAMPLE-VARIABLE", "SECOND-EXAMPLE-VARIABLE", "THIRD-EXAMPLE-VARIABLE"] }
Parameter | Description |
---|---|
product_guid | The unique product identifier, formatted as a text string |
This endpoint returns the name of the variable. Use the name in the next endpoint to return the variable value.
This endpoint returns the value of a variable stored in CredHub. Not all variables are stored in CredHub, because if you call a variable that is not in CredHub, the call returns an empty value.
$ curl "https://OPS-MAN-FQDN/api/variables" name=EXAMPLE-VARIABLE-NAME" \
-X GET \
-H "Authorization: Bearer UAA_ACCESS_TOKEN"
HTTP/1.1 200 OK { "credhub-password": "EXAMPLE-PASSWORD" }
Parameter | Description |
---|---|
variable_name | The name of the variable, formatted as a text string |
product_guid | The unique product identifier, formatted as a text string |