attachments
Creates, updates, deletes, gets or lists an attachments resource.
Overview
| Name | attachments |
| Type | Resource |
| Id | clickhouse.udfs.attachments |
Fields
The following fields are returned by SELECT queries:
- get
- list
Successful response.
| Name | Datatype | Description |
|---|---|---|
service_id | string (uuid) | ID of the attached service. (pattern: <code>^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$</code>) (wire: serviceId) |
function_name | string | Name of the UDF. (wire: functionName) |
status | string | Current attachment lifecycle state. (deployed, deprovisioning, error, provisioning, standby) |
version | integer | Attached UDF version. |
Successful response.
| Name | Datatype | Description |
|---|---|---|
service_id | string (uuid) | ID of the attached service. (pattern: <code>^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$</code>) (wire: serviceId) |
function_name | string | Name of the UDF. (wire: functionName) |
status | string | Current attachment lifecycle state. (deployed, deprovisioning, error, provisioning, standby) |
version | integer | Attached UDF version. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | function_name, service_id, organization_id | Disclaimer: This beta endpoint is evolving; the API contract may change. <br /><br /> Returns the current attachment of a UDF to one service. | |
list | select | function_name, organization_id | cursor, limit | Disclaimer: This beta endpoint is evolving; the API contract may change. <br /><br /> Returns the current service attachments for a UDF, with at most one attachment per service. |
update | update | function_name, service_id, organization_id | Disclaimer: This beta endpoint is evolving; the API contract may change. <br /><br /> Attaches one UDF version to a service, replacing the current version when necessary. When version is omitted, the latest ready version is attached. | |
delete | delete | function_name, service_id, organization_id | Disclaimer: This beta endpoint is evolving; the API contract may change. <br /><br /> Detaches a UDF from a service. |
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 |
|---|---|---|
function_name | string | Name of the UDF. (wire: functionName) |
organization_id | string | ClickHouse Cloud organization ID. Resolved from the CLICKHOUSE_ORG_ID environment variable when it is set (x-stackQL-envVar); otherwise it must be supplied on every query as WHERE organization_id = <uuid>. A WHERE value always takes precedence over the environment. (x-stackQL-envVar: CLICKHOUSE_ORG_ID) |
service_id | string (uuid) | ID of the requested service. (wire: serviceId) |
cursor | string | Cursor returned in pagination.nextCursor from the previous page. |
limit | integer | Maximum number of records to return per page. Defaults to 100. Maximum is 100. |
SELECT examples
- get
- list
Disclaimer: This beta endpoint is evolving; the API contract may change. <br /><br /> Returns the current attachment of a UDF to one service.
SELECT
service_id,
function_name,
status,
version
FROM clickhouse.udfs.attachments
WHERE function_name = '{{ function_name }}' -- required
AND service_id = '{{ service_id }}' -- required
AND organization_id = '{{ organization_id }}' -- required unless CLICKHOUSE_ORG_ID is set
;
Disclaimer: This beta endpoint is evolving; the API contract may change. <br /><br /> Returns the current service attachments for a UDF, with at most one attachment per service.
SELECT
service_id,
function_name,
status,
version
FROM clickhouse.udfs.attachments
WHERE function_name = '{{ function_name }}' -- required
AND organization_id = '{{ organization_id }}' -- required unless CLICKHOUSE_ORG_ID is set
AND cursor = '{{ cursor }}'
AND limit = '{{ limit }}'
;
UPDATE examples
- update
Disclaimer: This beta endpoint is evolving; the API contract may change. <br /><br /> Attaches one UDF version to a service, replacing the current version when necessary. When version is omitted, the latest ready version is attached.
UPDATE clickhouse.udfs.attachments
SET
version = {{ version }}
WHERE
function_name = '{{ function_name }}' --required
AND service_id = '{{ service_id }}' --required
AND organization_id = '{{ organization_id }}' --required unless CLICKHOUSE_ORG_ID is set
RETURNING
request_id,
result,
status;
DELETE examples
- delete
Disclaimer: This beta endpoint is evolving; the API contract may change. <br /><br /> Detaches a UDF from a service.
DELETE FROM clickhouse.udfs.attachments
WHERE function_name = '{{ function_name }}' --required
AND service_id = '{{ service_id }}' --required
AND organization_id = '{{ organization_id }}' --required unless CLICKHOUSE_ORG_ID is set
;