use of com.microsoft.azuretools.authmanage.models.SubscriptionDetail in project azure-tools-for-java by Microsoft.
the class ApplicationInsightsPreferencePage method loadInfoFirstTime.
private void loadInfoFirstTime() {
try {
if (AuthMethodManager.getInstance().isSignedIn()) {
AzureManager azureManager = AuthMethodManager.getInstance().getAzureManager();
List<SubscriptionDetail> subList = azureManager.getSubscriptionManager().getSubscriptionDetails();
if (subList.size() > 0) {
// if (!ApplicationInsightsPreferences.isLoaded()) {
// authenticated using AD. Proceed for updating application insights registry.
ApplicationInsightsResourceRegistryEclipse.updateApplicationInsightsResourceRegistry(subList);
} else {
ApplicationInsightsResourceRegistryEclipse.keeepManuallyAddedList();
}
// } else {
// // show list from preferences - getTableContent() does it. So nothing to handle here
// }
} else {
// just show manually added list from preferences
ApplicationInsightsResourceRegistryEclipse.keeepManuallyAddedList();
}
} catch (Exception ex) {
Activator.getDefault().log(Messages.importErrMsg, ex);
}
}
use of com.microsoft.azuretools.authmanage.models.SubscriptionDetail in project azure-tools-for-java by Microsoft.
the class ApplicationInsightsNewDialog method populateValues.
private void populateValues() {
try {
subscription.removeAll();
AzureManager azureManager = AuthMethodManager.getInstance().getAzureManager();
if (azureManager == null) {
return;
}
List<SubscriptionDetail> subList = azureManager.getSubscriptionManager().getSubscriptionDetails();
// check at least single subscription is associated with the account
if (subList.size() > 0) {
for (SubscriptionDetail sub : subList) {
subscription.add(sub.getSubscriptionName());
subscription.setData(sub.getSubscriptionName(), sub);
}
subscription.select(0);
currentSub = subList.get(0);
populateResourceGroupValues(currentSub.getSubscriptionId(), "");
List<String> regionList = AzureSDKManager.getLocationsForApplicationInsights(currentSub);
String[] regionArray = regionList.toArray(new String[regionList.size()]);
region.setItems(regionArray);
region.setText(regionArray[0]);
}
enableOkBtn();
} catch (Exception ex) {
Activator.getDefault().log(Messages.getValuesErrMsg, ex);
}
}
use of com.microsoft.azuretools.authmanage.models.SubscriptionDetail in project azure-tools-for-java by Microsoft.
the class ApplicationInsightsNewDialog method createSubCmpnt.
private void createSubCmpnt(Composite container) {
Label lblName = new Label(container, SWT.LEFT);
GridData gridData = gridDataForLbl();
lblName.setLayoutData(gridData);
lblName.setText(Messages.sub);
subscription = new Combo(container, SWT.READ_ONLY);
gridData = gridDataForText(180);
subscription.setLayoutData(gridData);
subscription.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent arg0) {
SubscriptionDetail newSub = (SubscriptionDetail) subscription.getData(subscription.getText());
String prevResGrpVal = resourceGrpCombo.getText();
if (currentSub.equals(newSub)) {
populateResourceGroupValues(currentSub.getSubscriptionId(), prevResGrpVal);
} else {
populateResourceGroupValues(newSub.getSubscriptionId(), "");
}
currentSub = newSub;
enableOkBtn();
}
@Override
public void widgetDefaultSelected(SelectionEvent arg0) {
}
});
}
use of com.microsoft.azuretools.authmanage.models.SubscriptionDetail in project azure-tools-for-java by Microsoft.
the class WebAppDeployDialog method fillAppServiceDetails.
private void fillAppServiceDetails() {
validated();
int selectedRow = table.getSelectionIndex();
if (selectedRow < 0) {
browserAppServiceDetailes.setText("");
btnDelete.setEnabled(false);
return;
}
btnDelete.setEnabled(true);
String appServiceName = table.getItems()[selectedRow].getText(0);
WebAppDetails wad = webAppDetailsMap.get(appServiceName);
SubscriptionDetail sd = wad.subscriptionDetail;
AppServicePlan asp = wad.appServicePlan;
StringBuilder sb = new StringBuilder();
sb.append("<div style=\"margin: 7px 7px 7px 7px; " + browserFontStyle + "\">");
sb.append(String.format("App Service name: <b>%s</b>;<br/>", appServiceName));
sb.append(String.format("Subscription name: <b>%s</b>; id: <b>%s</b>;<br/>", sd.getSubscriptionName(), sd.getSubscriptionId()));
String aspName = asp == null ? "N/A" : asp.name();
String aspPricingTier = asp == null ? "N/A" : asp.pricingTier().toString();
sb.append(String.format("App Service Plan name: <b>%s</b>; Pricing tier: <b>%s</b>;<br/>", aspName, aspPricingTier));
String link = buildSiteLink(wad.webApp, null);
sb.append(String.format("Link: <a href=\"%s\">%s</a><br/>", link, link));
sb.append(String.format("<a href=\"%s\">%s</a>", ftpLinkString, "Show FTP deployment credentials"));
sb.append("</div>");
browserAppServiceDetailes.setText(sb.toString());
}
use of com.microsoft.azuretools.authmanage.models.SubscriptionDetail in project azure-tools-for-java by Microsoft.
the class CreateBlobContainer method actionPerformed.
@Override
public void actionPerformed(NodeActionEvent e) {
String connectionString;
if (parent instanceof BlobModule) {
connectionString = StorageClientSDKManager.getConnectionString(((BlobModule) parent).getStorageAccount());
} else {
connectionString = StorageClientSDKManager.getConnectionString(((StorageNode) parent).getStorageAccount());
}
CreateBlobContainerForm form = new CreateBlobContainerForm(PluginUtil.getParentShell(), connectionString);
if (parent instanceof StorageNode) {
form.setSubscription(new SubscriptionDetail(((StorageNode) parent).getSubscriptionId(), null, null, true));
}
form.setOnCreate(new Runnable() {
@Override
public void run() {
parent.removeAllChildNodes();
parent.load(false);
}
});
form.open();
}
Aggregations