Skip to main content

Data API

note

Data API is in Open Preview and is not General Availability (GA) at this time. More information about release phases may be found here.

Data API Documentation

The Data API documentation can be found at https://data.api.vegacloud.io/docs.

Purpose

The Vega Platform Data API exists to provide clients with a programmatic way to access report data which is stored in the Vega Platform. This data can be used to build custom reports, dashboards, or to audit findings surfaced in our Platform.

We present the following data to our clients:

  • Anomalies Detected
  • Resource Costs
  • Reservation Utilization
  • Tagging Data

Connecting to the Data API

To ensure secure access to the API, we utilize JWT (JSON Web Token) authentication. The token is validated to verify the user's identity and permissions and must be included in the Authorization header of the HTTP request to access protected endpoints.

tip

Generate an API Client Registration to securely access the Data API.

Authentication

The API supports two authentication methods:

  1. JWT Authentication (VegaJWTAuth)
  2. API Key Authentication (VegaKeyAuth)

All requests must include the appropriate authentication headers.

Common Request Parameters

Most GET endpoints support the following common parameters:

ParameterTypeDescriptionExample
pageIntegerThe page number to retrieve (starts at 1)page=1
sizeIntegerNumber of items per pagesize=10
sort_byStringComma-delimited sort parameterssort_by=name:asc,age:desc
filter_byStringComma-delimited filter parametersfilter_by=status:=:active,age:>:21

Data Models

The API provides access to the following main data models:

  1. Anomalies – Cost usage anomaly data
  2. Costs – Cloud resource cost data
  3. Discovered Resources – Detected cloud resources across providers
  4. Recommendations – Cost optimization recommendations
  5. Reserved Instances – Reserved instance details
  6. Tags – Resource tagging information

You can retrieve schema information about these models using the /query/schema endpoint.

API Endpoints

Cost Data

EndpointMethodDescription
/costsGETGet cost data across all resources
/costs/spend-daily-by-accountGETGet daily spend by cloud account
/costs/spend-daily-by-productGETGet daily spend by cloud product
/costs/total-spend-monthly-by-accountGETGet monthly spend by cloud account
/costs/total-spend-monthly-by-productGETGet monthly spend by cloud product

Anomalies

EndpointMethodDescription
/anomaliesGETGet cost usage anomaly data

Resources

EndpointMethodDescription
/discovered-resourcesGETGet detected cloud resources
/tagsGETGet resource tagging information

Recommendations

EndpointMethodDescription
/recommendationsGETGet all cost optimization recommendations
/recommendation-aging-snapshotsGETGet recommendations for aging snapshots
/recommendation-disk-optimizationGETGet recommendations for disk optimization
/recommendation-family-refreshGETGet recommendations for instance family refreshes
/recommendation-idle-databasesGETGet recommendations for idle databases
/reserved-instancesGETGet reserved instance information

Query

EndpointMethodDescription
/queryPOSTExecute SQL queries against data models
/query/schemaGETGet information about available data models and fields

Filtering Data

You can filter data using the filter_by parameter with the following format:

field:operator:value

Multiple filters can be combined with commas and will be joined with AND logic. For example:

filter_by=cloud_provider:=:AWS,product:LIKE:%EC2%,usage_day:between:20230101-20230131

Filter Limitations

Important: For all endpoints except the /query endpoint, multiple filter conditions in the filter_by parameter are always combined using logical AND operations. This means all conditions must be true for a record to be included in the results.

Complex filtering with OR conditions, nested logic, or parenthetical groupings is not supported through the filter_by parameter. For example, you cannot construct a filter like "show resources that are either in AWS OR have costs greater than $100."

For more complex query requirements, use the /query endpoint with a SQL query that can express more sophisticated logic.

Valid Operators

The API supports the following filter operators:

OperatorDescriptionExample
=Equal tostatus:=:active
<>Not equal tostatus:<>:inactive
>Greater thancost:>:100
<Less thancost:<:50
>=Greater than or equal tocost:>=:100
<=Less than or equal tocost:<=:50
BETWEEN or betweenBetween two values (inclusive)date:between:20230101-20230131
LIKE or likePattern matching (case-sensitive)name:LIKE:%Server%
ILIKE or ilikePattern matching (case-insensitive)name:ILIKE:%server%
SIMILAR TO or similar toSQL standard regex pattern matchingname:SIMILAR TO:(server|instance)%
IN or inValue in a liststatus:IN:(active,pending)
NOT IN or not inValue not in a liststatus:NOT IN:(deleted,archived)
IS or isEquals (usually for NULL values)owner:IS:NULL
IS NOT or is notNot equals (usually for NULL values)owner:IS NOT:NULL
AND or andLogical ANDstatus:=:active AND cost:>:100
OR or orLogical ORstatus:=:active OR status:=:pending
NOT or notLogical NOTNOT status:=:deleted

