snowflake.core.external_volume.ExternalVolumeResource¶

class snowflake.core.external_volume.ExternalVolumeResource(name: str, collection: ExternalVolumeCollection)¶

Bases: ObjectReferenceMixin[ExternalVolumeCollection]

Represents a reference to a Snowflake external volume.

With this external volume reference, you can fetch information about external volumes, as well as perform certain actions on them.

Attributes

root¶

Methods

drop(if_exists: bool | None = None) → None¶

Drop this external volume.

Parameters:

if_exist (bool, optional) – If True, does not throw an exception if the external volume does not exist. The default is None, which behaves equivalently to it being False.

Examples

Deleting an external volume using its reference:

>>> external_volume_reference.drop()
Copy

Using an external volume reference to delete an external volume if it exists:

>>> external_volume_reference.drop(if_exist=True)
Copy
fetch() → ExternalVolume¶

Fetch the details of an external volume resource.

Examples

Fetching an external volume using its reference: >>> external_volume = external_volume_reference.fetch() # Accessing information of the external volume with external volume instance. >>> print(external_volume.name, external_volume.comment)

undrop() → None¶

Undrop this external volume.

Examples

Restoring an external volume using its reference:

>>> external_volume_reference.undrop()
Copy