snowflake.core.image_repository.ImageRepositoryCollection¶
- class snowflake.core.image_repository.ImageRepositoryCollection(schema: SchemaResource)¶
- Bases: - ImageRepositoryCollectionBase- Represents the collection operations on the Snowflake Image Repository resource. - With this collection, you can create, iterate through, and search for image repositories that you have access to in the current context. - Examples - Creating an image repository instance: - >>> image_repository = ImageRepository(name="my_image_repository") >>> image_repositories = root.databases["my_db"].schemas["my_schema"].image_repositories >>> image_repositories.create(image_repository) - Attributes - database¶
- The DatabaseResource this collection belongs to. 
 - root¶
- The Root object this collection belongs to. 
 - Methods - create(image_repository: ImageRepositoryModel, mode: CreateMode = CreateMode.error_if_exists) ImageRepositoryResource¶
- Create an image repository in Snowflake. - Parameters:
- image_repository (ImageRepository) – The - ImageRepositoryobject, together with the- ImageRepository’s properties: name;
- mode (CreateMode, optional) – - One of the following enum values. - CreateMode.error_if_exists: Throw an- snowflake.core.exceptions.ConflictErrorif the image repository already exists in Snowflake. Equivalent to SQL- create image repository <name> ....- CreateMode.or_replace: Replace if the image repository already exists in Snowflake. Equivalent to SQL- create or replace image repository <name> ....- CreateMode.if_not_exists: Do nothing if the image repository already exists in Snowflake. Equivalent to SQL- create image repository <name> if not exists...- Default value is - CreateMode.error_if_exists.
 
 - Examples - Creating an image repository, replacing an existing image repository with the same name: - >>> image_repository = ImageRepository(name="my_image_repository") >>> image_repositories = root.databases["my_db"].schemas["my_schema"].image_repositories >>> image_repositories.create(image_repository, mode=CreateMode.or_replace) 
 - create_async(image_repository: ImageRepositoryModel, mode: CreateMode = CreateMode.error_if_exists) PollingOperation[ImageRepositoryResource]¶
- An asynchronous version of - create().- Refer to - PollingOperationfor more information on asynchronous execution and the return type.
 - items() ItemsView[str, T]¶
 - iter(*, like: str | None = None) Iterator[ImageRepositoryModel]¶
- Iterate through - ImageRepositoryobjects from Snowflake, filtering on any optional ‘like’ pattern.- Parameters:
- like (str, optional) – A case-insensitive string functioning as a filter, with support for SQL wildcard characters (% and _). 
 - Examples - Showing all image repositories that you have access to see: - >>> image_repositories = image_repository_collection.iter() - Showing information of the exact image repository you want to see: - >>> image_repositories = image_repository_collection.iter(like="your-image-repository-name") - Showing image repositories starting with ‘your-image-repository-name-‘: - >>> image_repositories = image_repository_collection.iter(like="your-image-repository-name-%") - Using a for loop to retrieve information from iterator: - >>> for image_repository in image_repositories: >>> print(image_repository.name) 
 - iter_async(*, like: str | None = None) PollingOperation[Iterator[ImageRepositoryModel]]¶
- An asynchronous version of - iter().- Refer to - PollingOperationfor 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]¶