snowflake.core.managed_account.ManagedAccountCollection¶
- class snowflake.core.managed_account.ManagedAccountCollection(root: Root)¶
- Bases: - AccountObjectCollectionParent[- ManagedAccountResource]- Represents the collection operations of the Snowflake ManagedAccount resource. - With this collection, you can create, iterate through, and search for managed accounts that you have access to in the current context. - Examples - Creating a managed account instance: - >>> managed_account_collection = root.managed_accounts >>> managed_account = ManagedAccount( ... name="managed_account_name", ... admin_name = "admin" ... admin_password = 'TestPassword1' ... account_type = "READER" ... ) >>> managed_account_collection.create(managed_account) - Attributes - root¶
- The Root object this collection belongs to. 
 - Methods - create(managed_account: ManagedAccountModel) ManagedAccountResource¶
- Create a managed account in Snowflake. - Parameters:
- managed_account (ManagedAccount) 
 - Examples - Creating a managed account instance and getting reference to it: - >>> managed_account_parameters = ManagedAccount( ... name="managed_account_name", ... admin_name = "admin" ... admin_password = 'TestPassword1' ... account_type = "READER" ... ) >>> # Use the managed account collection created before to create a reference to a managed account resource >>> # in Snowflake. >>> managed_account_reference = managed_account_collection.create(managed_account_parameters) 
 - create_async(managed_account: ManagedAccountModel) PollingOperation[ManagedAccountResource]¶
- 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[ManagedAccountModel]¶
- Iterate through - ManagedAccountobjects in 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 managed accounts that you have access to see: - >>> managed_accounts = managed_account_collection.iter() - Showing information of the exact managed account you want to see: - >>> managed_accounts = managed_account_collection.iter(like="your-managed-account-name") - Showing managed accounts starting with ‘your-managed-account-name-‘: - >>> managed_accounts = managed_account_collection.iter(like="your-managed-account-name-%") - Using a for loop to retrieve information from iterator: - >>> for managed_account in managed_accounts: >>> print(managed_account.name, managed_account.comment) 
 - iter_async(*, like: str | None = None) PollingOperation[Iterator[ManagedAccountModel]]¶
- 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]¶