Operations for Applications REST API | Latest |
Operations for Applications REST API Overview
Welcome to the REST API documentation of VMware Aria Operations for Applications (formerly known as Tanzu Observability by Wavefront) 2023-11.x.
VMware Aria Operations for Applications is a high-performance streaming analytics platform that helps you monitor and optimize your environment. The Operations for Applications REST API enables you to write scripts to perform Operations for Applications management tasks, such as defining alerts and creating events. You can use the REST API to perform any task that is supported by the Operations for Applications UI. The REST API is based on Swagger, so you can generate the API client of your choice (including a CLI client).
All interactions between the Operations for Applications UI and your Operations for Applications instance occur through the Operations for Applications management API. You can perform those actions using REST - or you can create an API client using Swagger, discussed below.
The current version of the REST API is v2. You can access the API at <wavefront_instance>/api/v2. The v1 API (<wavefront_instance>/api/>) was deprecated in 2017 and is no longer supported.
Note: The Operations for Applications REST API is not the same as the /api endpoint that you specify for the Wavefront proxy.
API Swagger Documentation
You can access the Operations for Applications REST API documentation from this VMware {code} page or directly from within your service instance.
To access the REST API documentation from within your Operations for Applications instance:
- Log in to your service instance (
https://<your_instance>.wavefront.com
). - Display the doc from the UI or using a URL:
- From the Operations for Applications UI, click the gear icon at the top right of the toolbar and select API Documentation.
- Type
https://<your_cluster_name>.com/api-docs/ui/
.
Code Samples
Some code samples for getting data into Operations for Applications are available on the VMware code website. We’re providing these samples as is - some are from our team, others will come from the community.
Invoke the API
If you're logged in to your service instance, you can invoke the API directly from the API Reference. See our blog Did You Know That Our API Docs Are Alive.
You can also invoke the API using curl or from an API client. In either case, you must pass in an API token. An Operations for Applications API token is a string of hexadecimal characters and dashes.
To generate an API token for your user account:
- Log in to your service instance (
https://<your_instance>.wavefront.com
) as a user with the API Tokens permission. - Click the gear icon at the top right of the toolbar and select your user name.
- On the API Access page, click Generate. You can have up to 20 tokens at any given time. If you want to generate a new token but already have 20 tokens, then you must revoke one of the existing tokens.
- To revoke a token, click the Revoke button next for the token. Revoking a token cannot be undone. If you run a script that uses a revoked token, the script returns an authorization error.
To generate an API token for a service account:
- Log in to your service instance (
https://<your_instance>.wavefront.com
) as a user with the Accounts permission. - Click the gear icon at the top right of the toolbar and select Accounts.
- On the Service Accounts tab, click the ellipsis icon next to the service account for which you want to generate an API token, and select Edit.
- Click Generate. You can have up to 20 tokens per service account at any given time. If you want to generate a new token but already have 20 tokens, then you must revoke one of the existing tokens.
- To revoke a token, click the Revoke button next for the token. Revoking a token cannot be undone. If you run a script that uses a revoked token, the script returns an authorization error.
Example: Invoke the API Using curl
With curl, you specify the API token in the Authorization: Bearer header. For example, to return all alerts, run the following command:
curl 'https://<your_instance>/api/v2/alert' --header 'Authorization: Bearer <api_token>'
Generate an API Client Using Swagger
Because we expose the Wavefront REST API via Swagger, you can generate a working implementation of the API for the programming language or CLI you want to use.
Note: Using the default Swagger configuration settings might result in errors. Create your own configuration file instead, as in the following example for generating a Java client:
First, create a file swagger-config.json
. Here’s an example:
{
"modelPackage": "com.wavefront.rest.models",
"apiPackage": "com.wavefront.rest.api.client",
"groupId": "com.wavefront.rest.api.client",
"artifactId": "wavefront-java-sdk",
"artifactVersion": "19.10",
"sourceFolder": "src/main/java",
"java8": true,
"dateLibrary": "java8"
}
Next, generate the client, for example:
swagger-codegen generate -i https://demo.wavefront.com/api/v2/swagger.json -c swagger-config.json -l java</code>
Related Documentation
Name | Size |
---|---|
Swagger/Open API specification download | |