Class DeploymentPlan
Plan as data
A plan is an immutable value. Every planned resource carries a stable logical key derived from
the design (for example router/DC, connection/DC/aws, backbone/DC-NY,
connection/DC/aws/rp/BGP), so the same design produces the same keys whatever the name
prefix. The plan records the DesignSpec fingerprint it was derived from
(getSpecFingerprint()), and planId() is a hash of what it would build. It
round-trips through JSON (toJson(), fromJson(String), save(Path),
load(Path)); a loaded plan has no Fabric client until withFabric(FabricGateway) binds one.
Lifecycle
DeploymentPlan plan = fabric.deploymentWizard(result).projectId(project).notifications("noc@example.com").plan();
plan.save(Path.of("plan.json"));
PlanDiff drift = plan.diff(); // read-only
DeploymentOutcome out = plan.reconcile(inputs, ExecutionOptions.defaults(),
new FileCheckpointStore(Path.of(".checkpoints"))); // creates only what is missing
execute(ExecutionInputs, ExecutionOptions) provisions the whole plan in one run;
reconcile(ExecutionInputs, ExecutionOptions, CheckpointStore) reads live state first, adopts what exists, creates the rest and checkpoints
after every step, so it can be re-run after a crash or abort without creating duplicates. Both
follow one failure policy (ExecutionOptions.failurePolicy): abort and roll back by default,
or continue and report partial state. See PlanExecutor.
Beta. multicloudLinks are native provider-to-provider links between two clouds,
which use no Equinix resource. The plan carries and prices them; execution never provisions them,
totalResourceCount() excludes them, and their cost is never part of the Equinix totals.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondiff()Compares the plan with live Fabric state (read-only): one verdict per planned resource (MISSING,PRESENT_MATCHING,PRESENT_DIFFERENTwith the differing fields,UNREADABLE,NOT_EXECUTABLE) and the live resources that carry the plan's marker but are not in it.diff(CheckpointStore store) Asdiff(), also matching resources by the uuids recorded in a checkpoint store.dryRun()Re-runs the layered plan-time validation (structural and catalog checks, live Cloud Router dry-run, connection endpoint dispatch) and returns a new plan with the refreshed status.The deployment name, orplan-<planId>for a hand-built plan that has none.execute()Executes the plan with no customer inputs and default options.execute(ExecutionInputs inputs) Executes the plan with default options.execute(ExecutionInputs inputs, ExecutionOptions options) Provisions the whole plan in one run (no live-state read; usereconcile(ExecutionInputs, ExecutionOptions, CheckpointStore)for an idempotent, resumable run).static DeploymentPlanParses a plan document written bytoJson().The id as a bean property, so it is written into the plan document.The plan document format version.The Fabric Interconnects on the plan, nevernull.static DeploymentPlanReads a plan from a file written bysave(Path).The native multicloud links on the plan, nevernull.planId()The plan's content identity: a hash of what it would build (resources, Interconnects, native links, deployment name, prefix, project, spec fingerprint), not of pricing or validation state.reconcile(ExecutionInputs inputs, ExecutionOptions options, CheckpointStore store) Brings live state to the plan, creating only what is missing and checkpointing after every step; seePlanExecutor.reconcile(DeploymentPlan, ExecutionInputs, ExecutionOptions, CheckpointStore).rollback(DeploymentOutcome outcome) Removes what an earlier run created: connections first, each polled toDEPROVISIONEDor 404 within the default delete timeout, then the Cloud Routers whose connections are all gone.rollback(DeploymentOutcome outcome, ExecutionOptions options) Asrollback(DeploymentOutcome)with explicit timeouts, poll interval and clock.voidWrites this plan to a file (atomically).toJson()This plan as an indented JSON document, includingplanIdandschemaVersion.A full Markdown report: identity, validation state, required inputs, every planned resource, native links, Interconnects, cost estimate and execution order.A concise plain-text summary.intTotal number of resources execution creates: Cloud Routers, provider connections, backbone links and routing protocols.Begins a value-realization assessment of this plan: declare your per-provider monthly egress volumes and get back the egress savings the plan's private interconnects produce.withFabric(FabricGateway fabric) This plan with a Fabric client bound (needed afterload(Path)before any live call).
-
Constructor Details
-
DeploymentPlan
public DeploymentPlan()
-
-
Method Details
-
planId
The plan's content identity: a hash of what it would build (resources, Interconnects, native links, deployment name, prefix, project, spec fingerprint), not of pricing or validation state.- Returns:
- 16 lowercase hex characters
- See Also:
-
getSchemaVersion
-
getPlanId
-
effectiveDeploymentName
The deployment name, orplan-<planId>for a hand-built plan that has none. Checkpoints and connection markers use this value.- Returns:
- a non-null deployment identity
-
multicloudLinksOrEmpty
The native multicloud links on the plan, nevernull.- Returns:
getMulticloudLinks(), or an empty list when that isnull
-
interconnectsOrEmpty
The Fabric Interconnects on the plan, nevernull.- Returns:
getInterconnects(), or an empty list when that isnull
-
totalResourceCount
public int totalResourceCount()Total number of resources execution creates: Cloud Routers, provider connections, backbone links and routing protocols. Native multicloud links and Interconnects are excluded.- Returns:
- the count
-
toSummary
-
toMarkdown
A full Markdown report: identity, validation state, required inputs, every planned resource, native links, Interconnects, cost estimate and execution order.- Returns:
- Markdown
-
toJson
This plan as an indented JSON document, includingplanIdandschemaVersion.- Returns:
- JSON
-
fromJson
Parses a plan document written bytoJson().- Parameters:
json- the document- Returns:
- the plan, with no Fabric client bound
- Throws:
IllegalArgumentException- when unreadable or when itsplanIddoes not match its content
-
save
Writes this plan to a file (atomically).- Parameters:
file- the destination
-
load
Reads a plan from a file written bysave(Path).- Parameters:
file- the file- Returns:
- the plan, with no Fabric client bound
-
withFabric
This plan with a Fabric client bound (needed afterload(Path)before any live call).- Parameters:
fabric- the Fabric client- Returns:
- a copy bound to
fabric
-
valueRealization
Begins a value-realization assessment of this plan: declare your per-provider monthly egress volumes and get back the egress savings the plan's private interconnects produce.- Returns:
- a
PlanValueAssessmentbuilder for declaring egress volumes
-
dryRun
Re-runs the layered plan-time validation (structural and catalog checks, live Cloud Router dry-run, connection endpoint dispatch) and returns a new plan with the refreshed status. Nothing is provisioned. A live step that cannot be attempted is recorded as a skipped validation with a reason; only a genuine rejection is an error. On a loaded plan (no source optimization) the new-market checks that need the optimizer's recommendations are not run.- Returns:
- a new plan with refreshed validity, deferred and skipped validations, and required inputs
-
diff
Compares the plan with live Fabric state (read-only): one verdict per planned resource (MISSING,PRESENT_MATCHING,PRESENT_DIFFERENTwith the differing fields,UNREADABLE,NOT_EXECUTABLE) and the live resources that carry the plan's marker but are not in it.- Returns:
- the diff
- Throws:
IllegalStateException- when no Fabric client is bound
-
diff
Asdiff(), also matching resources by the uuids recorded in a checkpoint store.- Parameters:
store- the checkpoint store, ornull- Returns:
- the diff
- Throws:
IllegalStateException- when no Fabric client is bound
-
execute
Executes the plan with no customer inputs and default options. Seeexecute(ExecutionInputs, ExecutionOptions).- Returns:
- the outcome
-
execute
Executes the plan with default options. Seeexecute(ExecutionInputs, ExecutionOptions).- Parameters:
inputs- the per-connection authorization keys, VLAN tags and Azure peering types- Returns:
- the outcome
-
execute
Provisions the whole plan in one run (no live-state read; usereconcile(ExecutionInputs, ExecutionOptions, CheckpointStore)for an idempotent, resumable run). Order, pre-flight, the failure policy and rollback are described onPlanExecutor. A provider connection that needs a cloud authorization key the plan and the inputs do not supply fails the run before anything is sent.- Parameters:
inputs- the customer inputs;nullmeans noneoptions- execution options;nullmeans defaults- Returns:
- the outcome, with every step, error and (after an abort) the rollback report
- Throws:
IllegalStateException- if the plan is not valid (the message lists the errors) or has no Fabric client
-
reconcile
public DeploymentOutcome reconcile(ExecutionInputs inputs, ExecutionOptions options, CheckpointStore store) Brings live state to the plan, creating only what is missing and checkpointing after every step; seePlanExecutor.reconcile(DeploymentPlan, ExecutionInputs, ExecutionOptions, CheckpointStore).- Parameters:
inputs- the customer inputs;nullmeans noneoptions- execution options (dry run, failure policy, opt-in updates);nullmeans defaultsstore- the checkpoint store;nullmeans a fresh in-memory store- Returns:
- the outcome
- Throws:
IllegalStateException- if the plan is not valid or has no Fabric client
-
rollback
Removes what an earlier run created: connections first, each polled toDEPROVISIONEDor 404 within the default delete timeout, then the Cloud Routers whose connections are all gone. Everything that could not be removed is listed as an orphan with its uuid.- Parameters:
outcome- the outcome ofexecute()orreconcile(ExecutionInputs, ExecutionOptions, CheckpointStore)- Returns:
- the rollback report
-
rollback
Asrollback(DeploymentOutcome)with explicit timeouts, poll interval and clock.- Parameters:
outcome- the outcome to undo;nullis a no-opoptions- timeouts, poll interval and clock- Returns:
- the rollback report
-