Skip to main content

clickhouse_log_subscriptions

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

Overview​

Nameclickhouse_log_subscriptions
TypeResource
Idovh.cloud_database.clickhouse_log_subscriptions

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
stream_idstringId of the destination log stream (wire: streamId)
subscription_idstring (uuid)Subscription ID (wire: subscriptionId)
service_namestringName of the destination log service (wire: serviceName)
created_atstring (date-time)Creation date of the subscription (wire: createdAt)
kindstringLog kind name of this subscription
resourceobjectSubscribed resource, where the logs come from
updated_atstring (date-time)Last update date of the subscription (wire: updatedAt)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcluster_id, subscription_id, service_nameReturns the log kind and the destination stream of a subscription.
listselectcluster_id, service_namekind, x_pagination_modeReturns the identifiers of the ClickHouse log subscriptions. Set kind to restrict the list to one log kind.
createinsertcluster_id, service_name, kind, stream_idForwards ClickHouse logs of one kind to a Logs Data Platform stream. The subscription is created asynchronously and the response returns the operation identifier.
deletedeletecluster_id, subscription_id, service_nameDeletes the subscription and stops forwarding ClickHouse logs to the stream.

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.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
cluster_idstring (uuid)Cluster ID (wire: clusterId)
service_namestringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
subscription_idstring (uuid)Subscription ID (wire: subscriptionId)
kindstringFilter on a specific kind (e.g., audit)
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Returns the log kind and the destination stream of a subscription.

SELECT
stream_id,
subscription_id,
service_name,
created_at,
kind,
resource,
updated_at
FROM ovh.cloud_database.clickhouse_log_subscriptions
WHERE cluster_id = '{{ cluster_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

INSERT examples​

Forwards ClickHouse logs of one kind to a Logs Data Platform stream. The subscription is created asynchronously and the response returns the operation identifier.

INSERT INTO ovh.cloud_database.clickhouse_log_subscriptions (
kind,
stream_id,
cluster_id,
service_name
)
SELECT
'{{ kind }}' /* required */,
'{{ stream_id }}' /* required */,
'{{ cluster_id }}',
'{{ service_name }}'
RETURNING
operation_id,
service_name
;

DELETE examples​

Deletes the subscription and stops forwarding ClickHouse logs to the stream.

DELETE FROM ovh.cloud_database.clickhouse_log_subscriptions
WHERE cluster_id = '{{ cluster_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;