Tanzu Ops Manager API Reference

Tanzu Ops Manager API Reference

Parallel Calls

This API does not support parallel API calls.

NOTE: this restriction applies to all API calls made to the Ops Manager. Simultaneous serial API calls made by different users are also unsupported. Ops Manager does not care which user makes the API call, only if an API call is made while another API call is being processed. Parallel calls do not return an error code when they fail.

How to Authenticate

You must pass a token to each API endpoint. To get a token, and curl an API endpoint using that token, follow these instructions:

Installing uaac

From a command line with Ruby installed, install the cf-uaac gem:

gem install cf-uaac

Obtaining a uaac token

Target your Tanzu Ops Manager IP. You may need to pass the --skip-ssl-validation flag if the opsman certificate is self-signed:

uaac target https://YOUR_OPSMAN_IP/uaa

Log in to your Tanzu Ops Manager with the Client name "opsman" and empty Client secret:

uaac token owner get

Client name: opsman
Client secret: JUST_PRESS_ENTER

Using uaac curl

uaac now has your token and you can now use uaac curl:

uaac curl <ENDPOINT>

For example, uaac curl -k /info

You can also use other HTTP methods such as POST, PUT, and DELETE:

uaac curl -X POST -H "Content-type: application/json" <ENDPOINT> -d '<JSON BODY>'

For example, uaac curl -k -X PUT -H "Content-type: application/json" https://om.tas.pivotal.io/api/v0/settings/pruning -d '{"days_to_keep":120}'

Using regular curl

Use uaac context and get the access_token:

curl -H "Authorization: Bearer UAA_ACCESS_TOKEN" <ENDPOINT>