pub trait ClientSystemAlertsExt {
Show 14 methods
// Required methods
fn alert_class_list(&self) -> AlertClassList<'_>;
fn alert_receiver_list(&self) -> AlertReceiverList<'_>;
fn alert_receiver_view(&self) -> AlertReceiverView<'_>;
fn alert_receiver_delete(&self) -> AlertReceiverDelete<'_>;
fn alert_delivery_list(&self) -> AlertDeliveryList<'_>;
fn alert_receiver_probe(&self) -> AlertReceiverProbe<'_>;
fn alert_receiver_subscription_add(
&self,
) -> AlertReceiverSubscriptionAdd<'_>;
fn alert_receiver_subscription_remove(
&self,
) -> AlertReceiverSubscriptionRemove<'_>;
fn alert_delivery_resend(&self) -> AlertDeliveryResend<'_>;
fn webhook_receiver_create(&self) -> WebhookReceiverCreate<'_>;
fn webhook_receiver_update(&self) -> WebhookReceiverUpdate<'_>;
fn webhook_secrets_list(&self) -> WebhookSecretsList<'_>;
fn webhook_secrets_add(&self) -> WebhookSecretsAdd<'_>;
fn webhook_secrets_delete(&self) -> WebhookSecretsDelete<'_>;
}
Expand description
Alerts deliver notifications for events that occur on the Oxide rack
Required Methods§
Sourcefn alert_class_list(&self) -> AlertClassList<'_>
fn alert_class_list(&self) -> AlertClassList<'_>
List alert classes
Sends a GET
request to /v1/alert-classes
Arguments:
filter
: An optional glob pattern for filtering alert class names.
If provided, only alert classes which match this glob pattern will be included in the response.
limit
: Maximum number of items returned by a single callpage_token
: Token returned by previous call to retrieve the subsequent page
let response = client.alert_class_list()
.filter(filter)
.limit(limit)
.page_token(page_token)
.send()
.await;
Sourcefn alert_receiver_list(&self) -> AlertReceiverList<'_>
fn alert_receiver_list(&self) -> AlertReceiverList<'_>
List alert receivers
Sends a GET
request to /v1/alert-receivers
Arguments:
limit
: Maximum number of items returned by a single callpage_token
: Token returned by previous call to retrieve the subsequent pagesort_by
let response = client.alert_receiver_list()
.limit(limit)
.page_token(page_token)
.sort_by(sort_by)
.send()
.await;
Sourcefn alert_receiver_view(&self) -> AlertReceiverView<'_>
fn alert_receiver_view(&self) -> AlertReceiverView<'_>
Fetch alert receiver
Sends a GET
request to /v1/alert-receivers/{receiver}
Arguments:
receiver
: The name or ID of the webhook receiver.
let response = client.alert_receiver_view()
.receiver(receiver)
.send()
.await;
Sourcefn alert_receiver_delete(&self) -> AlertReceiverDelete<'_>
fn alert_receiver_delete(&self) -> AlertReceiverDelete<'_>
Delete alert receiver
Sends a DELETE
request to /v1/alert-receivers/{receiver}
Arguments:
receiver
: The name or ID of the webhook receiver.
let response = client.alert_receiver_delete()
.receiver(receiver)
.send()
.await;
Sourcefn alert_delivery_list(&self) -> AlertDeliveryList<'_>
fn alert_delivery_list(&self) -> AlertDeliveryList<'_>
List delivery attempts to alert receiver
Optional query parameters to this endpoint may be used to filter
deliveries by state. If none of the failed
, pending
or delivered
query parameters are present, all deliveries are returned. If one or
more of these parameters are provided, only those which are set to
“true” are included in the response.
Sends a GET
request to /v1/alert-receivers/{receiver}/deliveries
Arguments:
receiver
: The name or ID of the webhook receiver.delivered
: If true, include deliveries which have succeeded.
If any of the “pending”, “failed”, or “delivered” query parameters are set to true, only deliveries matching those state(s) will be included in the response. If NO state filter parameters are set, then all deliveries are included.
failed
: If true, include deliveries which have failed permanently.
If any of the “pending”, “failed”, or “delivered” query parameters are set to true, only deliveries matching those state(s) will be included in the response. If NO state filter parameters are set, then all deliveries are included.
A delivery fails permanently when the retry limit of three total attempts is reached without a successful delivery.
limit
: Maximum number of items returned by a single callpage_token
: Token returned by previous call to retrieve the subsequent pagepending
: If true, include deliveries which are currently in progress.
If any of the “pending”, “failed”, or “delivered” query parameters are set to true, only deliveries matching those state(s) will be included in the response. If NO state filter parameters are set, then all deliveries are included.
A delivery is considered “pending” if it has not yet been sent at all, or if a delivery attempt has failed but the delivery has retries remaining.
sort_by
let response = client.alert_delivery_list()
.receiver(receiver)
.delivered(delivered)
.failed(failed)
.limit(limit)
.page_token(page_token)
.pending(pending)
.sort_by(sort_by)
.send()
.await;
Sourcefn alert_receiver_probe(&self) -> AlertReceiverProbe<'_>
fn alert_receiver_probe(&self) -> AlertReceiverProbe<'_>
Send liveness probe to alert receiver
This endpoint synchronously sends a liveness probe to the selected alert receiver. The response message describes the outcome of the probe: either the successful response (as appropriate), or indication of why the probe failed.
The result of the probe is represented as an AlertDelivery
model.
Details relating to the status of the probe depend on the alert delivery
mechanism, and are included in the AlertDeliveryAttempts
model. For
example, webhook receiver liveness probes include the HTTP status code
returned by the receiver endpoint.
Note that the response status is 200 OK
as long as a probe request was
able to be sent to the receiver endpoint. If an HTTP-based receiver,
such as a webhook, responds to the another status code, including an
error, this will be indicated by the response body, not the status of
the response.
The resend
query parameter can be used to request re-delivery of
failed events if the liveness probe succeeds. If it is set to true and
the liveness probe succeeds, any alerts for which delivery to this
receiver has failed will be queued for re-delivery.
Sends a POST
request to /v1/alert-receivers/{receiver}/probe
Arguments:
receiver
: The name or ID of the webhook receiver.resend
: If true, resend all events that have not been delivered successfully if the probe request succeeds.
let response = client.alert_receiver_probe()
.receiver(receiver)
.resend(resend)
.send()
.await;
Sourcefn alert_receiver_subscription_add(&self) -> AlertReceiverSubscriptionAdd<'_>
fn alert_receiver_subscription_add(&self) -> AlertReceiverSubscriptionAdd<'_>
Add alert receiver subscription
Sends a POST
request to /v1/alert-receivers/{receiver}/subscriptions
Arguments:
receiver
: The name or ID of the webhook receiver.body
let response = client.alert_receiver_subscription_add()
.receiver(receiver)
.body(body)
.send()
.await;
Sourcefn alert_receiver_subscription_remove(
&self,
) -> AlertReceiverSubscriptionRemove<'_>
fn alert_receiver_subscription_remove( &self, ) -> AlertReceiverSubscriptionRemove<'_>
Remove alert receiver subscription
Sends a DELETE
request to
/v1/alert-receivers/{receiver}/subscriptions/{subscription}
Arguments:
receiver
: The name or ID of the webhook receiver.subscription
: The event class subscription itself.
let response = client.alert_receiver_subscription_remove()
.receiver(receiver)
.subscription(subscription)
.send()
.await;
Sourcefn alert_delivery_resend(&self) -> AlertDeliveryResend<'_>
fn alert_delivery_resend(&self) -> AlertDeliveryResend<'_>
Request re-delivery of alert
Sends a POST
request to /v1/alerts/{alert_id}/resend
Arguments:
alert_id
: UUID of the alertreceiver
: The name or ID of the webhook receiver.
let response = client.alert_delivery_resend()
.alert_id(alert_id)
.receiver(receiver)
.send()
.await;
Sourcefn webhook_receiver_create(&self) -> WebhookReceiverCreate<'_>
fn webhook_receiver_create(&self) -> WebhookReceiverCreate<'_>
Create webhook receiver
Sends a POST
request to /v1/webhook-receivers
let response = client.webhook_receiver_create()
.body(body)
.send()
.await;
Sourcefn webhook_receiver_update(&self) -> WebhookReceiverUpdate<'_>
fn webhook_receiver_update(&self) -> WebhookReceiverUpdate<'_>
Update webhook receiver
Note that receiver secrets are NOT added or removed using this endpoint.
Instead, use the /v1/webhooks/{secrets}/?receiver={receiver}
endpoint
to add and remove secrets.
Sends a PUT
request to /v1/webhook-receivers/{receiver}
Arguments:
receiver
: The name or ID of the webhook receiver.body
let response = client.webhook_receiver_update()
.receiver(receiver)
.body(body)
.send()
.await;
Sourcefn webhook_secrets_list(&self) -> WebhookSecretsList<'_>
fn webhook_secrets_list(&self) -> WebhookSecretsList<'_>
List webhook receiver secret IDs
Sends a GET
request to /v1/webhook-secrets
Arguments:
receiver
: The name or ID of the webhook receiver.
let response = client.webhook_secrets_list()
.receiver(receiver)
.send()
.await;
Sourcefn webhook_secrets_add(&self) -> WebhookSecretsAdd<'_>
fn webhook_secrets_add(&self) -> WebhookSecretsAdd<'_>
Add secret to webhook receiver
Sends a POST
request to /v1/webhook-secrets
Arguments:
receiver
: The name or ID of the webhook receiver.body
let response = client.webhook_secrets_add()
.receiver(receiver)
.body(body)
.send()
.await;
Sourcefn webhook_secrets_delete(&self) -> WebhookSecretsDelete<'_>
fn webhook_secrets_delete(&self) -> WebhookSecretsDelete<'_>
Remove secret from webhook receiver
Sends a DELETE
request to /v1/webhook-secrets/{secret_id}
Arguments:
secret_id
: ID of the secret.
let response = client.webhook_secrets_delete()
.secret_id(secret_id)
.send()
.await;