def create_allocation(self, session, ip_address, status='ALLOCATED'): """Create an IP allocation entry. :param session: database session :param ip_address: the IP address to allocate :param status: IP allocation status """ ip_request = db_models.IpamAllocation( ip_address=ip_address, status=status, ipam_subnet_id=self._ipam_subnet_id) session.add(ip_request)
def create_allocation(self, context, ip_address, status='ALLOCATED'): """Create an IP allocation entry. :param context: neutron api request context :param ip_address: the IP address to allocate :param status: IP allocation status """ ip_request = db_models.IpamAllocation( ip_address=ip_address, status=status, ipam_subnet_id=self._ipam_subnet_id) context.session.add(ip_request)