curl --request POST \
--url https://api.select.dev/v2/metrics/databricks-sql-warehouse-decisions/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"measures": [
"num_scale_ins",
"num_suspensions"
],
"dimensions": [
"day"
],
"filter_expression": {
"operator": "and",
"filters": [
{
"field": "day",
"operator": "in range",
"value": "30D"
},
{
"field": "resource_id",
"operator": "=",
"value": "1a2b3c4d5e6f7a8b"
},
{
"field": "parent_workspace_id",
"operator": "=",
"value": "1234567890123456"
}
]
},
"sort": [
{
"field": "day",
"direction": "asc"
}
],
"limit": 1000
}
'{
"items": [
{}
],
"page_token": "<string>",
"row_count": 123,
"sql": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}Query Databricks SQL warehouse Automated Savings decisions
One row per group of the decisions that SELECT Automated Savings made for Databricks SQL warehouses, such as a scale-in or a suspension, counted over the requested period.
Returns one row per combination of the requested dimensions, carrying the requested measures. Each row is keyed by dimension and measure name. row_count is the number of rows in items: results are not paginated, so an aggregation with more rows than limit is cut short at limit rather than continued under a page_token. sql is always null. Rows cover every SQL warehouse in the organization: X-Team-Id does not narrow them.
Use this route for the decisions that SELECT Automated Savings made for Databricks SQL warehouses: when it scaled a warehouse in, when it suspended a warehouse, and when it put the original settings back. A row counts decisions, not dollars. For the dollars that Automated Savings saved, use dollars_saved on databricks-sql-warehouses. num_scale_ins counts the scale_in_set and marginal_scale_down_set decisions. num_suspensions counts the auto_stop_set decisions. num_decisions counts all decisions, including the decisions that reset or reconcile a setting. resource_id is the SQL warehouse ID and parent_workspace_id is the Databricks workspace ID. The time dimensions (hour, day, week, month, created_at) come from the time of the decision.
curl --request POST \
--url https://api.select.dev/v2/metrics/databricks-sql-warehouse-decisions/query \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"measures": [
"num_scale_ins",
"num_suspensions"
],
"dimensions": [
"day"
],
"filter_expression": {
"operator": "and",
"filters": [
{
"field": "day",
"operator": "in range",
"value": "30D"
},
{
"field": "resource_id",
"operator": "=",
"value": "1a2b3c4d5e6f7a8b"
},
{
"field": "parent_workspace_id",
"operator": "=",
"value": "1234567890123456"
}
]
},
"sort": [
{
"field": "day",
"direction": "asc"
}
],
"limit": 1000
}
'{
"items": [
{}
],
"page_token": "<string>",
"row_count": 123,
"sql": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}Authorizations
Organization API key (sl_…).
Headers
Act as this team: rows are limited to what the team's roles reach instead of the caller's own. The caller must be a member of the team or hold the organization-wide permission the route requires.
The organization ID the request is scoped to.
Body
Aggregate the decisions that SELECT Automated Savings made for Databricks SQL warehouses.
Group with dimensions, aggregate with measures, narrow rows with filters or
filter_expression, and narrow aggregates with measure_filters.
num_decisions, num_scale_ins, num_suspensions hour, day, week, month, created_at, resource_id, dbx_conn_id, parent_workspace_id, connection_id, decision_type, reason_code, connection_type - InFilter[SqlWarehouseDecisionDimensionName]
- IsFilter[SqlWarehouseDecisionDimensionName]
- LikeFilter[SqlWarehouseDecisionDimensionName]
- MultiLikeFilter[SqlWarehouseDecisionDimensionName]
- EqFilter[SqlWarehouseDecisionDimensionName]
- FilterExpression[SqlWarehouseDecisionDimensionName]
- InRelativeDateRangeFilter[SqlWarehouseDecisionDimensionName]
Show child attributes
Show child attributes
Show child attributes
Show child attributes
- InFilter[SqlWarehouseDecisionMeasureName]
- IsFilter[SqlWarehouseDecisionMeasureName]
- LikeFilter[SqlWarehouseDecisionMeasureName]
- MultiLikeFilter[SqlWarehouseDecisionMeasureName]
- EqFilter[SqlWarehouseDecisionMeasureName]
- FilterExpression[SqlWarehouseDecisionMeasureName]
- InRelativeDateRangeFilter[SqlWarehouseDecisionMeasureName]
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Maximum rows to return, at most 10000. An aggregation that produces more rows than this is silently cut short at the limit, so narrow the filters or group by fewer dimensions rather than raising it to see everything.
1 <= x <= 10000Response
Successful Response
Opaque cursor for the next page; empty/absent on the last page.
Best-effort total for the filtered result set; may be null when expensive.
The SQL that produced these rows, returned only when the request asks for it. Database and schema names are left as placeholders. Null when the request did not ask for it, or when this endpoint does not publish its SQL.

