Delete a domain

    CLI Example:

    .. code-block:: bash

        salt '*' keystoneng.domain_delete name=domain1
        salt '*' keystoneng.domain_delete name=b62e76fbeeff4e8fb77073f591cf211e
963212
def domain_delete(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_operator_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    return cloud.delete_domain(**kwargs)
605574
public void serviceName_secondaryDnsDomains_domain_DELETE(String serviceName, String domain) throws IOException {
		String qPath = "/dedicated/server/{serviceName}/secondaryDnsDomains/{domain}";
		StringBuilder sb = path(qPath, serviceName, domain);
		exec(qPath, "DELETE", sb.toString(), null);
	}
663547
def keypair_delete(self, name):
        '''
        
        '''
        nt_ks = self.compute_conn
        nt_ks.keypairs.delete(name)
        return 'Keypair deleted: {0}'.format(name)
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}
1177752
def domain=(d)
      d = d.to_s
      fail ArgumentError unless d.length.between?(1, MAX_VTP_DOMAIN_NAME_SIZE)
      config_set('vtp', 'domain', domain: d)
    end
464147
def delete_network(kwargs=None, call=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The delete_network function must be called with -f or --function.'
        )

    if not kwargs or 'name' not in kwargs:
        log.error(
            'A name must be specified when deleting a network.'
        )
        return False

    name = kwargs['name']
    conn = get_conn()

    __utils__['cloud.fire_event'](
        'event',
        'deleting network',
        'salt/cloud/net/deleting',
        args={
            'name': name,
        },
        sock_dir=__opts__['sock_dir'],
        transport=__opts__['transport']
    )

    try:
        result = conn.ex_destroy_network(
            conn.ex_get_network(name)
        )
    except ResourceNotFoundError as exc:
        log.error(
            'Nework %s was not found. Exception was: %s',
            name, exc, exc_info_on_loglevel=logging.DEBUG
        )
        return False

    __utils__['cloud.fire_event'](
        'event',
        'deleted network',
        'salt/cloud/net/deleted',
        args={
            'name': name,
        },
        sock_dir=__opts__['sock_dir'],
        transport=__opts__['transport']
    )
    return result
538375
def domain_name(self, domain_name):
        

        if domain_name is None:
            raise ValueError("Invalid value for `domain_name`, must not be `None`")
        if len(domain_name) > 255:
            raise ValueError("Invalid value for `domain_name`, length must be less than `255`")
        if len(domain_name) < 1:
            raise ValueError("Invalid value for `domain_name`, length must be greater than or equal to `1`")

        self._domain_name = domain_name
971486
def delete(self, domain, delete_subdomains=False):
        
        uri = "/%s/%s" % (self.uri_base, utils.get_id(domain))
        if delete_subdomains:
            uri = "%s?deleteSubdomains=true" % uri
        resp, resp_body = self._async_call(uri, method="DELETE",
                error_class=exc.DomainDeletionFailed, has_response=False)
1010453
def remove_dns_challenge_txt(self, zone_id, domain, txt_challenge):
        
        print("Deleting DNS challenge..")
        resp = self.route53.change_resource_record_sets(
            HostedZoneId=zone_id,
            ChangeBatch=self.get_dns_challenge_change_batch('DELETE', domain, txt_challenge)
        )

        return resp
740813
def delete(self, *args, **kwargs):
        '''  '''
        hosted_zone = route53_backend.get_hosted_zone_by_name(
            self.hosted_zone_name)
        if not hosted_zone:
            hosted_zone = route53_backend.get_hosted_zone(self.hosted_zone_id)
        hosted_zone.delete_rrset_by_name(self.name)
788711
def delete(name, config=None):
    
    storm_ = get_storm_instance(config)

    try:
        storm_.delete_entry(name)
        print(
            get_formatted_message(
                'hostname "{0}" deleted successfully.'.format(name),
            'success')
        )
    except ValueError as error:
        print(get_formatted_message(error, 'error'), file=sys.stderr)
        sys.exit(1)
526575
def domain_delete(domain, logger):
    
    if domain is not None:
        try:
            if domain.isActive():
                domain.destroy()
        except libvirt.libvirtError:
            logger.exception("Unable to destroy the domain.")
        try:
            domain.undefine()
        except libvirt.libvirtError:
            try:
                domain.undefineFlags(libvirt.VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA)  # domain with snapshots
            except libvirt.libvirtError:
                logger.exception("Unable to undefine the domain.")
414383
def delete(self, name):
    '''
    
    '''
    keys = self._client.keys('%s%s:*'%(self._prefix,name))

    pipe = self._client.pipeline(transaction=False)
    for key in keys:
      pipe.delete( key )
    pipe.execute()

    # Could be not technically the exact number of keys deleted, but is a close
    # enough approximation
    return len(keys)
309647
def present(name, auth=None, **kwargs):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': ''}

    kwargs = __utils__['args.clean_kwargs'](**kwargs)

    __salt__['keystoneng.setup_clouds'](auth)

    domain = __salt__['keystoneng.domain_get'](name=name)

    if not domain:
        if __opts__['test']:
            ret['result'] = None
            ret['changes'] = kwargs
            ret['comment'] = 'Domain {} will be created.'.format(name)
            return ret

        kwargs['name'] = name
        domain = __salt__['keystoneng.domain_create'](**kwargs)
        ret['changes'] = domain
        ret['comment'] = 'Created domain'
        return ret

    changes = __salt__['keystoneng.compare_changes'](domain, **kwargs)
    if changes:
        if __opts__['test']:
            ret['result'] = None
            ret['changes'] = changes
            ret['comment'] = 'Domain {} will be updated.'.format(name)
            return ret

        kwargs['domain_id'] = domain.id
        __salt__['keystoneng.domain_update'](**kwargs)
        ret['changes'].update(changes)
        ret['comment'] = 'Updated domain'

    return ret
996212
def service_delete(service_id=None, name=None, profile=None, **connection_args):
    '''
    
    '''
    kstone = auth(profile, **connection_args)
    if name:
        service_id = service_get(name=name, profile=profile,
                                 **connection_args)[name]['id']
    kstone.services.delete(service_id)
    return 'Keystone service ID "{0}" deleted'.format(service_id)
686882
def domain_update(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_operator_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    if 'new_name' in kwargs:
        kwargs['name'] = kwargs.pop('new_name')
    return cloud.update_domain(**kwargs)
1019368
def delete_potection_domain(self, pdObj):
        
        self.conn.connection._check_login()
        response = self.conn.connection._do_post("{}/{}{}/{}".format(self.conn.connection._api_url, "instances/ProtectionDomain::", pdObj.id, 'action/removeProtectionDomain'))
        return response