Date Range Filters

For date ranges, use the between operator with dates in YYYYMMDD format separated by a hyphen:

usage_day:between:20230101-20230131

Sorting Data

You can sort data using the sort_by parameter with the following format:

field:order

Multiple sort parameters can be combined with commas. For example:

sort_by=cloud_provider:asc,cost:desc

Where:

  • field is the field name to sort by
  • order is either asc (ascending) or desc (descending)

Filter Field Reference

Types

The following table describes all data types used across the API endpoints with examples of valid values:

TypeDescriptionExample Values
UUIDUniversally Unique Identifier"123e4567-e89b-12d3-a456-426614174000"
StringText value"aws", "us-east-1", "t2.micro", "prod-server-01"
Float6464-bit floating-point number123.45, 0.0, -789.12, 1.23e6
Int3232-bit integer42, 0, -17, 1000
Int6464-bit integer1234567890, 0, -42, 9876543210
DateTimeDate and time value"2024-01-15T14:30:00Z", "2023-12-31T23:59:59Z"
BooleanTrue/false valuetrue, false

Common Fields

These fields appear across multiple endpoints with consistent types:

Field NameTypeDescription
applicationStringApplication name or identifier
billing_account_idStringBilling account identifier
business_groupStringBusiness group name
business_unitStringBusiness unit name
business_unit_idUUIDUnique identifier for business unit
client_nameStringClient name
cloud_providerStringCloud service provider name
cloud_provider_identifierStringCloud provider's unique identifier
data_dateDateTimeDate of the data record
environmentStringEnvironment identifier
exclude_accountStringAccount exclusion flag
executive_groupStringExecutive group identifier
financial_owner_emailStringEmail of financial owner
financial_owner_nameStringName of financial owner
linked_account_idStringLinked account identifier
linked_account_nameStringLinked account name
organization_idUUIDOrganization identifier
product_groupStringProduct group identifier
resource_idStringResource identifier
resource_nameStringResource name
teamStringTeam identifier
technical_owner_emailStringEmail of technical owner
technical_owner_nameStringName of technical owner

Endpoint-Specific Fields

Anomalies (/anomalies)

Field NameType
anomaly_hashString
base_anomaly_flagString
base_thresholdFloat64
base_threshold_costInt32
cloud_regionString
cloud_specific_locationString
cloud_zoneString
current_net_fiscal_amountFloat64
current_ondemand_costFloat64
current_usage_amountFloat64
flattening_net_fiscal_averageFloat64
flattening_ondemand_averageFloat64
flattening_usage_averageFloat64
net_fiscal_differenceFloat64
net_fiscal_difference_pctFloat64
ondemand_differenceFloat64
ondemand_difference_pctFloat64
rolling_net_fiscal_averageFloat64
rolling_ondemand_averageFloat64
rolling_usage_averageFloat64
seven_day_net_fiscalFloat64
seven_day_usageFloat64
usage_differenceFloat64
usage_difference_pctFloat64
weekly_net_fiscalFloat64
weekly_ondemandFloat64
weekly_usageFloat64

Costs (/costs)

Field NameType
billing_unitString
channelString
closing_monthDateTime
container_flagString
cost_categoryString
coverable_application_typeString
deployment_ageString
deployment_sourceString
disk_typeString
disk_usage_gbFloat64
environment_sourceString
gross_fiscalFloat64
instance_typeString
is_actualString
is_committed_use_eligibleString
lease_ownership_typeString
lease_purchase_monthDateTime
line_item_typeString
migrationString
migration_originString
net_cashFloat64
net_fiscal_amountFloat64
ondemand_costFloat64
operating_systemString
platformString
product_categoryString
product_cost_detail_categoryString
propeller_organizationString
reporting_monthString
ri_sp_arnString
savingsFloat64
snapshot_originString
steady_stateString
usage_amountFloat64
usage_dayDateTime
usage_typeString

Spend Daily by Account (/costs/spend-daily-by-account)

Field NameType
net_fiscalFloat64
ondemand_costFloat64
usage_amountFloat64
usage_dayDateTime

Spend Daily by Product Account (/costs/spend-daily-by-product)

Field NameType
net_fiscalFloat64
ondemand_costFloat64
product_categoryString
product_detail_categoryString
product_nameString
usage_amountFloat64
usage_dayDateTime

Spend Monthly by Account (/costs/total-spend-monthly-by-account)

Field NameType
monthFloat64
total_monthly_net_fiscalFloat64
total_monthly_ondemand_spendFloat64
yearFloat64

Spend Monthly by Product (/costs/total-spend-monthly-by-product)

