compute_pools
Creates, updates, deletes, gets or lists a compute_pools
resource.
Overview
Name | compute_pools |
Type | Resource |
Id | snowflake.compute_pool.compute_pools |
Fields
Name | Datatype | Description |
---|---|---|
name | string | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. |
active_nodes | integer | Number of currently active nodes on the compute pool. |
application | string | Name of the Snowflake Native App if the compute pool is created exclusively for the app. |
auto_resume | boolean | Whether Snowflake automatically resumes the compute pool when any statement that requires the compute pool is submitted. |
auto_suspend_secs | integer | Number of seconds until the compute pool automatically suspends. |
budget | string | The name of the budget monitoring the credit usage of the compute pool. |
comment | string | Comment describing the compute pool. |
created_on | string | Time the compute pool was created. |
error_code | string | Current error the compute pool hit if any. |
idle_nodes | integer | Number of currently idle nodes on the compute pool. |
instance_family | string | Instance family for the compute pool. |
is_exclusive | boolean | Whether a compute pool is created exclusively for a Snowflake Native App. |
max_nodes | integer | Maximum number of nodes for the compute pool. |
min_nodes | integer | Minimum number of nodes for the compute pool. |
num_jobs | integer | Number of jobs on the compute pool. |
num_services | integer | Number of services on the compute pool. |
owner | string | Identifier for the current owner of the compute pool. |
resumed_on | string | Time the compute pool was last resumed. |
state | string | Current state of the compute pool. Possible values include UNKNOWN, STARTING, IDLE, ACTIVE, STOPPING, SUSPENDED, and RESIZING. |
status_message | string | Current status of the compute pool if any. |
target_nodes | integer | Number of target nodes on the compute pool. |
updated_on | string | Time the compute pool was last updated. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
fetch_compute_pool | SELECT | name, endpoint | Fetches a named compute pool. You can get the name of the compute pool from the /api/v2/compute-pools GET request. |
list_compute_pools | SELECT | endpoint | Lists the compute pools under the account. |
create_compute_pool | INSERT | data__instance_family, data__max_nodes, data__min_nodes, data__name, endpoint | Creates a compute pool, with standard create modifiers as query parameters. See the Compute Pool component definition for what is required to be provided in the request body. |
delete_compute_pool | DELETE | name, endpoint | Deletes a compute pool with the given name. If you enable the ifExists parameter, the operation succeeds even if the object does not exist. Otherwise, a 404 failure is returned if the object does not exist. |
create_or_alter_compute_pool | REPLACE | name, data__instance_family, data__max_nodes, data__min_nodes, data__name, endpoint | Create a (or alter an existing) compute pool. Even if the operation is just an alter, the full property set must be provided. |
resume_compute_pool | EXEC | name, endpoint | Resume a compute pool, if suspended. If the specified compute pool is already running, no action is taken. |
stop_all_services_in_compute_pool | EXEC | name, endpoint | Stops all services in the compute pool. |
stop_all_services_in_compute_pool_deprecated | EXEC | name, endpoint | Stops all services in the compute pool. Deprecated - use :stop-all-services instead. |
suspend_compute_pool | EXEC | name, endpoint | Suspend a compute pool, if active. If the specified compute pool is already suspended, no action is taken. |
SELECT
examples
Lists the compute pools under the account.
SELECT
name,
active_nodes,
application,
auto_resume,
auto_suspend_secs,
budget,
comment,
created_on,
error_code,
idle_nodes,
instance_family,
is_exclusive,
max_nodes,
min_nodes,
num_jobs,
num_services,
owner,
resumed_on,
state,
status_message,
target_nodes,
updated_on
FROM snowflake.compute_pool.compute_pools
WHERE endpoint = '{{ endpoint }}';
INSERT
example
Use the following StackQL query and manifest file to create a new compute_pools
resource.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO snowflake.compute_pool.compute_pools (
data__name,
data__min_nodes,
data__max_nodes,
data__instance_family,
data__auto_resume,
data__comment,
data__auto_suspend_secs,
endpoint
)
SELECT
'{{ name }}',
'{{ min_nodes }}',
'{{ max_nodes }}',
'{{ instance_family }}',
'{{ auto_resume }}',
'{{ comment }}',
'{{ auto_suspend_secs }}',
'{{ endpoint }}'
;
/*+ create */
INSERT INTO snowflake.compute_pool.compute_pools (
data__name,
data__instance_family,
data__min_nodes,
data__max_nodes,
endpoint
)
SELECT
'{{ name }}',
'{{ instance_family }}',
'{{ min_nodes }}',
'{{ max_nodes }}',
'{{ endpoint }}'
;
- name: compute_pools
props:
- name: data__instance_family
value: string
- name: data__max_nodes
value: string
- name: data__min_nodes
value: string
- name: data__name
value: string
- name: endpoint
value: string
- name: name
value: string
- name: min_nodes
value: integer
- name: max_nodes
value: integer
- name: instance_family
value: string
- name: auto_resume
value: boolean
- name: comment
value: string
- name: auto_suspend_secs
value: integer
REPLACE
example
Replaces all fields in the specified compute_pools
resource.
/*+ update */
REPLACE snowflake.compute_pool.compute_pools
SET
name = '{{ name }}',
min_nodes = '{{ min_nodes }}',
max_nodes = '{{ max_nodes }}',
instance_family = '{{ instance_family }}',
auto_resume = true|false,
comment = '{{ comment }}',
auto_suspend_secs = '{{ auto_suspend_secs }}'
WHERE
name = '{{ name }}'
AND data__instance_family = '{{ data__instance_family }}'
AND data__max_nodes = '{{ data__max_nodes }}'
AND data__min_nodes = '{{ data__min_nodes }}'
AND data__name = '{{ data__name }}'
AND endpoint = '{{ endpoint }}';
DELETE
example
Deletes the specified compute_pools
resource.
/*+ delete */
DELETE FROM snowflake.compute_pool.compute_pools
WHERE name = '{{ name }}'
AND endpoint = '{{ endpoint }}';