Class ProviderCatalog

java.lang.Object
com.eqixiac.equinix.design.optimizer.context.ProviderCatalog

public final class ProviderCatalog extends Object
Resolves each CloudIntent of a spec to the Fabric service profiles that serve it and the metros those profiles publish: the source of reachableClouds per metro.

Matching: an explicit serviceProfileUuid wins, then a case-insensitive serviceProfileName substring, then the provider's own profile-name rules (CloudProviderType.matchesServiceProfileName). When several profiles serve the same metro, one is chosen per metro by a total order (the profile publishing the cloud's region as a seller region first, then one that publishes any seller region, then the smallest uuid), so the result never depends on the order the search endpoint returned. Every matching profile's bandwidth capability is still carried on ProviderAvailability.profileOptions so the Deployment Wizard can pick a profile that covers the bandwidth it plans.

  • Method Details

    • resolve

      public static ProviderCatalog resolve(List<CloudIntent> clouds, List<ServiceProfile> profiles)
      Parameters:
      clouds - the spec's clouds
      profiles - the service profiles read from Fabric
      Returns:
      the catalogue
    • byCloud

      public Map<String, Map<MetroId, ProviderAvailability>> byCloud()
      Returns:
      per cloud id, the chosen profile at every metro the cloud is reachable from
    • profilesMatched

      public int profilesMatched(String cloudId)
      Parameters:
      cloudId - a spec cloud id
      Returns:
      how many service profiles matched the cloud's selector, whatever their coverage
    • unresolvedReason

      public String unresolvedReason(CloudIntent cloud)
      Parameters:
      cloud - a spec cloud
      Returns:
      why the cloud reaches no metro, or null when it reaches at least one