jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds/jclouds] [JCLOUDS-1382] improve usage of Neutron capabilities from Nova (#1178)
Date Thu, 15 Feb 2018 11:03:11 GMT
nacx commented on this pull request.



> +               Optional<org.jclouds.openstack.neutron.v2.domain.FloatingIP> floatingIPOptional
= tryFindExistingFloatingIp(neutronFloatingApi, availabilityZone);
+               org.jclouds.openstack.neutron.v2.domain.FloatingIP floatingIP;
+               if (floatingIPOptional.isPresent()) {
+                  floatingIP = floatingIPOptional.get();
+               } else {
+                  floatingIP = createFloatingIpUsingNeutron(neutronFloatingApi, node, availabilityZone);
+               }
+
+               org.jclouds.openstack.neutron.v2.domain.FloatingIP ip = neutronFloatingApi.update(floatingIP.getId(),
+                       org.jclouds.openstack.neutron.v2.domain.FloatingIP.UpdateFloatingIP
+                               .updateBuilder()
+                               .portId(optionalPort.get().getId())
+                               .build());
+
+               input.get().getNodeMetadata().set(NodeMetadataBuilder.fromNodeMetadata(node).publicAddresses(ImmutableSet.of(ip.getFloatingIpAddress())).build());
+            }

Makes sense too :)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1178#discussion_r168443156
Mime
View raw message