Delete zone.

    Arguments:

        prs:  parser object of argparse
        conn: dictionary of connection information
166075
def parse_delete_zone(prs, conn):
    
    prs_zone_delete = prs.add_parser('zone_delete', help='delete zone')
    prs_zone_delete.add_argument('--domain', action='store', required=True,
                                 help='specify zone')
    conn_options(prs_zone_delete, conn)
    prs_zone_delete.set_defaults(func=delete_zone)
354951
def delete_hosted_zone_by_domain(Name, PrivateZone=None, region=None, key=None, keyid=None,
                                 profile=None):
    '''
    
    '''
    args = {'Name': Name, 'PrivateZone': PrivateZone,
            'region': region, 'key': key, 'keyid': keyid, 'profile': profile}
    # Be extra pedantic in the service of safety - if public/private is not provided and the domain
    # name resolves to both, fail and require them to declare it explicitly.
    zone = find_hosted_zone(**args)
    if not zone:
        log.error("Couldn't resolve domain name %s to a hosted zone ID.", Name)
        return False
    Id = zone[0]['HostedZone']['Id']
    return delete_hosted_zone(Id=Id, region=region, key=key, keyid=keyid, profile=profile)
668482
def delete_connection(api)
      @subscribers.delete_if {|x| x.api == api}
      @publishers.delete_if {|x| x.api == api}
      @services.delete_if {|x| x.api == api}
    end
457748
def remove_zone(self, zone_id):
        """"""
        updated_zones = []
        for zone in self.my_osid_object_form._my_map['zones']:
            if zone['id'] != zone_id:
                updated_zones.append(zone)
        self.my_osid_object_form._my_map['zones'] = updated_zones
539575
def process_arguments
        if @options.new_zone
          new_zone
        elsif @options.delete_zone
          delete_zone
        elsif @options.create_record
          create_record
        elsif @options.remove_record
          remove_record
        elsif @options.change_record
          change_record
        else
          list
        end
      end
1277570
def parse_create(prs, conn):
    
    prs_create = prs.add_parser(
        'create', help='create record of specific zone')
    set_option(prs_create, 'domain')
    conn_options(prs_create, conn)
    prs_create.set_defaults(func=create)
684303
def disconnect(self, format, *args):
        
        return lib.zsock_disconnect(self._as_parameter_, format, *args)
504969
def flush_zone(cls, zone_name):
        ''''''
        cls.log.debug('flush_zone: zone_name=%s', zone_name)
        try:
            del cls._cache[zone_name]
        except KeyError:
            pass
1005125
def delete(cls, zone_id, record):
        """"""
        cls.echo('Creating new zone record')
        new_version_id = Zone.new(zone_id)

        cls.echo('Deleting zone record')
        cls.call('domain.zone.record.delete', zone_id, new_version_id, record)

        cls.echo('Activation of new zone version')
        Zone.set(zone_id, new_version_id)

        return new_version_id
1278779
def delete_connections(self, **kwargs):
        """"""
        rv = False
        for c in self.find_connections(**kwargs):
            self.delete(c)
            rv = True
        return rv
167808
def remove_p(self):
        
        try:
            self.unlink()
        except OSError:
            _, e, _ = sys.exc_info()
            if e.errno != errno.ENOENT:
                raise
        return self
1163087
def delete(*keys, **connection_args):
    '''
    
    '''
    # Get connection args from keywords if set
    conn_args = {}
    for arg in ['host', 'port', 'db', 'password']:
        if arg in connection_args:
            conn_args[arg] = connection_args[arg]

    server = _connect(**conn_args)
    return server.delete(*keys)
