Class ConnectionBodies

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

public final class ConnectionBodies extends Object
Assembles a complete Fabric connection body from a PlannedConnection - both endpoints, encapsulation, and cloud authorization - so a live dry-run or a real create sends the whole request the API needs, not the endpoint-less name + bandwidth shell that Fabric rejects with EQ-3142501 "Null value for aSide access point".

A provider connection is Cloud Router → service profile: its A-side is the Fabric Cloud Router (by uuid - the thing that does not exist at PLAN time, so its uuid is passed in by the caller once the router is real), and its Z-side is the cloud provider, carrying the service-profile uuid, the customer authorization key, the seller region and (for Azure) the peering type, all read off the planned connection. A backbone link is Cloud Router → Cloud Router.

This is the single home of the connection-body shape so the plan-time lens-3b dry-run (against a pre-existing endpoint) and the execution-time lens-3a pre-flight + real create (against a just-provisioned router) build identical bodies. The returned builder is left un-terminated: the caller chains .dryRun().create() to validate, or .create() to provision.

  • Method Details

    • authenticationKeyLabel

      public static String authenticationKeyLabel(CloudProviderType type)
      A human-readable label for the cloud-specific authorization key a connection to the given provider requires. Backed by the documented per-provider key semantics (see CloudProviderConnectionAdapter.getAuthenticationKey()), it works with nothing but the provider type - no catalog fetch and no customer resources - so it is safe to show a brand-new customer exactly what to gather.
      Parameters:
      type - the cloud provider type; null tolerated
      Returns:
      the authorization-key label, never blank
    • resolveCloudType

      public static CloudProviderType resolveCloudType(String providerLabel)
      Resolves a Fabric provider label ("AWS", "Amazon Web Services", "Azure ExpressRoute", ...) to a CloudProviderType, falling back to CloudProviderType.OTHER for a label that matches no well-known provider (a third-party service profile).
      Parameters:
      providerLabel - the provider label; null/blank tolerated
      Returns:
      the resolved type, never null
    • cloudAdapter

      public static CloudProviderConnectionAdapter<?> cloudAdapter(PlannedConnection connection)
      Builds a cloud-provider Z-side adapter from a planned connection's resolved provider fields (service-profile uuid, authorization key, seller region, and Azure peering type). Uniform across every provider - the typed reference adapters differ only in these same fields plus the provider type and (Azure) peering, all of which this carries - so IBM and Alibaba, which have no dedicated adapter, still send their authorization key and seller region.
      Parameters:
      connection - the planned provider connection
      Returns:
      an adapter suitable for ConnectionOperator.ConnectionBuilder.zSideCloudProvider(CloudProviderConnectionAdapter, LinkProtocol)
    • providerBody

      public static ConnectionOperator.ConnectionBuilder providerBody(Connections connections, PlannedConnection connection, String aSideRouterUuid)
      Assembles a provider connection body against a to-be-created (or already existing) Cloud Router identified by uuid. Used by the execution-time pre-flight + real create once the router uuid is known, and by the plan-time lens-3b dry-run when the caller supplies an existing Cloud Router.
      Parameters:
      connections - the Fabric connections client
      connection - the planned provider connection
      aSideRouterUuid - the real Cloud Router uuid to use as the A-side
      Returns:
      an un-terminated builder; chain .dryRun().create() or .create()
    • providerBody

      public static ConnectionOperator.ConnectionBuilder providerBody(Connections connections, PlannedConnection connection, String aSideRouterUuid, String liveRedundancyGroup)
      As providerBody(Connections, PlannedConnection, String), with the redundancy group Fabric assigned to the PRIMARY of this connection's group. Fabric assigns the group id when the primary is created; a SECONDARY must send that id (spec ConnectionRedundancy.group; the Terraform provider documents the same: use the primary's redundancy.0.group). The plan's own zSideRedundancyGroup is only an SDK-side token pairing the two and is never sent.
      Parameters:
      connections - the Fabric connections client
      connection - the planned provider connection
      aSideRouterUuid - the real Cloud Router uuid to use as the A-side
      liveRedundancyGroup - the primary's live group id (required for a SECONDARY; ignored otherwise)
      Returns:
      an un-terminated builder; chain .dryRun().create() or .create()
    • providerBodyOnPort

      public static ConnectionOperator.ConnectionBuilder providerBodyOnPort(Connections connections, PlannedConnection connection, String aSidePortUuid)
      Assembles a provider connection body against a pre-existing customer port as the A-side (lens 3b: the endpoint is real, so the connection can be dry-run at PLAN time).
      Parameters:
      connections - the Fabric connections client
      connection - the planned provider connection
      aSidePortUuid - the existing customer port uuid to use as the A-side
      Returns:
      an un-terminated builder; chain .dryRun().create() or .create()
    • providerBodyOnPort

      public static ConnectionOperator.ConnectionBuilder providerBodyOnPort(Connections connections, PlannedConnection connection, String aSidePortUuid, String liveRedundancyGroup)
      Parameters:
      connections - the Fabric connections client
      connection - the planned provider connection
      aSidePortUuid - the existing customer port uuid to use as the A-side
      liveRedundancyGroup - the primary's live group id (required for a SECONDARY; ignored otherwise)
      Returns:
      an un-terminated builder; chain .dryRun().create() or .create()
    • backboneBody

      public static ConnectionOperator.ConnectionBuilder backboneBody(Connections connections, PlannedConnection connection, String aSideRouterUuid, String zSideRouterUuid)
      Assembles a backbone link body (Cloud Router to Cloud Router). Both router uuids must be known, so this is used at execution time once Phase 1 has provisioned the routers.
      Parameters:
      connections - the Fabric connections client
      connection - the planned backbone connection
      aSideRouterUuid - the A-side Cloud Router uuid
      zSideRouterUuid - the Z-side Cloud Router uuid
      Returns:
      an un-terminated builder; chain .dryRun().create() or .create()