snowflake.core.external_volume.ExternalVolumeCollectionΒΆ

class snowflake.core.external_volume.ExternalVolumeCollection(root: Root)ΒΆ

Bases: ExternalVolumeCollectionBase

Represents the collection operations of the Snowflake External Volume resource.

With this collection, you can create, iterate through, and search for external volume that you have access to in the current context.

Examples

Creating an external volume instance:

>>> external_volume_collection = root.external_volumes
>>> external_volume = ExternalVolume(
...     name="MY_EXTERNAL_VOLUME",
...     storage_location=StorageLocationS3(
...         name="abcd-my-s3-us-west-2",
...         storage_base_url="s3://MY_EXAMPLE_BUCKET/",
...         storage_aws_role_arn="arn:aws:iam::123456789022:role/myrole",
...         encryption=Encryption(
...             type="AWS_SSE_KMS", kms_key_id="1234abcd-12ab-34cd-56ef-1234567890ab"
...         ),
...     ),
...     comment="This is my external volume",
... )
>>> external_volume_collection.create(external_volume)
Copy

Attributes

rootΒΆ

The Root object this collection belongs to.

Methods

create(external_volume: ExternalVolume, mode: CreateMode | str | None = None) β†’ ExternalVolumeResourceΒΆ

Create an external volume.

Parameters:
  • external_volume (ExternalVolume) – (required)

  • mode (Union[CreateMode, str]) – Parameter allowing support for different modes of resource creation. Possible values include: - errorIfExists: Throws an error if you try to create a resource that already exists. - orReplace: Automatically replaces the existing resource with the current one. - ifNotExists: Creates a new resource when an alter is requested for a non-existent resource.

create_async(external_volume: ExternalVolume, mode: CreateMode | str | None = None) β†’ PollingOperation[ExternalVolumeResource]ΒΆ

An asynchronous version of create().

Refer to PollingOperation for more information on asynchronous execution and the return type.

items() β†’ ItemsView[str, T]ΒΆ
iter(*, like: str | None = None) β†’ Iterator[ExternalVolume]ΒΆ

List external volumes.

Parameters:

like (str) – Parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters.

iter_async(*, like: str | None = None) β†’ PollingOperation[Iterator[ExternalVolume]]ΒΆ

An asynchronous version of iter().

Refer to PollingOperation for more information on asynchronous execution and the return type.

keys() β†’ KeysView[str]ΒΆ
update_reference(old_name: str, new_name: str, resource: T) β†’ NoneΒΆ

Update the collection with a new item.

values() β†’ ValuesView[T]ΒΆ