Field NameType
monthFloat64
product_nameString
total_monthly_net_fiscalFloat64
total_monthly_ondemand_spendFloat64
yearFloat64

Discovered Resources (/discovered-resources)

Field NameType
business_unit_display_nameString
business_unit_nameString
cloud_account_idString
configurationString
cost_rolling_thirtyFloat64
is_parking_capableBoolean
is_runningBoolean
is_snapshot_capableBoolean
nameString
ostypeString
provider_account_idString
provider_strString
regionString
resource_typeString
stateString
tagsString

Recommendation Aging Snapshots (/recommendation-aging-snapshots)

Field NameType
age_daysInt64
ami_imageidString
availabilityzoneString
channelString
client_typeInt32
est_monthly_net_cashFloat64
est_monthly_ondemand_spendFloat64
has_amiString
instance_idString
instance_nameString
locationString
snapshot_age_categoryString
snapshot_creation_dateDateTime
snapshot_sizeFloat64
volume_nameString
volumeidString
volumetypeString

Recommendation Disk Optimization (/recommendation-disk-optimization)

Field NameType
capacity_sizeFloat64
cost_centerString
current_disk_typeString
current_monthly_total_costFloat64
current_monthly_total_ondemandFloat64
iopsFloat64
monthly_optimal_ondemand_savingsFloat64
monthly_optimal_total_savingsFloat64
optimal_disk_upgradeString
optimal_monthly_total_costFloat64
optimal_ondemand_total_costFloat64
optimal_upgradeString
resource_groupString
resource_typeString
throughputInt32

Recommendation Family Refresh (/recommendation-family-refresh)

Field NameType
amd_instance_familyString
amd_instance_typeString
amd_memoryFloat64
amd_ondemand_costFloat64
amd_vcpuFloat64
arm_instance_familyString
arm_instance_typeString
arm_memoryFloat64
arm_ondemand_costFloat64
arm_vcpuFloat64
autoscaling_group_nameString
burstable_instance_familyString
burstable_instance_typeString
burstable_memoryFloat64
burstable_ondemand_costFloat64
burstable_vcpuFloat64
cleaned_environmentString
container_flagString
cross_family_refresh_right_size_instance_familyString
cross_family_refresh_right_size_instance_typeString
cross_family_refresh_right_size_memoryFloat64
cross_family_refresh_right_size_ondemand_costFloat64
cross_family_refresh_right_size_vcpuFloat64
database_engine_versionString
family_refresh_instance_familyString
family_refresh_instance_typeString
family_refresh_memoryFloat64
family_refresh_ondemand_costFloat64
family_refresh_right_size_instance_familyString
family_refresh_right_size_instance_typeString
family_refresh_right_size_memoryFloat64
family_refresh_right_size_ondemand_costFloat64
family_refresh_right_size_vcpuFloat64
family_refresh_vcpuFloat64
has_autoscaling_groupString
intel_instance_familyString
intel_instance_typeString
intel_memoryFloat64
intel_ondemand_costFloat64
intel_vcpuFloat64
last_day_usedDateTime
max_cpuFloat64
max_memoryFloat64
monthly_net_fiscalFloat64
monthly_usage_amountFloat64
optimal_monthly_savingsFloat64
optimal_refresh_instance_familyString
optimal_refresh_instance_typeString
optimal_refresh_memoryFloat64
optimal_refresh_typeString
optimal_refresh_vcpuFloat64
optimal_savings_pctFloat64
original_instance_familyString
original_instance_family_processorString
original_instance_typeString
original_memoryFloat64
original_ondemand_costFloat64
original_vcpuFloat64
product_nameString
projected_amd_monthly_savingsFloat64
projected_arm_monthly_savingsFloat64
projected_burstable_monthly_savingsFloat64
projected_cross_family_refresh_right_size_monthly_savingsFloat64
projected_family_refresh_and_right_size_monthly_savingsFloat64
projected_family_refresh_monthly_savingsFloat64
projected_intel_monthly_savingsFloat64
projected_right_size_monthly_savingsFloat64
right_size_instance_familyString
right_size_instance_typeString
right_size_memoryFloat64
right_size_ondemand_costFloat64
right_size_vcpuFloat64
tenancyString

Recommendation Idle Databases (/recommendation-idle-databases)

Field NameType
autoscaling_group_nameString
bill_payer_account_idString
cleaned_environmentString
container_flagString
current_month_running_hoursFloat64
database_editionString
date_first_reported_idleDateTime
date_last_checkedDateTime
deployment_optionString
discovered_dateDateTime
has_autoscaling_groupString
last_billed_dateDateTime
license_modelString
location_fromString
migrationString
migration_originString
net_fiscalFloat64
ondemand_costFloat64
operating_systemString
propeller_organizationString
resource_typeString
technical_team_nameString
total_days_idleFloat64

