Skip to main content

api_log_subscriptions

Creates, updates, deletes, gets or lists an api_log_subscriptions resource.

Overview​

Nameapi_log_subscriptions
TypeResource
Idovh.me.api_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
getselectsubscription_idGet subscription details
listselectkind, x_pagination_modeList subscription IDs for a cluster
createinsertkind, stream_idCreate a subscription from logs to a pre-existing LDP stream
deletedeletesubscription_idDelete a subscription

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"}})
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​

Get subscription details

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

INSERT examples​

Create a subscription from logs to a pre-existing LDP stream

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

DELETE examples​

Delete a subscription

DELETE FROM ovh.me.api_log_subscriptions
WHERE subscription_id = '{{ subscription_id }}' --required
;