Change the generation of a Snowflake warehouse
curl --request POST \
--url https://api.select.dev/v2/snowflake-warehouses/{warehouse_uuid}/actions/set-generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"snowflake_account_uuid": "<string>"
}
'import requests
url = "https://api.select.dev/v2/snowflake-warehouses/{warehouse_uuid}/actions/set-generation"
payload = { "snowflake_account_uuid": "<string>" }
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({snowflake_account_uuid: '<string>'})
};
fetch('https://api.select.dev/v2/snowflake-warehouses/{warehouse_uuid}/actions/set-generation', 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/snowflake-warehouses/{warehouse_uuid}/actions/set-generation",
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([
'snowflake_account_uuid' => '<string>'
]),
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/snowflake-warehouses/{warehouse_uuid}/actions/set-generation"
payload := strings.NewReader("{\n \"snowflake_account_uuid\": \"<string>\"\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/snowflake-warehouses/{warehouse_uuid}/actions/set-generation")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"snowflake_account_uuid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/snowflake-warehouses/{warehouse_uuid}/actions/set-generation")
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 \"snowflake_account_uuid\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"snowflake_account_uuid": "<string>",
"name": "<string>",
"smart_suspend": true,
"type": "<string>",
"snowflake_organization_name": "<string>",
"snowflake_account_name": "<string>",
"resumed_time": "<string>",
"is_interactive": false,
"tgs_cluster_reduction_in_progress": true,
"tgs_initial_max_cluster_count": 123,
"tgs_feature_overrides": {
"workload_aware_scale_in": true,
"scale_ins_disabled": true,
"suspends_disabled": true,
"needs_queue_free_scale_in_guard": true
},
"size": "<string>",
"min_cluster_count": 123,
"max_cluster_count": 123,
"scaling_policy": "<string>",
"auto_suspend": 123,
"generation": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}automated-savings
Change the generation of a Snowflake warehouse
Change a standard warehouse to Gen1 or Gen2 in Snowflake.
The change has an effect on billing immediately. Gen2 credits cost more per hour than Gen1 credits. Queries that are running when the generation changes finish on the previous generation, and Snowflake bills both generations until they finish. A warehouse that already has the generation is returned unchanged.
SELECT needs the MANAGE WAREHOUSES privilege on the Snowflake account. If
the account does not have it, the response has the code missing_grant,
and its grant_sql member contains the statement to run in Snowflake.
POST
/
snowflake-warehouses
/
{warehouse_uuid}
/
actions
/
set-generation
Change the generation of a Snowflake warehouse
curl --request POST \
--url https://api.select.dev/v2/snowflake-warehouses/{warehouse_uuid}/actions/set-generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-tenant-id: <x-tenant-id>' \
--data '
{
"snowflake_account_uuid": "<string>"
}
'import requests
url = "https://api.select.dev/v2/snowflake-warehouses/{warehouse_uuid}/actions/set-generation"
payload = { "snowflake_account_uuid": "<string>" }
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({snowflake_account_uuid: '<string>'})
};
fetch('https://api.select.dev/v2/snowflake-warehouses/{warehouse_uuid}/actions/set-generation', 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/snowflake-warehouses/{warehouse_uuid}/actions/set-generation",
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([
'snowflake_account_uuid' => '<string>'
]),
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/snowflake-warehouses/{warehouse_uuid}/actions/set-generation"
payload := strings.NewReader("{\n \"snowflake_account_uuid\": \"<string>\"\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/snowflake-warehouses/{warehouse_uuid}/actions/set-generation")
.header("x-tenant-id", "<x-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"snowflake_account_uuid\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.select.dev/v2/snowflake-warehouses/{warehouse_uuid}/actions/set-generation")
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 \"snowflake_account_uuid\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"snowflake_account_uuid": "<string>",
"name": "<string>",
"smart_suspend": true,
"type": "<string>",
"snowflake_organization_name": "<string>",
"snowflake_account_name": "<string>",
"resumed_time": "<string>",
"is_interactive": false,
"tgs_cluster_reduction_in_progress": true,
"tgs_initial_max_cluster_count": 123,
"tgs_feature_overrides": {
"workload_aware_scale_in": true,
"scale_ins_disabled": true,
"suspends_disabled": true,
"needs_queue_free_scale_in_guard": true
},
"size": "<string>",
"min_cluster_count": 123,
"max_cluster_count": 123,
"scaling_policy": "<string>",
"auto_suspend": 123,
"generation": "<string>"
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"code": "validation_failed",
"retryable": true,
"type": "about:blank",
"details": [
{}
]
}Body
application/json
Change the generation of a Snowflake warehouse.
Response
Successful Response
A Snowflake warehouse, with its SELECT automated savings settings.

