snowflake.core.api_integration.ApiIntegrationCollectionΒΆ

class snowflake.core.api_integration.ApiIntegrationCollection(root: Root)ΒΆ

Bases: ApiIntegrationCollectionBase

Represents the collection operations on the Snowflake api integration resource.

With this collection, you can create, iterate through, and search for api integration that you have access to in the current context.

Examples

Creating an ApiIntegration instance using AWS API Gateway:

>>> api_integrations = root.api_integrations
>>> new_api_integration = ApiIntegration(
...     name="name",
...     api_hook=AwsHook(
...         api_provider="AWS_API_GATEWAY",
...         api_aws_role_arn="your_arn",
...         api_key=os.environ.get("YOUR_API_KEY"),
...     ),
...     api_allowed_prefixes=["https://snowflake.com"],
...     enabled=True,
... )
>>> api_integrations.create(new_api_integration)
Copy

Attributes

rootΒΆ

The Root object this collection belongs to.

Methods

create(api_integration: ApiIntegration, mode: CreateMode | str | None = None) β†’ ApiIntegrationResourceΒΆ

Create an API integration.

Parameters:
  • api_integration (ApiIntegration) – (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(api_integration: ApiIntegration, mode: CreateMode | str | None = None) β†’ PollingOperation[ApiIntegrationResource]ΒΆ

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[ApiIntegration]ΒΆ

List API integrations.

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[ApiIntegration]]ΒΆ

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