Recommendations (/recommendations)

Field NameType
additional_metricString
additional_metric_descriptionString
billing_unitString
cost_categoryString
cpu_maximumFloat64
has_autoscaling_groupString
instance_typeString
last_usage_dayDateTime
locationString
mem_maximumFloat64
memoryFloat64
net_fiscal_costFloat64
net_savingsFloat64
ondemand_costFloat64
productString
product_categoryString
product_detail_categoryString
projected_costFloat64
rec1_instance_typeString
rec1_net_savingsFloat64
rec1_ondemand_savingsFloat64
rec1_typeString
rec2_instance_typeString
rec2_net_savingsFloat64
rec2_ondemand_savingsFloat64
rec2_typeString
rec3_instance_typeString
rec3_net_savingsFloat64
rec3_ondemand_savingsFloat64
rec3_typeString
rec4_instance_typeString
rec4_net_savingsFloat64
rec4_ondemand_savingsFloat64
rec4_typeString
rec5_instance_typeString
rec5_net_savingsFloat64
rec5_ondemand_savingsFloat64
rec5_typeString
rec6_instance_typeString
rec6_net_savingsFloat64
rec6_ondemand_savingsFloat64
rec6_typeString
rec7_instance_typeString
rec7_net_savingsFloat64
rec7_ondemand_savingsFloat64
rec7_typeString
rec_typeString
usage_amountFloat64
vcpuFloat64

Reserved Instances (/reserved-instances)

Field NameType
benefit_idString
benefit_nameString
benefit_typeString
bill_payer_account_idString
estimated_expiration_dateDateTime
minimum_capacity_dateDateTime
monthly_reservation_costFloat64
termInt64
total_reservation_costFloat64

Tags (/tags)

Field NameType
container_flagString
steady_stateString
tag_keyString
tag_valueString

Query Endpoint

The /query endpoint allows you to execute SQL-style queries against the data models. This provides more flexibility than the standard REST endpoints.

Request Format

{
"query": "SELECT cloud_provider, SUM(gross_fiscal) FROM cost GROUP BY cloud_provider",
"limit": 100
}

Important Notes

  • SQL joins are not supported.
  • Remove all extra spaces and semicolons (;) from your query.
  • Queries are limited to 100 records by default (this can be changed with the limit parameter).
  • The query must be a valid SELECT statement.

Example Queries

SELECT cloud_provider, SUM(gross_fiscal) FROM cost GROUP BY cloud_provider
SELECT product, COUNT(*) FROM recommendation WHERE savings > 1000 GROUP BY product

Error Handling

API errors follow a standard JSON format:

{
"status": 400,
"title": "Bad Request",
"detail": "Invalid filter parameter",
"errors": [
{
"location": "query.filter_by",
"message": "Invalid operator: '=='",
"value": "status:==:active"
}
]
}

Error responses include:

  • HTTP status code
  • Error title
  • Detailed error message
  • A list of specific errors (when applicable)

Example Requests

Get Cost Data with Filtering and Sorting

GET /costs?page=1&size=10&sort_by=net_fiscal_amount:desc&filter_by=cloud_provider:=:AWS,usage_day:between:20230101-20230131

Query Total Spend by Cloud Provider

POST /query
{
"query": "SELECT cloud_provider, SUM(net_fiscal_amount) as total_spend FROM cost WHERE usage_day BETWEEN '2023-01-01' AND '2023-01-31' GROUP BY cloud_provider ORDER BY total_spend DESC",
"limit": 10
}

Get Recommendations with Potential Savings

GET /recommendations?filter_by=savings:>:1000,cloud_provider:=:AWS&sort_by=savings:desc

Interpreting HTTP Error Codes

Status CodeDescriptionReasons
400Bad Request- Invalid sort parameter format (e.g., not "field:order") - Invalid sort order (not "asc" or "desc") - Invalid filter parameter format - Invalid filter operator - Invalid filter field - Invalid date range format - Empty query in data query handler - Invalid query structure
401Unauthorized- Missing JWT token - Invalid API key - Expired credentials
403Forbidden- User not authorized to access requested business unit data - User lacks permission for the requested operation - Valid authentication but insufficient authorization
404Not Found- Requested endpoint doesn't exist - Requested resource not found
422Unprocessable Entity- Malformed request body - Required parameters missing - Parameter validation failures
500Internal Server Error- Panic recovery (explicitly set in tracelogging middleware) - Database connection failures - Query execution errors - Cache errors - Unexpected system errors
503Service Unavailable- Database service unavailable - Dependent services unreachable

This documentation provides a comprehensive guide to using the Vega Data API. For specific field information and data model schema details, use the /query/schema endpoint to retrieve up-to-date information about the available fields and models.