API referenceSections

Replace the policy (server.manage)

Generated from the OpenAPI contract. Sessions send the CSRF header on writes; API keys use a Bearer token. Authentication

PUT /api/v1/tenants/{tid}/autoheal-policy

Replace the policy (server.manage)

Authentication: session cookie __Host-panel_session (contract default; see Authentication).

Parameters

NameInTypeRequiredDescription
tidpathstringrequired
X-CSRF-Tokenheaderstringoptional

Required on unsafe requests authenticated by session cookie; API keys do not use it.

Request body

required

Content type: application/json

What the panel does by itself with overloads (ADR 0091, 0092)

  • site_mode string required
    Allowed values: "off" "throttle" "recycle" "both"
  • internal_mode string optional

    The same for sites without a plan, the provider's own and a reseller's own (ADR 0122); absent is both

    Allowed values: "off" "throttle" "recycle" "both"
  • cpu_percent integer required
    • minimum 10
    • maximum 100
  • memory_mb integer required
    • minimum 128
    • maximum 65536
  • queue_active integer required

    Requests waiting with none served in the minute

    • minimum 1
    • maximum 10000
  • minutes integer required
    • minimum 2
    • maximum 60
  • throttle_percent integer required
    • minimum 5
    • maximum 90
  • recover_minutes integer required
    • minimum 2
    • maximum 120
  • cooldown_minutes integer required
    • minimum 1
    • maximum 120
  • max_per_hour integer required
    • minimum 1
    • maximum 20
  • services object required
Example
{
  "site_mode": "off",
  "internal_mode": "off",
  "cpu_percent": 10,
  "memory_mb": 128,
  "queue_active": 1,
  "minutes": 2,
  "throttle_percent": 5,
  "recover_minutes": 2,
  "cooldown_minutes": 1,
  "max_per_hour": 1,
  "services": {
    "database": {
      "cpu_percent": 0,
      "memory_mb": 0,
      "minutes": 2,
      "action": "alert"
    },
    "app": {
      "cpu_percent": 0,
      "memory_mb": 0,
      "minutes": 2,
      "action": "alert"
    },
    "cache": {
      "cpu_percent": 0,
      "memory_mb": 0,
      "minutes": 2,
      "action": "alert"
    }
  }
}

Responses

200 Saved

Content type: application/json

What the panel does by itself with overloads (ADR 0091, 0092)

Fields of AutoHealPolicy are shown above.

Example
{
  "site_mode": "off",
  "internal_mode": "off",
  "cpu_percent": 10,
  "memory_mb": 128,
  "queue_active": 1,
  "minutes": 2,
  "throttle_percent": 5,
  "recover_minutes": 2,
  "cooldown_minutes": 1,
  "max_per_hour": 1,
  "services": {
    "database": {
      "cpu_percent": 0,
      "memory_mb": 0,
      "minutes": 2,
      "action": "alert"
    },
    "app": {
      "cpu_percent": 0,
      "memory_mb": 0,
      "minutes": 2,
      "action": "alert"
    },
    "cache": {
      "cpu_percent": 0,
      "memory_mb": 0,
      "minutes": 2,
      "action": "alert"
    }
  }
}

default Error

Content type: application/json

  • code string required
  • message string required
  • details_redacted boolean required
  • correlation_id string required
  • retryable boolean required