use of com.microsoft.azure.toolkit.lib.common.model.Subscription in project azure-tools-for-java by Microsoft.
the class AppInsightsMngmtPanel method updateApplicationInsightsResourceRegistry.
public static void updateApplicationInsightsResourceRegistry(List<Subscription> subList, Project project) throws Exception {
// remove all resourecs that were not manually added
keeepManuallyAddedList(project);
for (Subscription sub : subList) {
if (sub.isSelected()) {
try {
// fetch resources available for particular subscription
List<ApplicationInsightsComponent> resourceList = AzureSDKManager.getInsightsResources(sub.getId());
// Removal logic
List<ApplicationInsightsResource> importedList = ApplicationInsightsResourceRegistry.prepareAppResListFromRes(resourceList, sub);
// Addition logic
ApplicationInsightsResourceRegistry.getAppInsightsResrcList().addAll(importedList);
} catch (Exception ex) {
AzurePlugin.log("Error loading AppInsights information for subscription '" + sub.getName() + "'");
}
}
}
AzureSettings.getSafeInstance(project).saveAppInsights();
}
use of com.microsoft.azure.toolkit.lib.common.model.Subscription in project azure-tools-for-java by Microsoft.
the class AzureExplorer method getTitle.
private String getTitle() {
try {
final AzureAccount az = Azure.az(AzureAccount.class);
final Account account = az.account();
final List<Subscription> subscriptions = account.getSelectedSubscriptions();
if (subscriptions.size() == 1) {
return String.format("Azure(%s)", subscriptions.get(0).getName());
}
} catch (final Exception ignored) {
}
return "Azure";
}
use of com.microsoft.azure.toolkit.lib.common.model.Subscription in project azure-tools-for-java by Microsoft.
the class SpringCloudDeploymentConfigurationPanel method onSubscriptionChanged.
private void onSubscriptionChanged(final ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED || e.getStateChange() == ItemEvent.DESELECTED) {
final Subscription subscription = (Subscription) e.getItem();
this.selectorCluster.setSubscription(subscription);
}
}
use of com.microsoft.azure.toolkit.lib.common.model.Subscription in project azure-tools-for-java by Microsoft.
the class StorageAccountResourcePanel method init.
private void init() {
this.subscriptionComboBox.addItemListener(e -> {
if (e.getStateChange() == ItemEvent.SELECTED) {
final Subscription subscription = (Subscription) e.getItem();
this.accountComboBox.refreshItems();
} else if (e.getStateChange() == ItemEvent.DESELECTED) {
this.accountComboBox.clear();
}
});
}
use of com.microsoft.azure.toolkit.lib.common.model.Subscription in project azure-tools-for-java by Microsoft.
the class VirtualNetworkComboBox method resetResourceDraft.
private void resetResourceDraft() {
final Network value = getValue();
if (value != null && !StringUtils.equals(value.status(), IAzureBaseResource.Status.DRAFT)) {
draftNetwork = DraftNetwork.getDefaultNetworkDraft();
draftNetwork.setRegion(region);
draftNetwork.setResourceGroup(Optional.ofNullable(resourceGroup).map(ResourceGroup::getName).orElse(null));
draftNetwork.setSubscriptionId(Optional.ofNullable(subscription).map(Subscription::getId).orElse(null));
setValue(draftNetwork);
}
}
Aggregations