- return ipAddress;
- } catch (CompletionException e) {
- // Unwrap the CompletionException and wrap in IpamException
- throw new IpamException("Fail to assign IP for Prefix(id= " + prefix.getId() + "). " + e.getMessage(),
- e.getCause());
+ final String serviceInstanceId = parameters.get(SERVICE_INSTANCE_ID_PROP);
+ LOG.trace("assignIpAddress: service_instance_id = {}", serviceInstanceId);
+ final String vfModuleId = parameters.get(VF_MODULE_ID_PROP);
+ LOG.trace("assignIpAddress: vf_module_id = {}", vfModuleId);
+ final String prefixId = parameters.get("prefix_id");
+ LOG.trace("assignIpAddress: prefix_id = {}", prefixId);
+
+ HttpResponse httpResp;
+ try {
+ httpResp = client
+ .post(String.format(NEXT_AVAILABLE_IP_IN_PREFIX_PATH, prefixId), EMPTY_STRING);
+ } catch (IOException e) {
+ LOG.error("Fail to assign IP for Prefix(id={}). {}", prefixId, e.getMessage(), e.getCause());
+ return QueryStatus.FAILURE;