Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

Create or replace service autoscaling schedule

Beta
POST/v1/organizations/{organizationId}/services/{serviceId}/scalingSchedule

Disclaimer: This beta endpoint is evolving; the API contract may change.

Creates or fully replaces the autoscaling schedule for a service. Pass an empty entries array to clear the schedule — a subsequent GET will return 404, and the response will contain an empty baseConfig (all fields absent). The base scaling config (applied when no entry is active) is managed separately via the replicaScaling endpoint. Requires the scheduled autoscaling feature to be enabled for the organization.

Authorizations

Path parameters

  • organizationIdstringrequired

    ID of the organization that owns the service.

    format: uuid
  • serviceIdstringrequired

    ID of the service.

    format: uuid

Request bodyJSON

  • entriesarray ofobjectrequired

    List of schedule entries. Pass an empty array to clear the schedule.

    12 properties
    • namestringrequired

      Human-readable label for this schedule entry.

      Example: "Business hours"
    • weekdaysarray ofintegerrequired

      Days of the week this entry applies to. 0 = Sunday, 1 = Monday, …, 6 = Saturday.

      Example: [1,2,3,4,5]
    • startHourUtcintegerrequired

      UTC hour (0–23) when this entry becomes active (inclusive).

      maximum: 23, minimum: 0
      Example: 9
    • endHourUtcintegerrequired

      UTC hour (1–24) when this entry deactivates (exclusive). Must differ from startHourUtc. Set to 24 to end at midnight. Values less than startHourUtc create an overnight window spanning midnight.

      maximum: 24, minimum: 1
      Example: 17
    • autoscalingModeoptionalverticalorhorizontal

      Autoscaling mode for this entry. "vertical" (the default when omitted) runs a fixed replica count while memory scales between minReplicaMemoryGb and maxReplicaMemoryGb; "horizontal" scales the replica count between minReplicas and maxReplicas at a fixed per-replica memory (minReplicaMemoryGb equal to maxReplicaMemoryGb). Horizontal requires the feature to be enabled for the organization.

      Example: "vertical"
    • minReplicaMemoryGboptionalnumber

      Minimum memory per replica (Gb). Optional for vertical entries — provide both bounds for a memory range, or omit both to inherit memory from the base scaling config. Required for horizontal (both bounds, equal to maxReplicaMemoryGb — memory is fixed while the replica count scales). The upper bound is tier-dependent (lower for non-paid organizations) and enforced when the entry is applied.

      maximum: 356, minimum: 8
      Example: 16
    • maxReplicaMemoryGboptionalnumber

      Maximum memory per replica (Gb). Optional for vertical entries — provide both bounds for a memory range, or omit both to inherit memory from the base scaling config. Required for horizontal (both bounds, equal to minReplicaMemoryGb — memory is fixed while the replica count scales). The upper bound is tier-dependent (lower for non-paid organizations) and enforced when the entry is applied.

      maximum: 356, minimum: 8
      Example: 16
    • numReplicasoptionalinteger

      Fixed replica count for a vertical entry (autoscalingMode "vertical" or omitted). Mutually exclusive with minReplicas/maxReplicas. The per-service replica maximum is variable (tier-dependent, configurable per service) and enforced when the entry is applied, not at request time.

      minimum: 1
      Example: 3
    • minReplicasoptionalinteger

      Minimum number of replicas. A minReplicas/maxReplicas band scales the replica count in a horizontal entry (autoscalingMode "horizontal"); when autoscalingMode is omitted or "vertical", an equal band (minReplicas === maxReplicas) is instead an accepted vertical fixed count and needs no horizontal entitlement. Must be provided together with maxReplicas. The per-service replica maximum is variable (tier-dependent, configurable per service) and enforced when the entry is applied, not at request time.

      minimum: 1
      Example: 2
    • maxReplicasoptionalinteger

      Maximum number of replicas. A minReplicas/maxReplicas band scales the replica count in a horizontal entry (autoscalingMode "horizontal"); when autoscalingMode is omitted or "vertical", an equal band (minReplicas === maxReplicas) is instead an accepted vertical fixed count and needs no horizontal entitlement. Must be provided together with minReplicas. The per-service replica maximum is variable (tier-dependent, configurable per service) and enforced when the entry is applied, not at request time.

      minimum: 1
      Example: 3
    • idleScalingoptionalboolean

      Whether idle scaling is enabled during this window.

    • idleTimeoutMinutesoptionalinteger

      Idle timeout in minutes during this window.

Response

JSON

200

Successful response

JSON
  • statusoptionalnumber

    HTTP status code.

    Example: 200
  • requestIdoptionalstring

    Unique id assigned to every request. UUIDv4

    format: uuid
  • resultoptionalobject
    3 properties
    • entriesarray ofobjectrequired

      List of schedule entries.

      13 properties
      • idstringrequired

        Unique identifier for this schedule entry.

        format: uuid
      • namestringrequired

        Human-readable label for this schedule entry.

      • weekdaysarray ofintegerrequired

        Days of the week this entry applies to. 0 = Sunday, 1 = Monday, …, 6 = Saturday.

      • startHourUtcintegerrequired

        UTC hour (0–23) when this entry becomes active (inclusive).

        maximum: 23, minimum: 0
      • endHourUtcintegerrequired

        UTC hour (1–24) when this entry deactivates (exclusive). Must differ from startHourUtc. Set to 24 to end at midnight. Values less than startHourUtc create an overnight window spanning midnight.

        maximum: 24, minimum: 1
      • autoscalingModeverticalorhorizontalrequired

        Autoscaling mode for this entry. "vertical" runs a fixed replica count while memory scales; "horizontal" scales the replica count at a fixed per-replica memory. Defaults to "vertical" for entries persisted before the mode was exposed.

      • isActiveNowbooleanrequired

        Whether this entry is currently active. Scheduled times are indicative — actions are applied on a best-effort basis and may be delayed by a few minutes.

      • minReplicaMemoryGboptionalnumber

        Minimum memory per replica (Gb) during this window. A range in vertical; in horizontal it equals maxReplicaMemoryGb (memory is fixed while the replica count scales).

      • maxReplicaMemoryGboptionalnumber

        Maximum memory per replica (Gb) during this window. A range in vertical; in horizontal it equals minReplicaMemoryGb (memory is fixed while the replica count scales).

      • minReplicasoptionalinteger

        Minimum number of replicas during this window. For a horizontal entry the replica count scales between minReplicas and maxReplicas; for a vertical entry minReplicas and maxReplicas are equal and report the fixed replica count (both omitted when the entry stored no count).

      • maxReplicasoptionalinteger

        Maximum number of replicas during this window. For a horizontal entry the replica count scales between minReplicas and maxReplicas; for a vertical entry minReplicas and maxReplicas are equal and report the fixed replica count (both omitted when the entry stored no count).

      • idleScalingoptionalboolean

        Whether idle scaling is enabled during this window.

      • idleTimeoutMinutesoptionalinteger

        Idle timeout in minutes during this window.

    • baseConfigobjectrequired
      7 properties
      • autoscalingModeoptionalverticalorhorizontal

        Autoscaling mode applied when no schedule entry is active. "vertical" runs a fixed replica count while memory scales; "horizontal" scales the replica count at a fixed per-replica memory.

      • minReplicaMemoryGboptionalnumber

        Minimum memory per replica (Gb) when no schedule entry is active. Absent for services that do not autoscale memory.

      • maxReplicaMemoryGboptionalnumber

        Maximum memory per replica (Gb) when no schedule entry is active. Absent for services that do not autoscale memory.

      • minReplicasoptionalinteger

        Minimum number of replicas when no schedule entry is active.

      • maxReplicasoptionalinteger

        Maximum number of replicas when no schedule entry is active.

      • idleScalingoptionalboolean

        Whether idle scaling is enabled when no schedule entry is active.

      • idleTimeoutMinutesoptionalinteger

        Idle timeout in minutes when no schedule entry is active.

    • activeEntryIdoptionalstring

      ID of the currently-active schedule entry. Absent when no entry is active and the base config is in effect.

      format: uuid
Navigation