Class RouterBodies

java.lang.Object
com.eqixiac.equinix.design.optimizer.wizard.model.RouterBodies

public final class RouterBodies extends Object
Assembles a complete Fabric Cloud Router body from a PlannedCloudRouter - name, metro, package, the optional account/project references, and the mandatory notification recipients - mirroring ConnectionBodies for connections.

This is the single home of the router-create body shape, so the plan-time Layer 2 dry-run (PlanValidator.routerDryRun, POST /routers?dryRun=true) and the execution-time Phase 1 real create (DeploymentPlan.execute()) send the exact same wire body - the only difference the caller adds is .dryRun(). Before this helper existed the two call sites drifted: the dry-run stamped notifications (which Fabric MANDATES - a router POSTed without one is rejected with HTTP 400 EQ-3040013) and guarded null account/project references, while the real create did neither - so a green dry-run was followed by every real create failing. Both paths now converge here.

The returned builder is left un-terminated: chain .dryRun().create() to validate, or .create() to provision.

  • Method Details

    • routerBody

      public static CloudRouterOperator.CloudRouterBuilder routerBody(CloudRouters routers, PlannedCloudRouter planned)
      Assembles the Cloud Router create body for the given planned router. Null account number and project id are omitted (never sent as null-valued references), and every non-blank notification email is stamped as one ALL-type notification - the field Fabric mandates (EQ-3040013).
      Parameters:
      routers - the Fabric Cloud Routers client
      planned - the planned Cloud Router
      Returns:
      an un-terminated builder; chain .dryRun().create() or .create()
    • usableNotificationEmails

      public static List<String> usableNotificationEmails(PlannedCloudRouter planned)
      The planned router's non-blank notification recipients, in declared order. Empty when the plan carries none - the caller (validator or executor) is responsible for having flagged that upstream, because Fabric rejects a notification-less router (EQ-3040013).
      Parameters:
      planned - the planned Cloud Router
      Returns:
      the usable notification emails, never null