Drafts, revisions and deployments¶
ConceptExplains how it works and why.
Apinx separates editing from serving. Everything you change goes into a draft; only a deployment changes what callers get.
The draft¶
The draft is the working copy of the whole configuration: listeners, upstreams, APIs and their operations, policies, shared flows, flow hooks, products. The console, the Admin API, the CLI and imported files all edit the draft. Every edit is validated on its own (unknown policy types, missing references, invalid settings) and audited.
The banner "N undeployed changes" counts what differs between the draft and what is deployed; Review changes shows the exact diff.
Units and revisions¶
Deployments are per unit:
| Unit | Contains | Revisions on |
|---|---|---|
| Each API | its settings, operations, own policies and attached shared flows | the API's Revisions tab |
| The environment configuration | listeners, upstreams, shared flows, flow hooks, global and environment policies, products | Deployments → Environment configuration |
Deploying a unit compiles it with everything it depends on, validates the result, and stores an immutable revision with your message, the author and the time. The gateway swaps the new configuration in atomically: no dropped requests, no restart.
Deploying¶
- Deploy all changes (Deployments page): every changed unit gets a new revision at once.
- Deploy draft on one API: only that API changes; other APIs keep serving their revisions.
- Save revision only: record the revision without deploying it, for later.
apinxctl publish -m "message"from the terminal.
An invalid draft cannot be deployed; the page lists each problem with the object, the field and the rule.
With several instances over one database (High availability),
a deployment made on any instance is applied by every other one within cluster.watch_interval
(two seconds by default); the Deployments page is the same on each.
Rolling back¶
- API → Revisions → Deploy an older revision: that API returns to it; the draft is kept.
- Deployments → History → Restore a past deployment: every unit returns to what it was then, and the draft is restored from it (with a typed confirmation).
apinxctl rollback <sequence>.
Rollback is a pointer change; no recompilation of anything else.
Rejecting a change¶
A change in the draft does not have to be deployed. Discard puts the unit's draft back to what is live; nothing live changes:
- Deployments → Waiting to go live → Discard changes on one item. Show changes first shows exactly what would be dropped. A never-deployed API is deleted from the draft; an API deleted in the draft is restored as deployed.
- Discard everything: the whole draft equals what is live, with a typed confirmation.
- API → Revisions → Discard draft changes does the same for that API.
POST /api/v1/apis/{id}/discard,POST /api/v1/environment/discard,POST /api/v1/draft/discard.
A discard is refused when it would leave the draft invalid in a new way: discarding the shared configuration while an API in the draft uses an upstream or shared flow that exists only in the draft names that API, so deploy or discard the API first. Every discard is audited.
What deploying does not change¶
Consumer data changes immediately, without a deployment: applications, API keys, allowed sources, subscriptions and their approvals, users. That is deliberate: revoking a key or suspending a subscription must not wait for a release.
Configuration as code¶
The draft exports as one apinx/v1 YAML document and imports back; importing your own export
changes nothing. Keep it in a repository and deploy from CI with the CLI: see
Configuration as code.