snowflake.core.stream.StreamResource¶
- class snowflake.core.stream.StreamResource(name: str, collection_class: StreamCollectionBase)¶
Bases:
StreamResourceBaseRepresents a reference to a Snowflake Stream resource.
With this stream reference, you can fetch information about a stream, as well as perform certain actions on it.
Attributes
- database¶
The DatabaseResource this reference belongs to.
- fully_qualified_name¶
Return the fully qualified name of the object this reference points to.
- root¶
The Root object this reference belongs to.
Methods
- clone(target_database: str, target_schema: str, stream_clone: StreamClone, create_mode: CreateMode | str | None = None, copy_grants: bool | None = None) None¶
Clone a stream.
- Parameters:
target_database (str) – Database of the target resource. Defaults to the source’s database (required)
target_schema (str) – Schema of the target resource. Defaults to the source’s schema (required)
stream_clone (StreamClone) – (required)
create_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.
copy_grants (bool) – Parameter to enable copy grants when creating the object.
- clone_async(target_database: str, target_schema: str, stream_clone: StreamClone, create_mode: CreateMode | str | None = None, copy_grants: bool | None = None) PollingOperation[None]¶
An asynchronous version of
clone().Refer to
PollingOperationfor more information on asynchronous execution and the return type.
- drop(if_exists: bool | None = None) None¶
Delete a stream.
- Parameters:
if_exists (bool) – Parameter that specifies how to handle the request for a resource that does not exist: - true: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - false: The endpoint throws an error if the resource doesn’t exist.
- drop_async(if_exists: bool | None = None) PollingOperation[None]¶
An asynchronous version of
drop().Refer to
PollingOperationfor more information on asynchronous execution and the return type.
- fetch_async() PollingOperation[Stream]¶
An asynchronous version of
fetch().Refer to
PollingOperationfor more information on asynchronous execution and the return type.
- get_tags(with_lineage: bool | None = None) dict[TagResource, TagValue]¶
Get the tag assignments for a stream.
Returns all tags assigned to a stream. This operation requires an active warehouse.
- Parameters:
with_lineage (bool) – Parameter that specifies whether tag assignments inherited by the object from its ancestors in securable object hierarchy should be returned as well: - true: All tags assigned to this object should be returned, inheritance included. - false: Only tags explicitly assigned to this object should be returned.
- get_tags_async(with_lineage: bool | None = None) PollingOperation[dict[TagResource, TagValue]]¶
An asynchronous version of
get_tags().Refer to
PollingOperationfor more information on asynchronous execution and the return type.
- set_tags(tags: dict[TagResource, TagValue], if_exists: bool | None = None) None¶
Set tags on a stream.
- Parameters:
tags (dict[TagResource, TagValue]) – (required)
if_exists (bool) – Parameter that specifies how to handle the request for a resource that does not exist: - true: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - false: The endpoint throws an error if the resource doesn’t exist.
- set_tags_async(tags: dict[TagResource, TagValue], if_exists: bool | None = None) PollingOperation[None]¶
An asynchronous version of
set_tags().Refer to
PollingOperationfor more information on asynchronous execution and the return type.
- unset_tags(tag_resources: set[TagResource], if_exists: bool | None = None) None¶
Unset tags from a stream.
- Parameters:
tag_resources (set[TagResource]) – (required)
if_exists (bool) – Parameter that specifies how to handle the request for a resource that does not exist: - true: The endpoint does not throw an error if the resource does not exist. It returns a 200 success response, but does not take any action on the resource. - false: The endpoint throws an error if the resource doesn’t exist.
- unset_tags_async(tag_resources: set[TagResource], if_exists: bool | None = None) PollingOperation[None]¶
An asynchronous version of
unset_tags().Refer to
PollingOperationfor more information on asynchronous execution and the return type.