Interface FloatingIpProvider

All Superinterfaces:
PluginProvider

public interface FloatingIpProvider extends PluginProvider
Provides a standard set of methods for interacting with floating ips.
Since:
1.2.6
  • Method Details

    • attachFloatingIp

      ServiceResponse attachFloatingIp(ComputeServer server, NetworkFloatingIp floatingIp)
      Attaches a floating ip to a server
      Parameters:
      server - the server to attach the floating ip to
      floatingIp - the floating ip to attach
      Returns:
      ServiceResponse
    • detachFloatingIp

      ServiceResponse detachFloatingIp(ComputeServer server, NetworkFloatingIp floatingIp)
      Detaches a floating ip from a server
      Parameters:
      server - the server to detach the floating ip from
      floatingIp - the floating ip to detach
      Returns:
      ServiceResponse
    • releaseFloatingIp

      ServiceResponse releaseFloatingIp(NetworkFloatingIp floatingIp)
      Releases a floating ip
      Parameters:
      floatingIp - the floating ip to release
      Returns:
      ServiceResponse
    • allocateFloatingIp

      ServiceResponse<NetworkFloatingIp> allocateFloatingIp(NetworkServer networkServer, NetworkFloatingIpPool pool)
      Allocates a floating ip in external system, the result floating ip should contain the external system object id

      Example NetworkFloatingIp To include in ServiceResponse:

      
       def networkFloatingIp = new NetworkFloatingIp(
       	floatingPool:pool, externalId:externalObject.id, internalId:externalObject.port_id, refType:'ComputeZone',
       	refId:cloud.id, active:(externalObject.status == 'ACTIVE' || externalObject.status == 'DOWN'), staticIp:true,
       	ipAddress:externalObject.floating_ip_address, ipStatus:(externalObject.port_id || externalObject.fixed_ip_address ? 'assigned' : 'free'),
       	ptrId:item.fixed_ip_address, category: objCategory)
      
       	networkFloatingIp.setConfigMap(externalObject)
      
       	return ServiceResponse<NetworkFloatingIp>.success(networkFloatingIp)
       
      Parameters:
      networkServer - the network server to allocate the floating ip from
      pool - the floating ip pool to allocate the floating ip from
      Returns:
      ServiceResponse containing the resulting NetworkFloatingIp