use of com.microsoft.azure.toolkit.lib.sqlserver.AzureSqlServer in project azure-tools-for-java by Microsoft.
the class SqlServerRegionValidator method apply.
@Override
public AzureValidationInfo apply(RegionComboBox comboBox) {
AzureSqlServer service = Azure.az(AzureSqlServer.class);
try {
if (service.checkRegionCapability(comboBox.getSubscription().getId(), comboBox.getValue().getName())) {
return AzureValidationInfo.OK;
}
} catch (ManagementException e) {
return AzureValidationInfo.builder().input(comboBox).message(e.getMessage()).type(AzureValidationInfo.Type.ERROR).build();
}
final AzureValidationInfo.AzureValidationInfoBuilder builder = AzureValidationInfo.builder();
return builder.input(comboBox).message(REGION_UNAVAILABLE_MESSAGE).type(AzureValidationInfo.Type.ERROR).build();
}
Aggregations