use of com.microsoft.azure.toolkit.lib.common.model.Region in project azure-tools-for-java by Microsoft.
the class CreateArmStorageAccountForm method fillRegions.
private void fillRegions() {
Subscription subs = (Subscription) subscriptionComboBox.getData(subscriptionComboBox.getText());
final List<Region> locations = Azure.az(AzureAccount.class).listRegions(subs.getId());
AzureTaskManager.getInstance().runLater(() -> {
for (Region location : locations) {
regionComboBox.add(location.getLabel());
regionComboBox.setData(location.getLabel(), location);
}
if (locations.size() > 0) {
regionComboBox.select(0);
}
});
}
use of com.microsoft.azure.toolkit.lib.common.model.Region in project azure-tools-for-java by Microsoft.
the class VMCreationDialog method onRegionChanged.
private void onRegionChanged(final ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED && e.getItem() instanceof Region) {
final Region region = (Region) e.getItem();
this.cbImage.setRegion(region);
this.cbSize.setRegion(region);
this.cbVirtualNetwork.setRegion(region);
this.cbPublicIp.setRegion(region);
this.cbSecurityGroup.setRegion(region);
}
}
use of com.microsoft.azure.toolkit.lib.common.model.Region in project azure-tools-for-java by Microsoft.
the class RedisCreationDialog method createUIComponents.
private void createUIComponents() {
this.subscriptionComboBox = new SubscriptionComboBox();
this.resourceGroupComboBox = new ResourceGroupComboBox();
this.regionComboBox = new RegionComboBox() {
protected List<? extends Region> loadItems() {
if (Objects.nonNull(this.subscription)) {
return Azure.az(AzureRedis.class).listSupportedRegions(subscription.getId());
}
return Collections.emptyList();
}
};
this.redisNameTextField = new ValidationDebouncedTextInput();
this.pricingComboBox = new AzureComboBoxSimple<>(PricingTier::values);
}
use of com.microsoft.azure.toolkit.lib.common.model.Region in project azure-tools-for-java by Microsoft.
the class AzureMvpModel method listLocationsBySubscriptionId.
/**
* List Location by Subscription ID.
*
* @param sid subscription Id
* @return List of Location instances
*/
@AzureOperation(name = "common|region.list.subscription", params = { "sid" }, type = AzureOperation.Type.SERVICE)
public List<Region> listLocationsBySubscriptionId(String sid) {
List<Region> locations = new ArrayList<>();
Subscription subscription = getSubscriptionById(sid);
try {
locations.addAll(az(AzureAccount.class).listRegions(subscription.getId()));
} catch (Exception e) {
e.printStackTrace();
}
Collections.sort(locations, getComparator(Region::getName));
return locations;
}
use of com.microsoft.azure.toolkit.lib.common.model.Region in project azure-tools-for-java by Microsoft.
the class AppServiceInfoAdvancedPanel method getData.
@Override
public T getData() {
final Subscription subscription = this.selectorSubscription.getValue();
final ResourceGroup resourceGroup = this.selectorGroup.getValue();
final String name = this.textName.getValue();
final Runtime runtime = this.selectorRuntime.getValue();
final Region region = this.selectorRegion.getValue();
final AppServicePlanEntity servicePlan = this.selectorServicePlan.getValue();
final AzureArtifact artifact = this.selectorApplication.getValue();
final T config = supplier.get();
config.setSubscription(subscription);
config.setResourceGroup(resourceGroup);
config.setName(name);
config.setRuntime(runtime);
config.setRegion(region);
config.setServicePlan(servicePlan);
if (Objects.nonNull(artifact)) {
final AzureArtifactManager manager = AzureArtifactManager.getInstance(this.project);
final String path = manager.getFileForDeployment(this.selectorApplication.getValue());
config.setApplication(Paths.get(path));
}
return config;
}
Aggregations