this.networkServiceType = Optional.of(networkServiceType);
return this;
}
public ExternalNetwork build() {
VLANNetworkDto dto = new VLANNetworkDto();
dto.setName(name);
dto.setTag(tag);
dto.setGateway(gateway);
dto.setAddress(address);
dto.setMask(mask);
dto.setPrimaryDNS(primaryDNS);
dto.setSecondaryDNS(secondaryDNS);
dto.setSufixDNS(suffixDNS);
dto.setDefaultNetwork(defaultNetwork == null ? Boolean.FALSE : defaultNetwork);
dto.setUnmanaged(Boolean.FALSE);
dto.setType(NetworkType.EXTERNAL);
NetworkServiceType nst = networkServiceType.or(datacenter.defaultNetworkServiceType());
dto.addLink(new RESTLink("networkservicetype", nst.unwrap().getEditLink().getHref()));
ExternalNetwork network = new ExternalNetwork(context, dto);
network.datacenter = datacenter;
network.enterprise = enterprise;