Interface CloudProviderConnectionAdapter<T>
- Type Parameters:
T- the type of the cloud provider SDK object being adapted
- All Known Implementing Classes:
AwsDirectConnectAdapter,AzureExpressRouteAdapter,GoogleCloudInterconnectAdapter,OracleFastConnectAdapter
Cloud providers like AWS, Microsoft Azure, Google Cloud, and Oracle Cloud each have their own SDKs for managing direct connectivity (AWS Direct Connect, Azure ExpressRoute, Google Cloud Interconnect, Oracle FastConnect). This interface defines a contract that allows objects from those SDKs to supply the connection parameters needed by the Equinix Fabric API.
Design Pattern
This uses the Adapter Pattern to bridge the gap between cloud provider SDK
objects and the Equinix Fabric ConnectionOperator.ConnectionBuilder.
Implementors wrap a cloud provider object (e.g., an AWS Connection or Azure
ExpressRouteCircuit) and extract the fields required by Equinix's API:
getServiceProfileUuid()— The Equinix service profile for this cloud providergetAuthenticationKey()— The cloud provider's authentication key (e.g., AWS Account ID, Azure Service Key, GCP Pairing Key)getSellerRegion()— The cloud provider's region (e.g.,"us-east-1","eastus","us-east1")
Quick Start
Using a built-in reference adapter with AWS Direct Connect:
// Wrap an AWS Direct Connect connection object
AwsDirectConnectAdapter adapter = new AwsDirectConnectAdapter(
awsConnection, // AWS SDK Connection object
"equinix-aws-service-profile-uuid" // Equinix service profile for AWS
);
// Use it directly in the Equinix connection builder
Connection connection = fabric.connections()
.define(ConnectionType.EVPL_VC)
.name("My-AWS-Connection")
.bandwidth(100)
.aSideAccessPointPort(myPortUuid, LinkProtocol.dot1q().vlanTag(1000).create())
.zSideCloudProvider(adapter)
.notification("ops@example.com")
.create();
Custom Adapter
Implement this interface for any cloud provider or custom service profile:
public class MyCloudAdapter implements CloudProviderConnectionAdapter<MyCloudObject> {
private final MyCloudObject cloudObject;
private final String equinixProfileUuid;
public MyCloudAdapter(MyCloudObject cloudObject, String equinixProfileUuid) {
this.cloudObject = cloudObject;
this.equinixProfileUuid = equinixProfileUuid;
}
public String getServiceProfileUuid() { return equinixProfileUuid; }
public String getAuthenticationKey() { return cloudObject.getApiKey(); }
public String getSellerRegion() { return cloudObject.getRegion(); }
public MyCloudObject getSource() { return cloudObject; }
}
- Author:
- ianjones
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault Stringdescribe()Returns a human-readable description of the cloud provider connection for use in logging and diagnostics.Returns the authentication key required by the cloud provider to authorize the connection.default ConnectionTypeReturns the preferred connection type for this cloud provider.default LinkProtocolReturns the preferred link protocol for this cloud provider connection.default PeeringTypeReturns the preferred peering type for this cloud provider connection.Returns the cloud provider type for this adapter.Returns the cloud provider's region where the connection will terminate.Returns the Equinix Fabric service profile UUID for this cloud provider.Returns the underlying cloud provider SDK object that was adapted.
-
Method Details
-
getServiceProfileUuid
String getServiceProfileUuid()Returns the Equinix Fabric service profile UUID for this cloud provider.Each cloud provider has a corresponding Equinix service profile that defines the connectivity parameters. This UUID can be found in the Equinix Developer Portal or by querying
fabric.serviceProfiles().search()for the provider's profile.- Returns:
- the UUID of the Equinix service profile for this cloud provider
-
getAuthenticationKey
String getAuthenticationKey()Returns the authentication key required by the cloud provider to authorize the connection.The meaning of this key varies by provider:
- AWS Direct Connect: The AWS Account ID (12-digit number)
- Azure ExpressRoute: The ExpressRoute Service Key (GUID)
- Google Cloud Interconnect: The GCP Pairing Key
- Oracle FastConnect: The Oracle OCID of the virtual circuit
- Returns:
- the provider-specific authentication key
-
getSellerRegion
String getSellerRegion()Returns the cloud provider's region where the connection will terminate.The region string follows the provider's naming convention:
- AWS:
"us-east-1","eu-west-1", etc. - Azure:
"eastus","westeurope", etc. - Google Cloud:
"us-east1","europe-west1", etc. - Oracle Cloud:
"us-ashburn-1","uk-london-1", etc.
- Returns:
- the provider-specific region identifier
- AWS:
-
getSource
T getSource()Returns the underlying cloud provider SDK object that was adapted.Provides access to the original provider object for cases where additional provider-specific properties are needed beyond what the adapter interface exposes.
- Returns:
- the original cloud provider SDK object
-
getProviderType
CloudProviderType getProviderType()Returns the cloud provider type for this adapter.Used for logging, diagnostics, and provider-specific defaults. Implementations should return the appropriate
CloudProviderTypeconstant.- Returns:
- the cloud provider type
-
getPreferredConnectionType
Returns the preferred connection type for this cloud provider.Most cloud provider connections use
ConnectionType.EVPL_VC, but implementations can override this to return a different default. The user can always override the connection type when calling the builder.- Returns:
- the preferred connection type; defaults to
ConnectionType.EVPL_VC
-
getPreferredLinkProtocol
Returns the preferred link protocol for this cloud provider connection.Most cloud provider connections use DOT1Q encapsulation. Implementations can override this to provide a provider-specific default. Returns
nullto indicate no default (the user must specify the link protocol explicitly).- Returns:
- the preferred link protocol, or
nullif none
-
getPreferredPeeringType
Returns the preferred peering type for this cloud provider connection.Relevant for providers that support multiple peering types (e.g., Azure ExpressRoute supports PRIVATE and MICROSOFT peering). Returns
nullto indicate no preference.- Returns:
- the preferred peering type, or
nullif not applicable
-
describe
Returns a human-readable description of the cloud provider connection for use in logging and diagnostics.- Returns:
- a description string such as "AWS Direct Connect to us-east-1"
-