Skip to main content

image_repositories

Creates, updates, deletes, gets or lists a image_repositories resource.

Overview

Nameimage_repositories
TypeResource
Idsnowflake.image_repository.image_repositories

Fields

NameDatatypeDescription
namestringA 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.
created_onstringTime the image repository was created.
database_namestringA 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.
ownerstringIdentifier for the current owner of the image repository.
owner_role_typestringRole type of the image repository owner.
repository_urlstringCurrent URL of the image repository.
schema_namestringA 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.

Methods

NameAccessible byRequired ParamsOptional ParamsDescription
fetch_image_repositorySELECTdatabase_name, name, schema_name, endpoint-Fetches a named image repository in a specified database and schema.
list_image_repositoriesSELECTdatabase_name, schema_name, endpointlikeLists the image repositories under a specified database and schema.
create_image_repositoryINSERTdatabase_name, schema_name, data__name, endpointcreateModeCreates 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_repositoryDELETEdatabase_name, name, schema_name, endpointifExistsDeletes 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.

Optional Parameter Details
NameDescriptionTypeDefault
createModeQuery 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.stringerrorIfExists
ifExistsQuery 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.booleanfalse
likeQuery parameter to filter the command output by resource name. Uses case-insensitive pattern matching, with support for SQL wildcard characters.string-

SELECT examples

Lists the image repositories under a specified database and schema.

SELECT
name,
created_on,
database_name,
owner,
owner_role_type,
repository_url,
schema_name
FROM snowflake.image_repository.image_repositories
WHERE database_name = '{{ database_name }}'
AND schema_name = '{{ schema_name }}'
AND endpoint = '{{ endpoint }}';

INSERT example

Use the following StackQL query and manifest file to create a new image_repositories resource.

/*+ create */
INSERT INTO snowflake.image_repository.image_repositories (
data__name,
data__database_name,
data__schema_name,
database_name,
schema_name,
endpoint
)
SELECT
'{{ name }}',
'{{ database_name }}',
'{{ schema_name }}',
'{{ endpoint }}'
;

DELETE example

Deletes the specified image_repositories resource.

/*+ delete */
DELETE FROM snowflake.image_repository.image_repositories
WHERE database_name = '{{ database_name }}'
AND name = '{{ name }}'
AND schema_name = '{{ schema_name }}'
AND endpoint = '{{ endpoint }}';