631570
def delete_host(zone, name, keyname, keyfile, nameserver, timeout, port=53,
                keyalgorithm='hmac-md5'):
    '''
    
    '''
    res = []
    if zone in name:
        name = name.replace(zone, '').rstrip('.')
    fqdn = '{0}.{1}'.format(name, zone)
    request = dns.message.make_query(fqdn, 'A')
    answer = dns.query.udp(request, nameserver, timeout, port)

    try:
        ips = [i.address for i in answer.answer[0].items]
    except IndexError:
        ips = []

    ret = delete(zone, name, keyname, keyfile, nameserver, timeout, port=port,
                 keyalgorithm=keyalgorithm)
    res.append("{0} of type \'A\'".format(ret[fqdn]))

    for ip in ips:
        parts = ip.split('.')[::-1]
        i = len(parts)
        popped = []

        # Iterate over possible reverse zones
        while i > 1:
            p = parts.pop(0)
            i -= 1
            popped.append(p)
            zone = '{0}.{1}'.format('.'.join(parts), 'in-addr.arpa.')
            name = '.'.join(popped)
            rev_fqdn = '{0}.{1}'.format(name, zone)
            ret = delete(zone, name, keyname, keyfile, nameserver, timeout,
                         'PTR', "{0}.".format(fqdn), port, keyalgorithm)

            if "Deleted" in ret[rev_fqdn]:
                res.append("{0} of type \'PTR\'".format(ret[rev_fqdn]))
                return {fqdn: res}

        res.append(ret[rev_fqdn])

    return {fqdn: res}
338620
def do_delete_config(self, line):
        

        def f(p, args):
            try:
                source = args[0]
            except:
                print("argument error")
                return
            print(p.delete_config(source))

        self._request(line, f)
601146
def remove(src, rel, dst):
    
    smt = 'DELETE FROM %s' % rel
    queries = []
    params = []

    if src is not None:
        queries.append('src = ?')
        params.append(src)

    if dst is not None:
        queries.append('dst = ?')
        params.append(dst)

    if not queries:
        return smt, params
    smt = '%s WHERE %s' % (smt, ' AND '.join(queries))
    return smt, params
995519
def delete_record(name, zone, record_type, identifier=None, all_records=False,
                  region=None, key=None, keyid=None, profile=None,
                  wait_for_sync=True, split_dns=False, private_zone=False,
                  retry_on_rate_limit=None, rate_limit_retries=None,
                  retry_on_errors=True, error_retries=5):
    '''
    
    '''
    if region is None:
        region = 'universal'

    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    if split_dns:
        _zone = _get_split_zone(zone, conn, private_zone)
    else:
        _zone = conn.get_zone(zone)
    if not _zone:
        msg = 'Failed to retrieve zone {0}'.format(zone)
        log.error(msg)
        return False
    _type = record_type.upper()

    if retry_on_rate_limit or rate_limit_retries is not None:
        salt.utils.versions.warn_until(
            'Neon',
            'The \'retry_on_rate_limit\' and \'rate_limit_retries\' arguments '
            'have been deprecated in favor of \'retry_on_errors\' and '
            '\'error_retries\' respectively. Their functionality will be '
            'removed, as such, their usage is no longer required.'
        )
        if retry_on_rate_limit is not None:
            retry_on_errors = retry_on_rate_limit
        if rate_limit_retries is not None:
            error_retries = rate_limit_retries

    while error_retries > 0:
        try:
            old_record = _zone.find_records(name, _type, all=all_records, identifier=identifier)
            if not old_record:
                return False
            status = _zone.delete_record(old_record)
            return _wait_for_sync(status.id, conn, wait_for_sync)

        except DNSServerError as e:
            if retry_on_errors:
                if 'Throttling' == e.code:
                    log.debug('Throttled by AWS API.')
                elif 'PriorRequestNotComplete' == e.code:
                    log.debug('The request was rejected by AWS API.\
                              Route 53 was still processing a prior request')
                time.sleep(3)
                error_retries -= 1
                continue
            raise e
1300351
def delete(self, opts):
        """"""

        argv = opts.args
        count = len(argv)

        # unflagged arguments are conf, stanza, key. In this order
        # however, we must have a conf and stanza.
        cpres = True if count > 0 else False
        spres = True if count > 1 else False
        kpres = True if count > 2 else False 
        
        if not cpres:
            error("Conf name is required for delete", 2)

        if not cpres and not spres:
            error("Conf name and stanza name is required for delete", 2)

        if kpres:
            error("Cannot delete individual keys from a stanza", 2)

        name = argv[0]
        stan = argv[1]
        conf = self.service.confs[name]
        conf.delete(stan)