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);
}
}
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);
}
}
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;
}
Aggregations