image_repositories
Creates, updates, deletes, gets or lists a image_repositories
resource.
Overview
Name | image_repositories |
Type | Resource |
Id | snowflake.image_repository.image_repositories |
Fields
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. |
created_on | string | Time the image repository was created. |
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. |
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. |
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. |
Methods
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
fetch_image_repository | SELECT | database_name, name, schema_name, endpoint | - | Fetches a named image repository in a specified database and schema. |
list_image_repositories | SELECT | database_name, schema_name, endpoint | like | Lists the image repositories under a specified database and schema. |
create_image_repository | INSERT | database_name, schema_name, data__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, name, schema_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. |
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
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.
- Required Properties
- All Properties
- Manifest
/*+ 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 }}'
;
/*+ create */
INSERT INTO snowflake.image_repository.image_repositories (
data__name,
database_name,
schema_name,
endpoint
)
SELECT
'{{ name }}',
'{{ database_name }}',
'{{ schema_name }}',
'{{ endpoint }}'
;
- name: image_repositories
props:
- name: database_name
value: string
- name: schema_name
value: string
- name: data__name
value: string
- name: endpoint
value: string
- name: name
value: string
- name: database_name
value: string
- name: schema_name
value: string
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 }}';