api_integrations
Creates, updates, deletes, gets or lists an api_integrations resource.
Overview
| Name | api_integrations |
| Type | Resource |
| Id | snowflake.integrations.api_integrations |
Fields
The following fields are returned by SELECT queries:
- get
- list
successful
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the API integration. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$) |
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-time) | Date and time when the API integration was created. |
enabled | boolean | Whether the API integration is enabled. |
A Snowflake API integration object.
| Name | Datatype | Description |
|---|---|---|
name | string | Name of the API integration. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$) |
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-time) | Date and time when the API integration was created. |
enabled | boolean | Whether the API integration is enabled. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | name, endpoint | Fetch an API integration | |
list | select | endpoint | like | List API integrations |
create | insert | endpoint, name, api_hook, api_allowed_prefixes, enabled | createMode | Create an API integration |
create_or_alter | replace | api_integration_name, endpoint, name, api_hook, api_allowed_prefixes, enabled | 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. | |
delete | delete | name, endpoint | ifExists | Delete an API integration |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_integration_name | string | Identifier (i.e. name) for the resource. |
endpoint | string | Organization and account identifier (orgname-accountname) (default: orgname-accountname) |
name | string | Identifier (i.e. name) for the resource. |
createMode | string | 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. |
ifExists | boolean | 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. |
like | string | Parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. |
SELECT examples
- get
- list
Fetch an API integration
SELECT
name,
api_allowed_prefixes,
api_blocked_prefixes,
api_hook,
comment,
created_on,
enabled
FROM snowflake.integrations.api_integrations
WHERE name = '{{ name }}' -- required
AND endpoint = '{{ endpoint }}' -- required
;
List API integrations
SELECT
name,
api_allowed_prefixes,
api_blocked_prefixes,
api_hook,
comment,
created_on,
enabled
FROM snowflake.integrations.api_integrations
WHERE endpoint = '{{ endpoint }}' -- required
AND "like" = '{{ like }}'
;
INSERT examples
- create
- Manifest
Create an API integration
INSERT INTO snowflake.integrations.api_integrations (
name,
api_hook,
api_allowed_prefixes,
api_blocked_prefixes,
enabled,
comment,
endpoint,
createMode
)
SELECT
'{{ name }}' /* required */,
'{{ api_hook }}' /* required */,
'{{ api_allowed_prefixes }}' /* required */,
'{{ api_blocked_prefixes }}',
{{ enabled }} /* required */,
'{{ comment }}',
'{{ endpoint }}',
'{{ createMode }}'
RETURNING
status
;
# Description fields are for documentation purposes
- name: api_integrations
props:
- name: endpoint
value: "{{ endpoint }}"
description: Required parameter for the api_integrations resource.
- name: name
value: "{{ name }}"
description: |
Name of the API integration.
- name: api_hook
value:
type: "{{ type }}"
- name: api_allowed_prefixes
value:
- "{{ api_allowed_prefixes }}"
description: |
A comma-separated list of endpoints and resources that Snowflake can access.
- name: api_blocked_prefixes
value:
- "{{ api_blocked_prefixes }}"
description: |
A comma-separated list of endpoints and resources that are not allowed to be called from Snowflake.
- name: enabled
value: {{ enabled }}
description: |
Whether the API integration is enabled.
- name: comment
value: "{{ comment }}"
description: |
Comment for the API integration.
- name: createMode
value: "{{ createMode }}"
description: 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.
description: 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.
REPLACE examples
- create_or_alter
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.
REPLACE snowflake.integrations.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
api_integration_name = '{{ api_integration_name }}' --required
AND endpoint = '{{ endpoint }}' --required
AND name = '{{ name }}' --required
AND api_hook = '{{ api_hook }}' --required
AND api_allowed_prefixes = '{{ api_allowed_prefixes }}' --required
AND enabled = {{ enabled }} --required
RETURNING
status;
DELETE examples
- delete
Delete an API integration
DELETE FROM snowflake.integrations.api_integrations
WHERE name = '{{ name }}' --required
AND endpoint = '{{ endpoint }}' --required
AND ifExists = '{{ ifExists }}'
;