snowflake.core.warehouse.WarehouseResource¶
- class snowflake.core.warehouse.WarehouseResource(name: str, collection: WarehouseCollection)¶
Bases:
ObjectReferenceMixin[WarehouseCollection]Represents a reference to a Snowflake warehouse.
With this warehouse reference, you can create, update, and fetch information about warehouses, as well as perform certain actions on them.
Attributes
- root¶
Methods
- abort_all_queries() None¶
Abort all queries running or queueing on this warehouse.
Examples
Using a warehouse reference to abort all queries:
- create_or_alter(warehouse: WarehouseModel) None¶
Create a warehouse in Snowflake or alter one if it already exists.
Examples
Creating or updating a warehouse in Snowflake:
# Using a
WarehouseCollectionto create or update a warehouse in Snowflake: >>> root.warehouses[“your-warehouse-name”].create_or_alter(warehouse_parameters)
- create_or_update(warehouse: WarehouseModel) None¶
The create_or_update method is deprecated; use create_or_alter instead.
- delete() None¶
The delete method is deprecated; use drop instead.
- drop() None¶
Drop this warehouse.
Examples
Deleting a warehouse using its reference:
- fetch() WarehouseModel¶
Fetch the details of a warehouse.
Examples
Fetching a warehouse using its reference:
# Accessing information of the warehouse with warehouse instance. >>> print(warehouse.name, warehouse.warehouse_size)
- rename(new_name: str) None¶
Rename this warehouse.
This function will ignore other parameters in warehouse instance; use create_or_update() to update parameters.
Examples
Using a warehouse reference to rename a warehouse in Snowflake:
- resume() None¶
Resume the warehouse.
Examples
Using a warehouse reference to resume a warehouse:
- suspend() None¶
Suspend the warehouse.
Examples
Using a warehouse reference to suspend a warehouse: