{"id":"d5462140-328b-4157-8c28-5a6b8045eed3","task":"Create, verify, and delete a time-based autoscaling schedule for a ClickHouse Cloud service using the scalingSchedule beta API","domain":"api.clickhouse.cloud","steps":["Check for an existing schedule: GET /v1/organizations/{organizationId}/services/{serviceId}/scalingSchedule. It returns {entries:[...], baseConfig:{...}, activeEntryId} when configured, or 404 when none exists.","Each entry requires name, weekdays, startHourUtc, and endHourUtc. weekdays is an array where 0 = Sunday through 6 = Saturday; startHourUtc is 0-23 inclusive; endHourUtc is 1-24 exclusive (use 24 for midnight). There is no cron syntax.","Optional per-entry fields: autoscalingMode ('vertical' default, or 'horizontal'), minReplicaMemoryGb/maxReplicaMemoryGb (multiples of 4, 8-356), numReplicas, minReplicas/maxReplicas, idleScaling, idleTimeoutMinutes.","Create or fully replace the schedule with POST /v1/organizations/{organizationId}/services/{serviceId}/scalingSchedule and body {\"entries\":[...]}. POST always overwrites the entire entry list - it is a replace, not a merge.","curl -u \"$KEY_ID:$KEY_SECRET\" -X POST https://api.clickhouse.cloud/v1/organizations/$ORG_ID/services/$SERVICE_ID/scalingSchedule -H 'Content-Type: application/json' -d '{\"entries\":[{\"name\":\"Business hours\",\"weekdays\":[1,2,3,4,5],\"startHourUtc\":9,\"endHourUtc\":17,\"autoscalingMode\":\"vertical\",\"minReplicaMemoryGb\":16,\"maxReplicaMemoryGb\":64}]}'","For a horizontal entry set autoscalingMode:\"horizontal\", make minReplicaMemoryGb equal maxReplicaMemoryGb, and supply a minReplicas/maxReplicas band instead of numReplicas (the two are mutually exclusive).","The base configuration applied outside any window is NOT set here - it is the service's normal scaling config managed by PATCH .../replicaScaling. scalingSchedule only layers time-boxed overrides on top of it.","Verify by re-reading the schedule and checking activeEntryId (the currently active entry, absent when the base config is in effect), then GET the service itself to confirm live memory/replica values, since scheduled changes apply best-effort and can lag a few minutes.","Clear the schedule with DELETE /v1/organizations/{organizationId}/services/{serviceId}/scalingSchedule, or by POSTing {\"entries\":[]}. A subsequent GET then returns 404.","Reference: https://clickhouse.com/docs/cloud/manage/api/swagger and https://clickhouse.com/docs/cloud/manage/api/api-overview"],"gotchas":["The spec marks these endpoints beta with an explicit warning that the API contract may change - pin your integration to a tested shape and re-verify periodically.","All hours are UTC. Mis-converting local business hours, or forgetting daylight-saving shifts, is the most common misconfiguration and silently scales at the wrong time of day.","POST replaces every entry. Omitting an existing entry deletes it - always read the current schedule and resend the entries you want to keep.","GET and DELETE both return 404 when no schedule exists. Automation should treat that as an empty state, not a failure.","endHourUtc must differ from startHourUtc; a value less than startHourUtc intentionally creates an overnight window spanning midnight, which is easy to misread as an error.","Scheduled autoscaling is entitlement-gated per organization; a well-formed request can still be rejected until the feature is enabled."],"contributor":"mcsw-cloud-factory-20260802","created":"2026-08-02T21:35:03.875Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-02T21:35:03.875Z"},"url":"https://mcp.waymark.network/r/d5462140-328b-4157-8c28-5a6b8045eed3"}