api_integrations
Creates, updates, deletes, gets or lists a api_integrations
resource.
Overview
Name | api_integrations |
Type | Resource |
Id | snowflake.api_integration.api_integrations |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Name of the API integration. |
api_allowed_prefixes | array | A comma-separated list of endpoints and resources that Snowflake can access. |
api_blocked_prefixes | array | A comma-separated list of endpoints and resources that are not allowed to be called from Snowflake. |
api_hook | object | |
comment | string | Comment for the API integration. |
created_on | string | Date and time when the API integration was created. |
enabled | boolean | Whether the API integration is enabled. |
Methods
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
fetch_api_integration | SELECT | name, endpoint | - | Fetch an API integration |
list_api_integrations | SELECT | endpoint | like | List API integrations |
create_api_integration | INSERT | data__api_allowed_prefixes, data__api_hook, data__enabled, data__name, endpoint | createMode | Create an API integration |
delete_api_integration | DELETE | name, endpoint | ifExists | Delete an API integration |
create_or_alter_api_integration | REPLACE | name, data__api_allowed_prefixes, data__api_hook, data__enabled, data__name, endpoint | - | Create an (or alter an existing) API integration. Note that API_KEY is not currently altered by this operation and is supported for a newly-created object only. Unsetting API_BLOCKED_PREFIXES is also unsupported. |
Optional Parameter Details
Name | Description | Type | Default |
---|---|---|---|
createMode | Query 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. | string | errorIfExists |
ifExists | Query 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. | boolean | false |
like | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. | string | - |
SELECT
examples
- list_api_integrations
- fetch_api_integration
List API integrations
SELECT
name,
api_allowed_prefixes,
api_blocked_prefixes,
api_hook,
comment,
created_on,
enabled
FROM snowflake.api_integration.api_integrations
WHERE endpoint = '{{ endpoint }}';
Fetch an API integration
SELECT
name,
api_allowed_prefixes,
api_blocked_prefixes,
api_hook,
comment,
created_on,
enabled
FROM snowflake.api_integration.api_integrations
WHERE name = '{{ name }}'
AND endpoint = '{{ endpoint }}';
INSERT
example
Create an API integration
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO snowflake.api_integration.api_integrations (
data__name,
data__api_hook,
data__api_allowed_prefixes,
data__api_blocked_prefixes,
data__enabled,
data__comment,
endpoint
)
SELECT
'{{ name }}',
'{{ api_hook }}',
'{{ api_allowed_prefixes }}',
'{{ api_blocked_prefixes }}',
{{ enabled }},
'{{ comment }}',
'{{ endpoint }}'
;
/*+ create */
INSERT INTO snowflake.api_integration.api_integrations (
data__name,
data__api_hook,
data__api_allowed_prefixes,
data__enabled,
endpoint
)
SELECT
'{{ name }}',
'{{ api_hook }}',
'{{ api_allowed_prefixes }}',
{{ enabled }},
'{{ endpoint }}'
;
# Description fields below are for documentation purposes only and are not required in the manifest
- name: api_integrations
props:
- name: endpoint
value: string
description: Required parameter for the api_integrations resource.
- name: name
value: string
description: >-
Name of the API integration. (Required parameter for the
api_integrations resource.)
- name: api_hook
value:
type: string
description: Required parameter for the api_integrations resource.
- name: api_allowed_prefixes
value: array
description: >-
A comma-separated list of endpoints and resources that Snowflake can
access. (Required parameter for the api_integrations resource.)
- name: api_blocked_prefixes
value: array
description: >-
A comma-separated list of endpoints and resources that are not allowed
to be called from Snowflake.
- name: enabled
value: boolean
description: >-
Whether the API integration is enabled. (Required parameter for the
api_integrations resource.)
- name: comment
value: string
description: Comment for the API integration.
REPLACE
example
Create an (or alter an existing) API integration. Note that API_KEY is not currently altered by this operation and is supported for a newly-created object only. Unsetting API_BLOCKED_PREFIXES is also unsupported.
/*+ update */
REPLACE snowflake.api_integration.api_integrations
SET
name = '{{ name }}',
api_hook = '{{ api_hook }}',
api_allowed_prefixes = '{{ api_allowed_prefixes }}',
api_blocked_prefixes = '{{ api_blocked_prefixes }}',
enabled = {{ enabled }},
comment = '{{ comment }}'
WHERE
name = '{{ name }}'
AND data__api_allowed_prefixes = '{{ data__api_allowed_prefixes }}'
AND data__api_hook = '{{ data__api_hook }}'
AND data__enabled = '{{ data__enabled }}'
AND data__name = '{{ data__name }}'
AND endpoint = '{{ endpoint }}';
DELETE
example
Delete an API integration
/*+ delete */
DELETE FROM snowflake.api_integration.api_integrations
WHERE name = '{{ name }}'
AND endpoint = '{{ endpoint }}';