Today, Vantage is launching the ability for customers to programmatically create Kubernetes Efficiency Reports via the Vantage API. Users can now programmatically create reports to view cost efficiency down to the pod level of a cluster.
While users could previously create Kubernetes Efficiency Reports in the console, it was a tedious process, especially for users managing many clusters who wanted to create multiple reports at once. Now, with this new API endpoint, users can create and manage reports, reducing manual effort, and enabling faster, more comprehensive insights into Kubernetes cost efficiency.
Now, customers can use the new /kubernetes_efficiency_reports
API. Navigate to the API Access Tokens page and generate an API Key. Using this API Key, you can now programmatically manage Kubernetes Efficiency Reports, allowing you to create, update, and maintain these reports automatically, without needing to interact with the Vantage console.
These new endpoints are now available to all users, including users in the free tier. To get started with the API, see the API documentation. For more information about available fields, see the product documentation.
Frequently Asked Questions
1. What is being launched today?
Vantage is launching the ability to create, update, and delete Kubernetes Efficiency Reports via the API. Users can programmatically create multiple reports using Vantage Query Language—or VQL— to define report filter criteria.
2. Who is the customer?
The customer is anyone who would like to automate the setup and maintenance of Kubernetes Efficiency Reports in Vantage.
3. How much does this cost?
There is no additional cost for using the API. It is included in the cost of the Vantage subscription, including users in the free tier.
4. What is VQL?
VQL is a SQL-like syntax, used within the Vantage API, for filtering cloud cost data. It includes a normalized schema across cloud providers and basic filter syntax for creating complex filters. You can use VQL to construct the value for the filter
parameter on a report’s Write API endpoint.
5. How do I create a Kubernetes Efficiency Report via the API?
Send the following API request to create a Kubernetes Efficiency Report using the /kubernetes_efficiency_reports
endpoint:
curl --request POST \
--url https://api.vantage.sh/v2/kubernetes_efficiency_reports \
--header 'accept: application/json' \
--header 'authorization: Bearer TOKEN' \
--header 'content-type: application/json' \
--data @- <<EOF
{
"date_bin": "cumulative",
"workspace_token": "wrkspc_123",
"title": "Idle Cost by Cluster",
"filter": "(kubernetes.namespace = '__idle__')",
"date_interval": "this_month",
"aggregated_by": "idle_cost",
"groupings": [
"cluster_id"
]
}
EOF
The following is returned on a successful 200
response:
{
"token": "kbnts_eff_rprt_a123b45cd678e90f",
"title": "Idle Cost by Cluster 2",
"default": false,
"created_at": "2024-11-13T19:07:12Z",
"workspace_token": "wrkspc_123",
"user_token": null,
"start_date": "2024-11-01",
"end_date": "2024-11-30",
"date_interval": "this_month",
"date_bucket": "day",
"aggregated_by": "idle_cost",
"groupings": "cluster_id",
"filter": "(kubernetes.namespace = '__idle__')"
}
6. What methods that are available with this endpoint?
POST
/kubernetes_efficiency_reports
: Creates a new Kubernetes Efficiency ReportPUT
/kubernetes_efficiency_reports/{kubernetes_efficiency_report_token}
: Updates an existing Kubernetes Efficiency ReportGET
/kubernetes_efficiency_reports
: Retrieves all existing Kubernetes Efficiency ReportsGET
/kubernetes_efficiency_reports/{kubernetes_efficiency_report_token}
: Retrieves a specific Kubernetes Efficiency Report by itskubernetes_efficiency_report_token
DELETE
/kubernetes_efficiency_reports/{kubernetes_efficiency_report_token}
: Deletes a specific Kubernetes Efficiency Report by itskubernetes_efficiency_report_token
7. Who has permission to use the API?
All users can generate Read API keys. You need to have the Editor role or above to modify resources with Write API keys.
8. How do I authenticate with the API?
The Vantage API uses API tokens for authentication. You can create both user and service tokens in the console. An API key can be assigned Read and Write scopes. See the API documentation for details on how to get started with API keys.
9. After I update a report via the API, how long does it take for the report to update in the console?
After you update a report via the API, the updates are immediately available within the console. If a report needs costs regenerated, that process will begin immediately. Any modified filters are also immediately available in the console.
10. Is Terraform support available for this endpoint?
Terraform support will be available soon.
11. Can I view the VQL for an existing report in the UI?
Yes, in the Filters menu on a Kubernetes Efficiency Report, click the View as VQL button to view the VQL representation of the filter criteria.
12. What other report types does Vantage plan to support creating via the API?
We plan to add support for creating the following report types via the API in a future release:
- Network Flow Reports
- Financial Commitment Reports (currently support deleting and fetching)
13. What are some resources I can use to get started with the API?
Vantage provides multiple resources for getting started with the API:
- The Vantage API documentation site contains information about available API endpoints and provides a tool for running API calls directly on the site.
- The product documentation contains details on how to use VQL.
- The “FinOps as Code” repository contains tutorials and code samples for getting started with the Vantage API and Terraform provider.