Skip to main content

Module traffic

Module traffic 

Source
Expand description

gtc op traffic {set,show,rollback} (A3).

Manages Environment.traffic_splits: Vec<TrafficSplit>. Each split is per-deployment_id. The CLI accepts percentages or basis points and validates the entries sum to exactly 10,000 bps via TrafficSplit::validate.

Rollback: the prior TrafficSplit is stashed inline under previous_split_ref using the inline://<base64> token scheme from greentic_deploy_spec::engine::inline_stash so rollback works without a sidecar history file. Multi-step history is A8’s contract.

In-process router wiring (the RevisionDispatcher in greentic-start) is Phase B. A3 only mutates the spec object; making it observable in the live runtime is a separate gate.

Structs§

TrafficSetEntryPayload
TrafficSetPayload
TrafficShowPayload
TrafficSummary
TrafficSummaryEntry

Functions§

payload_from_set_args
Build a TrafficSetPayload from clap-derived args.
payload_from_target_args
Build a TrafficShowPayload for op traffic show and op traffic rollback. Same fallthrough semantics as payload_from_set_args.
rollback
set
op traffic set. Replaces the entire entries list for one deployment. Validates sum == 10,000 bps before saving. Stashes the prior split for one-step rollback.
show