Skip to main content

resource_log_subscriptions

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

Overview​

Nameresource_log_subscriptions
TypeResource
Idovh.okms.resource_log_subscriptions

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
stream_idstringIdentifier of the destination log stream (wire: streamId)
subscription_idstring (uuid)Unique identifier of the subscription, used to change or stop the forwarding (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
getselectokms_id, subscription_idReturns the log kind and the destination stream of a subscription. (Beta version)
listselectokms_idx_pagination_cursor, x_pagination_size, kindReturns the identifiers of the log subscriptions of the service. Filter them by log kind with the kind parameter. (Beta version)
createinsertokms_id, kind, stream_idForwards the logs of one kind to a Logs Data Platform stream. The subscription is created asynchronously and the response returns the operation identifier. (Beta version)
deletedeleteokms_id, subscription_idDeletes the subscription and stops forwarding logs to the stream. The deletion runs asynchronously and the response returns the operation identifier. (Beta version)

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"}})
okms_idstring (uuid)Okms ID (wire: okmsId)
subscription_idstring (uuid)Subscription ID (wire: subscriptionId)
kindstringFilter on a specific kind, for example audit
x_pagination_cursorstringPagination cursor (wire: X-Pagination-Cursor)
x_pagination_sizeintegerPagination size (wire: X-Pagination-Size)

SELECT examples​

Returns the log kind and the destination stream of a subscription. (Beta version)

SELECT
stream_id,
subscription_id,
service_name,
created_at,
kind,
resource,
updated_at
FROM ovh.okms.resource_log_subscriptions
WHERE okms_id = '{{ okms_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples​

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

INSERT INTO ovh.okms.resource_log_subscriptions (
kind,
stream_id,
okms_id
)
SELECT
'{{ kind }}' /* required */,
'{{ stream_id }}' /* required */,
'{{ okms_id }}'
RETURNING
operation_id,
service_name
;

DELETE examples​

Deletes the subscription and stops forwarding logs to the stream. The deletion runs asynchronously and the response returns the operation identifier. (Beta version)

DELETE FROM ovh.okms.resource_log_subscriptions
WHERE okms_id = '{{ okms_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;