Learn how to use the REST API outside of the in-product API documentation UI.

The REST API enables you to interact with the VMware Tanzu Observability service (formerly known as VMware Aria Operations for Applications) by using standard REST API tools. You can use the REST API to automate commonly executed operations, for example, to tag sources automatically.

When you make REST API calls outside the REST API documentation UI, you must use a token to authenticate. The token that you need depends on your subscription type.

  • For VMware Cloud services subscriptions, invoking the Operations for Application REST API requires a VMware Cloud services access token.

    • User accounts use VMware Cloud services API tokens to retrieve access tokens. See How do I generate API tokens in the VMware Cloud services documentation.

    • Server to server apps, which correspond to service accounts in Tanzu Observability, use OAuth 2.0 client credentials (ID and secret) to retrieve access tokens. See How to use OAuth 2.0 for server to server apps in the VMware Cloud services documentation.

  • For original subscriptions, invoking the Operations for Application REST API requires an Operations for Application API token. An API token can be associated with a user account or service account See Manage API Tokens.

VMware Cloud Services Subscriptions

Invoking the REST API of a Tanzu Observability subscription on VMware Cloud services requires a VMware Cloud services access token.

Make API Calls by Using a User Account

If you want to use your own user account to make REST API calls, generate a VMware Cloud services API token associated with your user account and exchange it for an access token.

  1. Log in to the VMware Cloud Services Console.
  2. Click your username, select My Account and, on the API Tokens tab, generate a new token.
  3. Copy and save the newly generated API token in a secure place.

  4. Exchange the newly generated API token for an access token.

    1. Go to the Authentication VMware Cloud services APIs.
    2. In the POST/am/api/auth/api-tokens/authorize request, click Try it out.
    3. For the api_token parameter, enter the value of the newly generated API token.
    4. Deselect the Send empty value check box for the passcode parameter.
    5. Click Execute.
    6. From the response body, copy the value of the "access_token" parameter.
  5. If you use curl, and want to get information about all cloud integrations in your environment, run:

    curl 'https://<your_instance>/api/v2/cloudintegration' -H 'Authorization: Bearer <access_token>'
    

    Here, <your_instance> is the name of your Tanzu Observability service instance, and <access_token> is the access token for your user account.

Make API Calls by Using a Server to Server App

If you want to use a server to server app to make the REST API calls, obtain the OAuth credentials (ID and secret) associated with the server to server app and exchange them for an access token.

  1. Create a server to server app in VMware Cloud services.
  2. Assign one or more roles to the server to server app to grant it the Tanzu Observability access it needs.
  3. Obtain the OAuth 2.0 client credentials of the server to server app and save them to a secure place.
  4. Add the app to your VMware Cloud organization running the Tanzu Observability service.
  5. Encode the server to server OAuth 2.0 client credentials (ID and secret) to Base64 format.
  6. Exchange the Base64 encoded OAuth 2.0 client credentials for an access token.

    1. Navigate to the Authentication VMware Cloud services APIs.
    2. In the POST/am/api/auth/token request, click Try it out.
    3. For the username parameter, enter the Base64 encoded ID of the server to server app.
    4. For the password parameter, enter the Base64 encoded secret of the server to server app.
    5. For the grant_type parameter, select client_credentials.
    6. Click Execute.
    7. From the response body, copy the value of the "access_token" parameter.
  7. If you use curl, and want to get information about all cloud integrations in your environment, run:

       curl 'https://<your_instance>/api/v2/cloudintegration' -H 'Authorization: Bearer <access_token>'
    

    Here, <your_instance> is the name of your Tanzu Observability service instance, and <access_token> is the access token for the server to server app.

For more information, see How to use OAuth 2.0 for server to server apps in the VMware Cloud services documentation.

Original Subscriptions

Invoking the REST API of an original Tanzu Observability subscription requires a Tanzu Observability API token.

Make API Calls by Using a User Account

If you want to use your own user account to make REST API calls, use an API token associated with your user account:

  1. Log in to your service instance (https://<your_instance>.wavefront.com).
  2. Click the gear icon on the toolbar and click your user name.
  3. On the API Access tab, click the Copy icon next to the API token that you want to use.
  4. If you use curl, and want to get information about all cloud integrations in your environment, run:

    curl 'https://<your_instance>/api/v2/cloudintegration' -H 'Authorization: Bearer <your_api_token>'
    

    Here, <your_instance> is the name of your Tanzu Observability service instance, and <your_api_token> is the API token for your user account.

Make API Calls by Using a Service Account

If you want to use a service account to make REST API calls, use an API token associated with that service account.

  1. Log in to your service instance (https://<your_instance>.wavefront.com).
  2. Click the gear icon on the toolbar and click Accounts.
  3. On the Service Accounts tab, click the service account that you want to use.
  4. Click the Copy icon next to the API token that you want to use.
  5. If you use curl, and want to get information about all cloud integrations in your environment, run:

    curl 'https://<your_instance>/api/v2/cloudintegration' -H 'Authorization: Bearer <service_account_api_token>'
    

    Here, <your_instance> is the name of your Tanzu Observability service instance, and <service_account_api_token> is the API token for the service account.