Register a new usage threshold alert

View as Markdown
Register a new usage threshold alert. Air calls UCP to register the alert, persists the returned alert id with the supplied recipients, and returns the full serialized instance. `threshold` is the org's remaining balance in compute hours at which UCP will fire the webhook; it must be at least `1` (a threshold of `0` is reserved for the balance-exhaustion shutdown flow). `recipients` must contain at least one valid email address; if the creator wants to be notified when the alert fires they must include their own email address in this list. If Air fails to persist the alert after UCP registration, the UCP alert is deleted compensatingly before the request surfaces an error. **Required role:** `air_org_admin`

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
thresholdintegerRequired1-21474836

Remaining balance (in compute hours) at which UCP will fire the webhook back to Air. Must be at least 1 (0 is reserved for the balance-exhaustion shutdown flow) and at most 21474836.

recipientslist of stringsRequired
Email addresses that should be notified when this alert is tripped. Must contain at least one valid email address.

Response

alert_idstringRead-onlyformat: "uuid"
The UUID UCP assigned to the alert when it was registered.
alert_typeenum

The UCP webhook event this alert is registered for.

  • USAGE_REMAINING_ALERT - USAGE_REMAINING_ALERT
  • USAGE_GRANT_THRESHOLD_REACHED - USAGE_GRANT_THRESHOLD_REACHED
  • USAGE_GRANT_EXHAUSTED - USAGE_GRANT_EXHAUSTED
  • CONTRACT_ENDED - CONTRACT_ENDED
thresholdintegerRead-only
Remaining balance in compute hours at which UCP will fire the webhook back to Air.
recipientslist of strings

Email addresses notified when UCP fires the webhook. Providing a value on update overwrites the existing recipients rather than appending to them; to add a new recipient include the existing recipients in the request as well.

last_fireddatetime or nullRead-only
When Air last dispatched an email for this alert, or null if it has never fired.
creatorstringRead-only
Email of the client that registered this alert.
org_display_namestringRead-only
Display name of the organization this alert belongs to.
ngc_org_namestringRead-only
NGC org name of the organization this alert belongs to.
org_nca_idstringRead-only
NCA id of the organization this alert belongs to.
createddatetimeRead-only
modifieddatetimeRead-only

Errors

400
Bad Request Error
403
Forbidden Error
500
Internal Server Error
502
Bad Gateway Error