snowflake.core.api_integration.ApiIntegrationResource¶
- class snowflake.core.api_integration.ApiIntegrationResource(name: Annotated[str, Strict(strict=True)], collection: ApiIntegrationCollection)¶
Bases:
ObjectReferenceMixin[ApiIntegrationCollection]Represents a reference to a Snowflake api integration.
With this api integration reference, you can create, update, delete and fetch information about api integrations, as well as perform certain actions on them.
Attributes
- root¶
The Root object this reference belongs to.
Methods
- create_or_alter(api_integration: ApiIntegration) None¶
Create or alter an API integration.
The operation is limited by the fact that api_key will not be updated and api_blocked_prefixes cannot be unset.
- Parameters:
api_integration (ApiIntegration) – The
ApiIntegrationobject.
Examples
Creating a new API integration:
>>> root.api_integrations["my_api"].create_or_alter(my_api_def)
See
ApiIntegrationCollection.createfor more examples.
- create_or_alter_async(api_integration: ApiIntegration) PollingOperation[None]¶
An asynchronous version of
create_or_alter().Refer to
PollingOperationfor more information on asynchronous execution and the return type.
- drop(if_exists: bool = False) None¶
Drop this api integration.
- Parameters:
if_exists (bool, optional) – Whether to error if the api integration doesn’t exist. Default is
False.
Examples
Deleting an API integration using its reference, error if it doesn’t exist:
>>> api_integration_reference.drop()
Deleting an API integration using its reference, if it exists:
>>> api_integration_reference.drop(if_exists=True)
- drop_async(if_exists: bool = False) PollingOperation[None]¶
An asynchronous version of
drop().Refer to
PollingOperationfor more information on asynchronous execution and the return type.
- fetch() ApiIntegration¶
Fetch the details of an API integration.
Examples
Fetching a reference to an API integration to print its name:
>>> api_integration_reference = root.api_integrations["foo"] >>> my_api_integration = api_integration_reference.fetch() >>> print(my_api_integration.name)
- fetch_async() PollingOperation[ApiIntegration]¶
An asynchronous version of
fetch().Refer to
PollingOperationfor more information on asynchronous execution and the return type.