Skip to content

HTTP/API plugins

HTTP plugins run from the controller. They are useful for health checks, API calls and deployment gates.

network.http.request

Runs an HTTP request and returns status, body and headers.

- id: call_api
  use: network.http.request
  with:
    method: POST
    url: "https://api.example.com/deploy"
    headers:
      Authorization: "Bearer {{ secrets.api_token }}"
      Content-Type: application/json
    json:
      version: "{{ vars.version }}"
    timeout: 30
  register:
    api_status: data.status

network.http.check

Fails immediately unless the HTTP response matches the expected condition.

- id: assert_health
  use: network.http.check
  with:
    url: "http://{{ server.host }}:8080/health"
    status: 200
    contains: ok
    timeout: 10

network.http.wait

Polls until the HTTP endpoint matches or timeout expires.

- id: wait_health
  use: network.http.wait
  with:
    url: "http://{{ server.host }}:8080/health"
    status: 200
    contains: ok
    timeout: 120
    interval: 5