Remove deployment of network in equipments and set column 'active = 0' in tables redeipv4 ]

        :param id_networkv4: ID for NetworkIPv4

        :return: Equipments configuration output
488579
def undeploy(self, id_networkv4):
        

        uri = 'api/networkv4/%s/equipments/' % id_networkv4

        return super(ApiNetworkIPv4, self).delete(uri)
377344
def get_by_id(self, id_networkv4):
        

        uri = 'api/networkv4/%s/' % id_networkv4

        return super(ApiNetworkIPv4, self).get(uri)
753030
def delete(self, ids):
        
        url = build_uri_with_ids('api/v3/equipment/%s/', ids)
        return super(ApiEquipment, self).delete(url)
759540
def delete(self, ids):
        
        url = build_uri_with_ids('api/v3/ipv4/%s/', ids)

        return super(ApiIPv4, self).delete(url)
1207597
def detach_hardware(self, ticket_id=None, hardware_id=None):
        
        return self.ticket.removeAttachedHardware(hardware_id, id=ticket_id)
78474
def remove_default_gateway():
    
    log = logging.getLogger(mod_logger + '.remove_default_gateway')

    # Ensure the network script exists
    network_script = '/etc/sysconfig/network'
    if not os.path.isfile(network_script):
        log.info('Network script not found, nothing to do: {f}'.format(f=network_script))
        return
    log.debug('Found network script: {f}'.format(f=network_script))

    # Remove settings for GATEWAY and GATEWAYDEV
    log.info('Attempting to remove any default gateway configurations...')
    for line in fileinput.input(network_script, inplace=True):
        if re.search('^GATEWAY=.*', line):
            log.info('Removing GATEWAY line: {li}'.format(li=line))
        elif re.search('^GATEWAYDEV=.*', line):
            log.info('Removing GATEWAYDEV line: {li}'.format(li=line))
        else:
            log.debug('Keeping line: {li}'.format(li=line))
            sys.stdout.write(line)

    # Restart networking for the changes to take effect
    log.info('Restarting the network service...')
    try:
        service_network_restart()
    except CommandError:
        _, ex, trace = sys.exc_info()
        raise OSError('{n}: Attempted unsuccessfully to restart networking\n{e}'.format(
            n=ex.__class__.__name__, e=str(ex)))
    else:
        log.info('Successfully restarted networking')
1173418
def remove_nio(self, port_number):
        

        if port_number not in self._mappings:
            raise DynamipsError("Port {} is not allocated".format(port_number))

        nio = self._mappings[port_number]
        if isinstance(nio, NIOUDP):
            self.manager.port_manager.release_udp_port(nio.lport, self._project)
        yield from Bridge.remove_nio(self, nio)

        log.info('Ethernet hub "{name}" [{id}]: NIO {nio} removed from port {port}'.format(name=self._name,
                                                                                           id=self._id,
                                                                                           nio=nio,
                                                                                           port=port_number))

        del self._mappings[port_number]
        return nio
433573
def delete_mappings_in_network(network_id, network_2_id=None, **kwargs):
    
    qry = db.DBSession.query(ResourceAttrMap).filter(or_(ResourceAttrMap.network_a_id == network_id, ResourceAttrMap.network_b_id == network_id))

    if network_2_id is not None:
        qry = qry.filter(or_(ResourceAttrMap.network_a_id==network_2_id, ResourceAttrMap.network_b_id==network_2_id))

    mappings = qry.all()

    for m in mappings:
        db.DBSession.delete(m)
    db.DBSession.flush()

    return 'OK'
720783
def delete(self, ids):
        
        url = build_uri_with_ids('api/v4/equipment/%s/', ids)
        return super(ApiV4Equipment, self).delete(url)
898624
def teardown_logical_port_connectivity(self, context, port_db,
                                           hosting_device_id):
        
        if port_db is None or port_db.get('id') is None:
            LOG.warning("Port id is None! Cannot remove port "
                        "from hosting_device:%s", hosting_device_id)
            return
        hosting_port_id = port_db.hosting_info.hosting_port.id
        try:
            self._dev_mgr.svc_vm_mgr.interface_detach(hosting_device_id,
                                                      hosting_port_id)
            self._gt_pool.spawn_n(self._cleanup_hosting_port, context,
                                  hosting_port_id)
            LOG.debug("Teardown logicalport completed for port:%s", port_db.id)

        except Exception as e:
            LOG.error("Failed to detach interface corresponding to port:"
                      "%(p_id)s on hosting device:%(hd_id)s due to "
                      "error %(error)s", {'p_id': hosting_port_id,
                                          'hd_id': hosting_device_id,
                                          'error': str(e)})
794725
def undeploy(self, id_networkv6):
        

        uri = 'api/networkv6/%s/equipments/' % id_networkv6
        return super(ApiNetworkIPv6, self).delete(uri)
1144852
def remove_ipv6addr(self, ipv6addr):
        
        for addr in self.ipv6addrs:
            if ((isinstance(addr, dict) and addr['ipv6addr'] == ipv6addr) or
                (isinstance(addr, HostIPv4) and addr.ipv6addr == ipv6addr)):
                self.ipv6addrs.remove(addr)
                break
312742
def remove_vlan(self, vlan_resource_id):
        
        vlan_id = {'VLanResourceId': vlan_resource_id}
        json_scheme = self.gen_def_json_scheme('SetRemoveVLan', vlan_id)
        json_obj = self.call_method_post(method='SetRemoveVLan', json_scheme=json_scheme)
        return True if json_obj['Success'] is True else False
1284524
def delete(self, ids):
        
        url = build_uri_with_ids('api/v4/ipv4/%s/', ids)

        return super(ApiV4IPv4, self).delete(url)
140921
def deploy(self, id_networkv6):
        

        data = dict()
        uri = 'api/networkv6/%s/equipments/' % id_networkv6

        return super(ApiNetworkIPv6, self).post(uri, data=data)
941011
def get_by_id(self, id_networkv6):
        

        uri = 'api/networkv4/%s/' % id_networkv6
        return super(ApiNetworkIPv6, self).get(uri)
629236
def remove_nio(self, port_number):
        

        if port_number not in self._nios:
            raise DynamipsError("Port {} is not allocated".format(port_number))

        nio = self._nios[port_number]
        if isinstance(nio, NIOUDP):
            self.manager.port_manager.release_udp_port(nio.lport, self._project)
        if self._hypervisor:
            yield from self._hypervisor.send('ethsw remove_nio "{name}" {nio}'.format(name=self._name, nio=nio))

        log.info('Ethernet switch "{name}" [{id}]: NIO {nio} removed from port {port}'.format(name=self._name,
                                                                                              id=self._id,
                                                                                              nio=nio,
                                                                                              port=port_number))

        del self._nios[port_number]
        if port_number in self._mappings:
            del self._mappings[port_number]

        return nio