image_repositories
Creates, updates, deletes, gets or lists an image_repositories
resource.
Overview
Name | image_repositories |
Type | Resource |
Id | snowflake.image_repository.image_repositories |
Fields
The following fields are returned by SELECT
queries:
- list_image_repositories
- fetch_image_repository
A Snowflake image repository.
Name | Datatype | Description |
---|---|---|
name | string | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME) |
database_name | string | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME) |
schema_name | string | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME) |
created_on | string (date-time) | Time the image repository was created. |
owner | string | Identifier for the current owner of the image repository. |
owner_role_type | string | Role type of the image repository owner. |
repository_url | string | Current URL of the image repository. |
A Snowflake image repository.
Name | Datatype | Description |
---|---|---|
name | string | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME) |
database_name | string | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME) |
schema_name | string | A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive. (pattern: ^"([^"]|"")+"|[a-zA-Z_][a-zA-Z0-9_$]*$, example: TEST_NAME) |
created_on | string (date-time) | Time the image repository was created. |
owner | string | Identifier for the current owner of the image repository. |
owner_role_type | string | Role type of the image repository owner. |
repository_url | string | Current URL of the image repository. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list_image_repositories | select | database_name , schema_name , endpoint | like | Lists the image repositories under a specified database and schema. |
fetch_image_repository | select | database_name , schema_name , name , endpoint | Fetches a named image repository in a specified database and schema. | |
create_image_repository | insert | database_name , schema_name , endpoint | createMode | Creates an image repository in the specified database, schema, and create mode. The createMode query parameter specifies what action to take based on whether the repository already exists. See the ImageRepository component definition for what is required to be provided in the request body. |
delete_image_repository | delete | database_name , schema_name , name , endpoint | ifExists | Deletes an image repository with the given name. If you enable the ifExists query parameter, the operation succeeds even if the object does not exist. Otherwise, a 404 failure is returned if the object does not exist. |
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 |
---|---|---|
database_name | string | Identifier (i.e. name) for the database to which the resource belongs. You can use the /api/v2/databases GET request to get a list of available databases. |
endpoint | string | Organization and Account Name (default: orgid-acctid) |
name | string | Identifier (i.e. name) for the resource. |
schema_name | string | Identifier (i.e. name) for the schema to which the resource belongs. You can use the /api/v2/databases/{database}/schemas GET request to get a list of available schemas for the specified database. |
createMode | string | 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. |
ifExists | boolean | 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. |
like | string | Query parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters. |
SELECT
examples
- list_image_repositories
- fetch_image_repository
Lists the image repositories under a specified database and schema.
SELECT
name,
database_name,
schema_name,
created_on,
owner,
owner_role_type,
repository_url
FROM snowflake.image_repository.image_repositories
WHERE database_name = '{{ database_name }}' -- required
AND schema_name = '{{ schema_name }}' -- required
AND endpoint = '{{ endpoint }}' -- required
AND like = '{{ like }}';
Fetches a named image repository in a specified database and schema.
SELECT
name,
database_name,
schema_name,
created_on,
owner,
owner_role_type,
repository_url
FROM snowflake.image_repository.image_repositories
WHERE database_name = '{{ database_name }}' -- required
AND schema_name = '{{ schema_name }}' -- required
AND name = '{{ name }}' -- required
AND endpoint = '{{ endpoint }}' -- required;
INSERT
examples
- create_image_repository
- Manifest
Creates an image repository in the specified database, schema, and create mode. The createMode
query parameter specifies what action to take based on whether the repository already exists. See the ImageRepository component definition for what is required to be provided in the request body.
INSERT INTO snowflake.image_repository.image_repositories (
data__name,
data__database_name,
data__schema_name,
database_name,
schema_name,
endpoint,
createMode
)
SELECT
'{{ name }}' --required,
'{{ database_name }}',
'{{ schema_name }}',
'{{ database_name }}',
'{{ schema_name }}',
'{{ endpoint }}',
'{{ createMode }}'
;
# Description fields are for documentation purposes
- name: image_repositories
props:
- name: database_name
value: string
description: Required parameter for the image_repositories resource.
- name: schema_name
value: string
description: Required parameter for the image_repositories resource.
- name: endpoint
value: string
description: Required parameter for the image_repositories resource.
- name: name
value: string
description: >
A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.
- name: database_name
value: string
description: >
A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.
- name: schema_name
value: string
description: >
A Snowflake object identifier. If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.
- name: createMode
value: string
description: 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.
DELETE
examples
- delete_image_repository
Deletes an image repository with the given name. If you enable the ifExists
query parameter, the operation succeeds even if the object does not exist. Otherwise, a 404 failure is returned if the object does not exist.
DELETE FROM snowflake.image_repository.image_repositories
WHERE database_name = '{{ database_name }}' --required
AND schema_name = '{{ schema_name }}' --required
AND name = '{{ name }}' --required
AND endpoint = '{{ endpoint }}' --required
AND ifExists = '{{ ifExists }}';