curl --request POST \
--url https://api.select.dev/v2/databricks-sql-warehouses/actions/batch-update-automated-savings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"items": [
{
"warehouse_id": "<string>",
"databricks_workspace_id": "<string>"
}
],
"enabled": true
}
'import requests
url = "https://api.select.dev/v2/databricks-sql-warehouses/actions/batch-update-automated-savings"
payload = {
"items": [
{
"warehouse_id": "<string>",
"databricks_workspace_id": "<string>"
}
],
"enabled": True
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [{warehouse_id: '<string>', databricks_workspace_id: '<string>'}],
enabled: true
})
};
fetch('https://api.select.dev/v2/databricks-sql-warehouses/actions/batch-update-automated-savings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.select.dev/v2/databricks-sql-warehouses/actions/batch-update-automated-savings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'warehouse_id' => '<string>',
'databricks_workspace_id' => '<string>'
]
],
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.select.dev/v2/databricks-sql-warehouses/actions/batch-update-automated-savings"
payload := strings.NewReader("{\n \"items\": [\n {\n \"warehouse_id\": \"<string>\",\n \"databricks_workspace_id\": \"<string>\"\n }\n ],\n \"enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.select.dev/v2/databricks-sql-warehouses/actions/batch-update-automated-savings")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"warehouse_id\": \"<string>\",\n \"databricks_workspace_id\": \"<string>\"\n }\n ],\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/databricks-sql-warehouses/actions/batch-update-automated-savings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"warehouse_id\": \"<string>\",\n \"databricks_workspace_id\": \"<string>\"\n }\n ],\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"warehouse_id": "<string>",
"warehouse_name": "<string>",
"databricks_connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"databricks_workspace_id": "<string>",
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enabled": true,
"enabled_time": "<string>",
"disabled_time": "<string>",
"update_time": "<string>",
"permission_level": "is_owner",
"warehouse_type": "classic",
"discovery_error": "<string>",
"last_heartbeat_time": "<string>",
"scale_in_start_time": "<string>",
"marginal_scale_down_start_time": "<string>",
"initial_max_num_clusters": 123,
"target_scale_in_max_num_clusters": 123,
"target_marginal_scale_down_max_num_clusters": 123,
"auto_stop_set_time": "<string>",
"initial_auto_stop_duration": "<string>",
"target_auto_stop_duration": "<string>",
"cleanup_pending": false
}
],
"row_count": 123,
"failures": [
{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"index": 123,
"type": "about:blank",
"details": [
{}
]
}
],
"page_token": "<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": [
{}
]
}Turn automated savings on or off for Databricks SQL warehouses
Turn automated savings on or off for a batch of Databricks SQL warehouses.
Each entry is checked on its own. The accepted entries are applied, and
items returns them in request order. Each rejected entry is in
failures, with its position in the request as index. The status is
200 also when every entry is rejected. An entry is rejected with:
404 not_found: SELECT has no connection to the workspace, or no record of the warehouse in it.403 forbidden: turning automated savings on needs apermission_levelofcan_manageoris_owneron the warehouse, and no Databricks connection of SELECT has it.422 validation_failed: the entry names the same warehouse as an earlier entry.
curl --request POST \
--url https://api.select.dev/v2/databricks-sql-warehouses/actions/batch-update-automated-savings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"items": [
{
"warehouse_id": "<string>",
"databricks_workspace_id": "<string>"
}
],
"enabled": true
}
'import requests
url = "https://api.select.dev/v2/databricks-sql-warehouses/actions/batch-update-automated-savings"
payload = {
"items": [
{
"warehouse_id": "<string>",
"databricks_workspace_id": "<string>"
}
],
"enabled": True
}
headers = {
"x-tenant-id": "<x-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-tenant-id': '<x-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
items: [{warehouse_id: '<string>', databricks_workspace_id: '<string>'}],
enabled: true
})
};
fetch('https://api.select.dev/v2/databricks-sql-warehouses/actions/batch-update-automated-savings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.select.dev/v2/databricks-sql-warehouses/actions/batch-update-automated-savings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'warehouse_id' => '<string>',
'databricks_workspace_id' => '<string>'
]
],
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-tenant-id: <x-tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.select.dev/v2/databricks-sql-warehouses/actions/batch-update-automated-savings"
payload := strings.NewReader("{\n \"items\": [\n {\n \"warehouse_id\": \"<string>\",\n \"databricks_workspace_id\": \"<string>\"\n }\n ],\n \"enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-tenant-id", "<x-tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.select.dev/v2/databricks-sql-warehouses/actions/batch-update-automated-savings")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"warehouse_id\": \"<string>\",\n \"databricks_workspace_id\": \"<string>\"\n }\n ],\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/databricks-sql-warehouses/actions/batch-update-automated-savings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-tenant-id"] = '<x-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"warehouse_id\": \"<string>\",\n \"databricks_workspace_id\": \"<string>\"\n }\n ],\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"warehouse_id": "<string>",
"warehouse_name": "<string>",
"databricks_connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"databricks_workspace_id": "<string>",
"connection_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"enabled": true,
"enabled_time": "<string>",
"disabled_time": "<string>",
"update_time": "<string>",
"permission_level": "is_owner",
"warehouse_type": "classic",
"discovery_error": "<string>",
"last_heartbeat_time": "<string>",
"scale_in_start_time": "<string>",
"marginal_scale_down_start_time": "<string>",
"initial_max_num_clusters": 123,
"target_scale_in_max_num_clusters": 123,
"target_marginal_scale_down_max_num_clusters": 123,
"auto_stop_set_time": "<string>",
"initial_auto_stop_duration": "<string>",
"target_auto_stop_duration": "<string>",
"cleanup_pending": false
}
],
"row_count": 123,
"failures": [
{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "<string>",
"retryable": true,
"index": 123,
"type": "about:blank",
"details": [
{}
]
}
],
"page_token": "<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
The organization ID the request is scoped to.
Body
Turn automated savings on or off for a batch of SQL warehouses.
Each entry is checked on its own. The accepted entries are saved, and each
rejected entry is reported with its position in items.
Response
Successful Response
Show child attributes
Show child attributes
The number of applied entries.
The entries that were not applied, in request order. Empty when every entry was applied.
Show child attributes
Show child attributes
Opaque cursor for the next page; empty/absent on the last page.

