this.networkServiceType = Optional.of(networkServiceType);
return this;
}
public PublicNetwork 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);
dto.setUnmanaged(false);
dto.setType(NetworkType.PUBLIC);
NetworkServiceType nst = networkServiceType.or(datacenter.defaultNetworkServiceType());
dto.addLink(new RESTLink("networkservicetype", nst.unwrap().getEditLink().getHref()));
PublicNetwork network = new PublicNetwork(context, dto);
network.datacenter = datacenter;
return network;