Files
ironic/releasenotes/notes/add-api-call-inspection-action-985aee4347ed9217.yaml
minwooseo a986fbdcb9 Add api-call action for ironic inspection rule
This patch introduces a new rule action plugin, `api-call`, to trigger
a webhook (via HTTP GET) when rule matching completes successfully.
It enables external integrations like alerts or automation triggers.

This feature supports:
- Timeout configuration (default: 5 seconds)
- Automatic retry with backoff (default: 3 times, backoff factor 0.3)
- Optional custom headers and proxy settings

Retry is applied for HTTP status codes: 429, 500, 502, 503, 504.

This continues the effort initially reviewed in ironic-inspector:
https://review.opendev.org/c/openstack/ironic-inspector/+/942968

New rule usage example:

[
  {
    "description": "Trigger webhook after introspection",
    "actions": [
      {
        "action": "api-call",
        "url": "http://example.com/hook",
        "timeout": 10,
        "retries": 5,
        "backoff_factor": 1
      }
    ]
  }
]

Change-Id: I59e14ef77430477fe029f35e157d70d4af307ac1
2025-06-19 12:43:11 +09:00

37 lines
1.1 KiB
YAML

---
features:
- |
Added a new 'api-call' action plugin for Ironic inspection rules.
This action allows triggering an HTTP GET request to a given URL when a
rule matches successfully during node inspection. It is useful for
integrating with external systems such as webhooks, alerting, or
automation tools.
The following options are supported:
* url (required): The HTTP endpoint to call
* timeout (optional, default: 5): Timeout in seconds
* retries (optional, default: 3): Number of retries on failure
* backoff_factor (optional, default: 0.3): Delay factor for retry attempts
* headers, proxies (optional): Additional request configuration
Retry applies to status codes 429, 500, 502, 503, and 504.
Example rule::
[
{
"description": "Trigger webhook after node inspection",
"actions": [
{
"action": "api-call",
"url": "http://example.com/hook",
"timeout": 10,
"retries": 5,
"backoff_factor": 1
}
]
}
]