use of com.microsoft.azure.toolkit.lib.common.model.ResourceGroup in project azure-tools-for-java by Microsoft.
the class ResourceManagementModule method renderChildren.
@Override
public void renderChildren(List<ResourceEx<ResourceGroup>> resourceExes) {
for (final ResourceEx<ResourceGroup> resourceEx : resourceExes) {
final ResourceGroup rg = resourceEx.getResource();
final ResourceManagementNode node = new ResourceManagementNode(this, resourceEx.getSubscriptionId(), rg);
addChildNode(node);
}
}
use of com.microsoft.azure.toolkit.lib.common.model.ResourceGroup 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;
}
use of com.microsoft.azure.toolkit.lib.common.model.ResourceGroup in project azure-tools-for-java by Microsoft.
the class PublicIPAddressComboBox method resetResourceDraft.
private void resetResourceDraft() {
final PublicIpAddress value = getValue();
if (value != null && !StringUtils.equals(value.status(), IAzureBaseResource.Status.DRAFT)) {
draftPublicIpAddress = DraftPublicIpAddress.getDefaultPublicIpAddressDraft();
draftPublicIpAddress.setRegion(region);
draftPublicIpAddress.setResourceGroup(Optional.ofNullable(resourceGroup).map(ResourceGroup::getName).orElse(null));
draftPublicIpAddress.setSubscriptionId(Optional.ofNullable(subscription).map(Subscription::getId).orElse(null));
setValue(draftPublicIpAddress);
}
}
use of com.microsoft.azure.toolkit.lib.common.model.ResourceGroup in project azure-tools-for-java by Microsoft.
the class PublishWebAppOnLinuxDialog method renderResourceGroupList.
// Implementation of WebAppOnLinuxDeployView
@Override
public void renderResourceGroupList(List<ResourceGroup> list) {
resourceGroupList = list;
cpNew.cbExistingResourceGroup.removeAll();
for (ResourceGroup rg : resourceGroupList) {
cpNew.cbExistingResourceGroup.add(rg.getName());
}
if (cpNew.cbExistingResourceGroup.getItemCount() > 0) {
cpNew.cbExistingResourceGroup.select(0);
}
onResourceGroupSelection();
}
use of com.microsoft.azure.toolkit.lib.common.model.ResourceGroup in project azure-tools-for-java by Microsoft.
the class CreateRedisCacheForm method fillLocationsAndResourceGrps.
private void fillLocationsAndResourceGrps(Subscription selectedSub) {
cbLocations.removeAll();
List<? extends Region> locations = com.microsoft.azure.toolkit.lib.Azure.az(AzureAccount.class).listRegions(selectedSub.getId());
if (locations != null) {
sortedLocations = locations.stream().sorted(Comparator.comparing(Region::getLabel)).collect(Collectors.toList());
for (Region location : sortedLocations) {
cbLocations.add(location.getLabel());
}
if (sortedLocations.size() > 0) {
cbLocations.select(0);
selectedLocationValue = sortedLocations.get(0).getLabel();
}
}
cbUseExisting.removeAll();
List<ResourceGroup> groups = AzureMvpModel.getInstance().getResourceGroups(selectedSub.getId()).stream().map(ResourceEx::getResource).collect(Collectors.toList());
if (groups != null) {
sortedGroups = groups.stream().map(ResourceGroup::getName).sorted().collect(Collectors.toList());
for (String group : sortedGroups) {
cbUseExisting.add(group);
}
if (sortedGroups.size() > 0) {
cbUseExisting.select(0);
if (rdoUseExisting.getSelection()) {
newResGrp = false;
selectedResGrpValue = sortedGroups.get(0);
}
}
}
}
Aggregations