Event Readiness
Event Readiness plans scheduled capacity changes for an upcoming event — a marketing launch, a sale, a load-test window — by driving cloud-native autoscaling groups (AWS ASG, GCP MIG, Azure VMSS) to a larger min / max / desired for the duration of the event and rolling them back when the event ends. Each plan wraps one or more autoscaler policies as targets.
What Event Readiness is not
Create a Plan
/orgs/{orgID}/event-readinessCreate a plan with one or more autoscaler-policy targets.
curl -X POST https://zopnight.com/api/orgs/{orgID}/event-readiness \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Spring campaign launch",
"description": "Marketing burst on checkout + web tiers",
"eventStart": "2026-05-02T13:00:00Z",
"eventEnd": "2026-05-02T21:00:00Z",
"preScaleMinutes": 30,
"postEventMinutes": 30,
"expectedMultiplier": 3.0,
"timezone": "America/New_York",
"targets": [
{ "policyId": "asp_checkout" },
{ "policyId": "asp_web" }
]
}'{
"data": {
"id": "evt_abc123",
"orgId": "org_xyz",
"name": "Spring campaign launch",
"eventStart": "2026-05-02T13:00:00Z",
"eventEnd": "2026-05-02T21:00:00Z",
"preScaleMinutes": 30,
"postEventMinutes": 30,
"expectedMultiplier": 3.0,
"timezone": "America/New_York",
"status": "draft",
"targets": [
{ "policyId": "asp_checkout", "originalMin": 2, "originalMax": 10, "originalDesired": 2 },
{ "policyId": "asp_web", "originalMin": 3, "originalMax": 12, "originalDesired": 3 }
],
"createdAt": "2026-04-20T12:00:00Z"
}
}Supported target types
aws:asg— EC2 Auto Scaling Groupgcp:mig— Managed Instance Groupazure:vmss— Virtual Machine Scale Set
Calculate Scaled Capacity
/orgs/{orgID}/event-readiness/calculatePreview what min/max/desired ZopNight will drive a policy to, without persisting a plan. Used by the creation wizard.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
policy_id | string | Autoscaler policy to size (required) |
multiplier | float | Explicit load multiplier — e.g. 3.0 for 3x current traffic |
expected_requests | integer | Alternative to multiplier: expected peak RPS, derived against current activity-log signal |
{
"data": {
"scaledMin": 6,
"scaledMax": 30,
"scaledDesired": 12,
"multiplier": 3.0,
"method": "multiplier",
"isEstimated": false
}
}method is either multiplier (when multiplier was supplied directly) or absolute (when the size was derived from expected_requests). When CPU metrics are unavailable the calculator falls back to conservative defaults (50% average, 70% target) and returns isEstimated: true with an estimationReason.
/orgs/{orgID}/event-readiness/calculate-dbVariant of /calculate for database-style targets. Returns the recommended instance class step-up (e.g. db.r6g.large → db.r6g.2xlarge).
Preview Before Save
The wizard's "Review" step calls preview-readiness to render an end-to-end snapshot — every target's current size, the calculated scaled size, and the timestamps the executor will use — before the plan is persisted.
/orgs/{orgID}/event-readiness/preview-readinessPreview the full plan without persisting it.
curl -X POST https://zopnight.com/api/orgs/{orgID}/event-readiness/preview-readiness \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"eventStart": "2026-05-02T13:00:00Z",
"eventEnd": "2026-05-02T21:00:00Z",
"preScaleMinutes": 30,
"postEventMinutes": 30,
"expectedMultiplier": 3.0,
"targets": [{ "policyId": "asp_checkout" }]
}'DB Impact & Cost Estimate
On the saved plan, two further endpoints surface estimated impact for the review screen and the audit trail.
/orgs/{orgID}/event-readiness/{eventID}/db-impactPer-target estimate of the database tier change (CPU, RAM, IOPS deltas). Returns empty when the plan has no DB-style targets.
/orgs/{orgID}/event-readiness/{eventID}/cost-estimateEstimated extra cost incurred by the plan, derived from per-target hours scaled multiplied by the on-demand price for the scaled-up size.
{
"data": {
"currency": "USD",
"estimatedExtraCost": 142.30,
"perTarget": [
{ "policyId": "asp_checkout", "extraCost": 92.10 },
{ "policyId": "asp_web", "extraCost": 50.20 }
]
}
}/orgs/{orgID}/event-readiness/{eventID}/readiness-checkOn-demand readiness check that re-validates target capacity, credentials, and the executor queue. Used by the dashboard to surface red/green chips on each plan.
Schedule & Cancel
/orgs/{orgID}/event-readiness/{eventID}/scheduleDispatch the plan. Intents are pushed to the executor, which calls the cloud-native scaling API at eventStart - preScaleMinutes and rolls back at eventEnd + postEventMinutes.
{
"message": "event scheduled",
"eventId": "evt_abc123"
}/orgs/{orgID}/event-readiness/{eventID}/cancelCancel an active event and push cancel intents to the executor. Any scale-ups already applied are rolled back to the stored original min/max/desired.
Status Lifecycle
The plan moves through a well-defined state machine as the executor reports progress via an internal status callback.
| Status | Meaning |
|---|---|
draft | Plan created but not scheduled yet. Fully editable. |
scheduling | schedule endpoint called; intents being pushed to executor. |
scheduled | Executor has accepted the intents and registered the timed actions. |
scaling_up | Pre-scale window hit; executor is calling the cloud scaling API. |
active | Event window in progress; targets are held at scaled min/max/desired. |
scaling_down | Post-event window hit; executor is restoring original capacity. |
completed | Rollback finished; plan is inert. |
cancelled | Plan cancelled from any schedulable state. |
failed | Executor or provider call failed. Retry by transitioning back to draft/scheduling. |
Valid transitions:draft → scheduling / cancelled; scheduling → scheduled / failed / cancelled; scheduled → scaling_up / cancelled / failed; scaling_up → active / failed / cancelled; active → scaling_down / failed / cancelled; scaling_down → completed / failed / cancelled; failed → draft / scheduling / cancelled; completed → draft / cancelled.
List & Inspect
/orgs/{orgID}/event-readinessList plans with status/search filters and pagination (page, limit ≤ 100).
/orgs/{orgID}/event-readiness/countCount plans (supports status and search filters).
/orgs/{orgID}/event-readiness/filtersDistinct filter values (statuses) for building UIs.
/orgs/{orgID}/event-readiness/{eventID}Get a single plan with full target detail.
/orgs/{orgID}/event-readiness/{eventID}Update a plan (partial update). Only safe while the plan is still schedulable.
/orgs/{orgID}/event-readiness/{eventID}Soft-delete a plan. If the plan is in a schedulable state, a cancel is pushed to the executor first.
/orgs/{orgID}/event-readiness/{eventID}/logsPaginated audit log of status transitions and executor callbacks for this plan.
Scaling intents are dispatched by the same executor that handles Start/Stop schedules — see Schedules for how the executor queue and retry semantics work.