Search in sources :

Example 1 with DraftNetwork

use of com.microsoft.azure.toolkit.lib.compute.network.DraftNetwork 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);
    }
}
Also used : DraftNetwork(com.microsoft.azure.toolkit.lib.compute.network.DraftNetwork) AzureNetwork(com.microsoft.azure.toolkit.lib.compute.network.AzureNetwork) Network(com.microsoft.azure.toolkit.lib.compute.network.Network) Subscription(com.microsoft.azure.toolkit.lib.common.model.Subscription) ResourceGroup(com.microsoft.azure.toolkit.lib.common.model.ResourceGroup)

Example 2 with DraftNetwork

use of com.microsoft.azure.toolkit.lib.compute.network.DraftNetwork in project azure-tools-for-java by Microsoft.

the class VirtualNetworkComboBox method createVirtualNetwork.

private void createVirtualNetwork() {
    if (!ObjectUtils.allNotNull(resourceGroup, region, subscription)) {
        AzureMessager.getMessager().warning("To create new virtual network, please select subscription, resource group and region first");
        return;
    }
    final DraftNetwork defaultNetwork = DraftNetwork.getDefaultNetworkDraft();
    final VirtualNetworkDialog dialog = new VirtualNetworkDialog(subscription.getId(), resourceGroup.getName(), region);
    dialog.setData(defaultNetwork);
    if (dialog.showAndGet()) {
        this.draftNetwork = dialog.getData();
        this.addItem(draftNetwork);
        setValue(draftNetwork);
    }
}
Also used : DraftNetwork(com.microsoft.azure.toolkit.lib.compute.network.DraftNetwork)

Example 3 with DraftNetwork

use of com.microsoft.azure.toolkit.lib.compute.network.DraftNetwork in project azure-tools-for-java by Microsoft.

the class VirtualNetworkDialog method getData.

@Override
public DraftNetwork getData() {
    final DraftNetwork draftNetwork = new DraftNetwork(subscriptionId, resourceGroup, txtName.getValue());
    draftNetwork.setRegion(region);
    draftNetwork.setAddressSpace(txtAddressSpace.getValue());
    draftNetwork.setSubnet(txtSubnetName.getValue());
    draftNetwork.setSubnetAddressSpace(txtSubnetAddressRange.getValue());
    return draftNetwork;
}
Also used : DraftNetwork(com.microsoft.azure.toolkit.lib.compute.network.DraftNetwork)

Aggregations

DraftNetwork (com.microsoft.azure.toolkit.lib.compute.network.DraftNetwork)3 ResourceGroup (com.microsoft.azure.toolkit.lib.common.model.ResourceGroup)1 Subscription (com.microsoft.azure.toolkit.lib.common.model.Subscription)1 AzureNetwork (com.microsoft.azure.toolkit.lib.compute.network.AzureNetwork)1 Network (com.microsoft.azure.toolkit.lib.compute.network.Network)1