.define(newHost.hostVM.vnetName) .withRegion(newHost.hostVM.region) .withExistingResourceGroup(resourceGroupName) .withAddressSpace(newHost.hostVM.vnetAddressSpace) .create();
.withSubnet(newNetwork.subnet.name, newNetwork.subnet.addressSpace); } else { newVirtualNetwork = networkWithGroup.withExistingResourceGroup(resourceGroup) .withAddressSpace(newNetwork.addressSpace) .withSubnet(newNetwork.subnet.name, newNetwork.subnet.addressSpace);
@Override public VirtualNetworkGatewayImpl withNewNetwork(String name, String addressSpace, String subnetAddressSpaceCidr) { Network.DefinitionStages.WithGroup definitionWithGroup = this.manager().networks() .define(name) .withRegion(this.regionName()); Network.DefinitionStages.WithCreate definitionAfterGroup; if (this.newGroup() != null) { definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.newGroup()); } else { definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.resourceGroupName()); } Creatable<Network> network = definitionAfterGroup.withAddressSpace(addressSpace).withSubnet(GATEWAY_SUBNET, subnetAddressSpaceCidr); return withNewNetwork(network); }
@Override public VirtualNetworkGatewayImpl withNewNetwork(String name, String addressSpace, String subnetAddressSpaceCidr) { Network.DefinitionStages.WithGroup definitionWithGroup = this.manager().networks() .define(name) .withRegion(this.regionName()); Network.DefinitionStages.WithCreate definitionAfterGroup; if (this.newGroup() != null) { definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.newGroup()); } else { definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.resourceGroupName()); } Creatable<Network> network = definitionAfterGroup.withAddressSpace(addressSpace).withSubnet(GATEWAY_SUBNET, subnetAddressSpaceCidr); return withNewNetwork(network); }
@Override public NicIPConfigurationImpl withNewNetwork(String name, String addressSpaceCidr) { Network.DefinitionStages.WithGroup definitionWithGroup = this.networkManager.networks() .define(name) .withRegion(this.parent().regionName()); Network.DefinitionStages.WithCreate definitionAfterGroup; if (this.parent().newGroup() != null) { definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.parent().newGroup()); } else { definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.parent().resourceGroupName()); } return withNewNetwork(definitionAfterGroup.withAddressSpace(addressSpaceCidr)); }
@Override public NicIPConfigurationImpl withNewNetwork(String name, String addressSpaceCidr) { Network.DefinitionStages.WithGroup definitionWithGroup = this.networkManager.networks() .define(name) .withRegion(this.parent().regionName()); Network.DefinitionStages.WithCreate definitionAfterGroup; if (this.parent().newGroup() != null) { definitionAfterGroup = definitionWithGroup.withNewResourceGroup(this.parent().newGroup()); } else { definitionAfterGroup = definitionWithGroup.withExistingResourceGroup(this.parent().resourceGroupName()); } return withNewNetwork(definitionAfterGroup.withAddressSpace(addressSpaceCidr)); }
private Creatable<Network> ensureDefaultNetworkDefinition() { if (this.creatableNetwork == null) { final String vnetName = SdkContext.randomResourceName("vnet", 10); this.creatableNetwork = this.manager().networks().define(vnetName) .withRegion(this.region()) .withExistingResourceGroup(this.resourceGroupName()) .withAddressSpace("10.0.0.0/24") .withSubnet(DEFAULT, "10.0.0.0/25") .withSubnet("apps", "10.0.0.128/25"); } return this.creatableNetwork; }
private Creatable<Network> ensureDefaultNetworkDefinition() { if (this.creatableNetwork == null) { final String vnetName = SdkContext.randomResourceName("vnet", 10); this.creatableNetwork = this.manager().networks().define(vnetName) .withRegion(this.region()) .withExistingResourceGroup(this.resourceGroupName()) .withAddressSpace("10.0.0.0/24") .withSubnet(DEFAULT, "10.0.0.0/25") .withSubnet("apps", "10.0.0.128/25"); } return this.creatableNetwork; }