Skip to main content

log_subscriptions

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

Overview​

Namelog_subscriptions
TypeResource
Idovh.hosting_web.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
getselectservice_name, subscription_idReturns the log kind and the destination stream of a subscription. (Beta version)
listselectservice_namekind, x_pagination_modeReturns the identifiers of the Web Hosting log subscriptions. Set kind to restrict the list to one log kind. (Beta version)
createinsertservice_name, kind, stream_idForwards Web Hosting logs of one kind to a Logs Data Platform stream. The subscription is created asynchronously and the response returns the operation identifier. (Beta version)
deletedeleteservice_name, subscription_idDeletes the subscription and stops forwarding Web Hosting logs to the stream. (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"}})
service_namestringService name (wire: serviceName)
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. (Beta version)

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

INSERT examples​

Forwards Web Hosting 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.hosting_web.log_subscriptions (
kind,
stream_id,
service_name
)
SELECT
'{{ kind }}' /* required */,
'{{ stream_id }}' /* required */,
'{{ service_name }}'
RETURNING
operation_id,
service_name
;

DELETE examples​

Deletes the subscription and stops forwarding Web Hosting logs to the stream. (Beta version)

DELETE FROM ovh.hosting_web.log_subscriptions
WHERE service_name = '{{ service_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;