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)
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] ΒΆ