IpRange range = IpRange.parse(cidr);
if (!range.isIpv6()) {
throw new IllegalArgumentException("Only IPV6 is supported");
}
HostData host = networkMap.findHost(cidr);
if (host == null) {
throw new IllegalArgumentException("Host with specified CIDR not found");
}
HostData.Builder b = HostData.newBuilder(host);
if (label != null) {
b.setLabel(label);
}
if (networkDevice != null) {
b.setNetworkDevice(networkDevice);
}
HostData created = networkMap.updateHost(host.getId(), b);
return created;
}