Search in sources :

Example 16 with ResourceGroup

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);
    }
}
Also used : ResourceGroup(com.microsoft.azure.toolkit.lib.common.model.ResourceGroup)

Example 17 with ResourceGroup

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;
}
Also used : Runtime(com.microsoft.azure.toolkit.lib.appservice.model.Runtime) AzureArtifact(com.microsoft.azure.toolkit.intellij.common.AzureArtifact) AppServicePlanEntity(com.microsoft.azure.toolkit.lib.appservice.entity.AppServicePlanEntity) Region(com.microsoft.azure.toolkit.lib.common.model.Region) Subscription(com.microsoft.azure.toolkit.lib.common.model.Subscription) AzureArtifactManager(com.microsoft.azure.toolkit.intellij.common.AzureArtifactManager) ResourceGroup(com.microsoft.azure.toolkit.lib.common.model.ResourceGroup)

Example 18 with ResourceGroup

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);
    }
}
Also used : PublicIpAddress(com.microsoft.azure.toolkit.lib.compute.ip.PublicIpAddress) AzurePublicIpAddress(com.microsoft.azure.toolkit.lib.compute.ip.AzurePublicIpAddress) DraftPublicIpAddress(com.microsoft.azure.toolkit.lib.compute.ip.DraftPublicIpAddress) Subscription(com.microsoft.azure.toolkit.lib.common.model.Subscription) ResourceGroup(com.microsoft.azure.toolkit.lib.common.model.ResourceGroup)

Example 19 with ResourceGroup

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();
}
Also used : ResourceGroup(com.microsoft.azure.toolkit.lib.common.model.ResourceGroup)

Example 20 with ResourceGroup

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);
            }
        }
    }
}
Also used : Region(com.microsoft.azure.toolkit.lib.common.model.Region) AzureAccount(com.microsoft.azure.toolkit.lib.auth.AzureAccount) DraftResourceGroup(com.microsoft.azuretools.azureexplorer.forms.common.DraftResourceGroup) ResourceGroup(com.microsoft.azure.toolkit.lib.common.model.ResourceGroup)

Aggregations

ResourceGroup (com.microsoft.azure.toolkit.lib.common.model.ResourceGroup)24 Subscription (com.microsoft.azure.toolkit.lib.common.model.Subscription)12 Region (com.microsoft.azure.toolkit.lib.common.model.Region)6 IAppServicePlan (com.microsoft.azure.toolkit.lib.appservice.service.IAppServicePlan)5 AppServicePlanEntity (com.microsoft.azure.toolkit.lib.appservice.entity.AppServicePlanEntity)3 AzureString (com.microsoft.azure.toolkit.lib.common.bundle.AzureString)3 AzureOperation (com.microsoft.azure.toolkit.lib.common.operation.AzureOperation)3 Draft (com.microsoft.azure.toolkit.intellij.common.Draft)2 PricingTier (com.microsoft.azure.toolkit.lib.appservice.model.PricingTier)2 IWebApp (com.microsoft.azure.toolkit.lib.appservice.service.IWebApp)2 AzureAccount (com.microsoft.azure.toolkit.lib.auth.AzureAccount)2 AzureGroup (com.microsoft.azure.toolkit.lib.resource.AzureGroup)2 DraftResourceGroup (com.microsoft.azuretools.azureexplorer.forms.common.DraftResourceGroup)2 FileChooserDescriptorFactory (com.intellij.openapi.fileChooser.FileChooserDescriptorFactory)1 Project (com.intellij.openapi.project.Project)1 DialogWrapper (com.intellij.openapi.ui.DialogWrapper)1 MessageType (com.intellij.openapi.ui.MessageType)1 TextFieldWithBrowseButton (com.intellij.openapi.ui.TextFieldWithBrowseButton)1 StatusBar (com.intellij.openapi.wm.StatusBar)1 WindowManager (com.intellij.openapi.wm.WindowManager)1