private void validateZoneAvailable(String tenantId, String zone) throws IllegalArgumentException {
    List<ZoneDTO> zones;
    try {
      zones = zoneApi.getAvailableZones(tenantId);
    } catch (ResourceAccessException e) {
      // need to do something here to handle things more gracefully.
      throw new RuntimeException("Unable to validate zones.", e);
    }
    boolean found = zones.stream().anyMatch(z -> z.getName().equals(zone));
    log.debug("Found {} zones for tenant", zoneApi.getAvailableZones(tenantId).size());
    if (!found) throw new IllegalArgumentException("Provided zone does not exist: " + zone);
  }
private void validateZoneAvailable(String tenantId, String zone) throws IllegalArgumentException {
    List<ZoneDTO> zones;
    try {
      zones = zoneApi.getAvailableZones(tenantId);
    } catch (ResourceAccessException e) {
     
      throw new RuntimeException("Unable to validate zones.", e);
    }
    boolean found = zones.stream().anyMatch(z -> z.getName().equals(zone));
    log.debug("Found {} zones for tenant", zoneApi.getAvailableZones(tenantId).size());
    if (!found) throw new IllegalArgumentException("Provided zone does not exist: " + zone);
  }
private void validatezoneavailable(string tenantid, string zone) throws illegalargumentexception { list<zonedto> zones; try { zones = zoneapi.getavailablezones(tenantid); } catch (resourceaccessexception e) { throw new runtimeexception("unable to validate zones.", e); } boolean found = zones.stream().anymatch(z -> z.getname().equals(zone)); log.debug("found {} zones for tenant", zoneapi.getavailablezones(tenantid).size()); if (!found) throw new illegalargumentexception("provided zone does not exist: " + zone); }