Delete a Route53 hosted zone.

    CLI Example::

        salt myminion boto3_route53.delete_hosted_zone Z1234567890
420509
def delete_hosted_zone(Id, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    try:
        r = conn.delete_hosted_zone(Id=Id)
        return _wait_for_sync(r['ChangeInfo']['Id'], conn)
    except ClientError as e:
        log.error('Failed to delete hosted zone %s: %s', Id, e)
    return False
963212
def domain_delete(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_operator_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    return cloud.delete_domain(**kwargs)
538211
def delete_route(route_table_id=None, destination_cidr_block=None,
                 route_table_name=None, region=None, key=None,
                 keyid=None, profile=None):
    '''
    

    '''

    if not _exactly_one((route_table_name, route_table_id)):
        raise SaltInvocationError('One (but not both) of route_table_id or route_table_name '
                                  'must be provided.')

    if destination_cidr_block is None:
        raise SaltInvocationError('destination_cidr_block is required.')

    try:
        if route_table_name:
            route_table_id = _get_resource_id('route_table', route_table_name,
                                              region=region, key=key,
                                              keyid=keyid, profile=profile)
            if not route_table_id:
                return {'created': False,
                        'error': {'message': 'route table {0} does not exist.'.format(route_table_name)}}
    except BotoServerError as e:
        return {'created': False, 'error': __utils__['boto.get_error'](e)}

    return _delete_resource(resource='route', resource_id=route_table_id,
                            destination_cidr_block=destination_cidr_block,
                            region=region, key=key,
                            keyid=keyid, profile=profile)
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
817294
def delete_router(self, context, router_id):
        """"""

        router = self.get_router(context, router_id)

        # Delete router on the Arista Hw
        try:
            self.driver.delete_router(context, router_id, router)
        except Exception as e:
            LOG.error(_LE("Error deleting router on Arista HW "
                          "router %(r)s exception=%(e)s"),
                      {'r': router, 'e': e})

        super(AristaL3ServicePlugin, self).delete_router(context, router_id)
1236545
def delete(network):
    
    try:
        network.destroy()
    except libvirt.libvirtError as error:
        raise RuntimeError("Unable to destroy network: {}".format(error))
890645
def router_del(self, cluster_id, router_id):
        """"""
        cluster = self._storage[cluster_id]
        result = cluster.router_remove(router_id)
        self._storage[cluster_id] = cluster
        return result
1013637
def delete_usage_plan(plan_id, region=None, key=None, keyid=None, profile=None):
    '''
    

    '''
    try:
        existing = describe_usage_plans(plan_id=plan_id, region=region, key=key, keyid=keyid, profile=profile)
        # don't attempt to delete the usage plan if it does not exist
        if 'error' in existing:
            return {'error': existing['error']}

        if 'plans' in existing and existing['plans']:
            conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
            res = conn.delete_usage_plan(usagePlanId=plan_id)
        return {'deleted': True, 'usagePlanId': plan_id}
    except ClientError as e:
        return {'error': __utils__['boto3.get_error'](e)}
1024236
def delete_network_interface(
        name=None, network_interface_id=None, region=None, key=None,
        keyid=None, profile=None):
    '''
    
    '''
    if not (name or network_interface_id):
        raise SaltInvocationError(
            'Either name or network_interface_id must be provided.'
        )
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    r = {}
    result = _get_network_interface(conn, name, network_interface_id)
    if 'error' in result:
        return result
    eni = result['result']
    try:
        info = _describe_network_interface(eni)
        network_interface_id = info['id']
    except KeyError:
        r['error'] = {'message': 'ID not found for this network interface.'}
        return r
    try:
        r['result'] = conn.delete_network_interface(network_interface_id)
    except boto.exception.EC2ResponseError as e:
        r['error'] = __utils__['boto.get_error'](e)
    return r
343196
def destroy_dns(app='', env='dev', **_):
    
    client = boto3.Session(profile_name=env).client('route53')

    generated = get_details(app=app, env=env)
    record = generated.dns_elb()

    zone_ids = get_dns_zone_ids(env=env, facing='external')

    for zone_id in zone_ids:
        record_sets = client.list_resource_record_sets(
            HostedZoneId=zone_id, StartRecordName=record, StartRecordType='CNAME', MaxItems='1')

        for found_record in record_sets['ResourceRecordSets']:
            assert destroy_record(client=client, found_record=found_record, record=record, zone_id=zone_id)

    return True
1057195
def delete_host_template(self, name):
    
    return host_templates.delete_host_template(self._get_resource_root(), name, self.name)
572431
def delete_domain(self, domain, params=None):
        ''' 
        '''
        params = update_params(params, {'domain': domain})
        return self.request('/v1/dns/delete_domain', params, 'POST')
216330
def hosted_zone_absent(name, domain_name=None, region=None, key=None,
                       keyid=None, profile=None):
    '''
    

    '''
    domain_name = domain_name if domain_name else name

    ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}

    deets = __salt__['boto_route53.describe_hosted_zones'](
          domain_name=domain_name, region=region, key=key, keyid=keyid,
          profile=profile)
    if not deets:
        ret['comment'] = 'Hosted Zone {0} already absent'.format(domain_name)
        log.info(ret['comment'])
        return ret
    if __opts__['test']:
        ret['comment'] = 'Route53 Hosted Zone {0} set to be deleted.'.format(
                domain_name)
        ret['result'] = None
        return ret
    # Not entirely comfortable with this - no safety checks around pub/priv, VPCs
    # or anything else.  But this is all the module function exposes, so hmph.
    # Inclined to put it on the "wait 'til we port to boto3" pile in any case :)
    if __salt__['boto_route53.delete_zone'](
            zone=domain_name, region=region, key=key, keyid=keyid,
            profile=profile):
        ret['comment'] = 'Route53 Hosted Zone {0} deleted'.format(domain_name)
        log.info(ret['comment'])
        ret['changes']['old'] = deets
        ret['changes']['new'] = None

    return ret
1292930
def delete(self, dn: str) -> None:
        

        return self._do_with_retry(lambda obj: obj.delete_s(dn))
723030
def _find_limit_hosted_zone(self):
        
        for limit_type in [self.MAX_RRSETS_BY_ZONE,
                           self.MAX_VPCS_ASSOCIATED_BY_ZONE]:
            self.limits[limit_type["name"]]._reset_usage()

        for hosted_zone in self._get_hosted_zones():
            for limit_type in [self.MAX_RRSETS_BY_ZONE,
                               self.MAX_VPCS_ASSOCIATED_BY_ZONE]:

                if limit_type == self.MAX_VPCS_ASSOCIATED_BY_ZONE and \
                        not hosted_zone["Config"]["PrivateZone"]:
                    continue

                limit = self._get_hosted_zone_limit(limit_type["type"],
                                                    hosted_zone['Id'])

                self.limits[limit_type["name"]]._add_current_usage(
                    int(limit["Count"]),
                    maximum=int(limit["Limit"]["Value"]),
                    aws_type='AWS::Route53::HostedZone',
                    resource_id=hosted_zone["Name"]
                )
255619
def parse_delete(prs, conn):
    
    prs_delete = prs.add_parser(
        'delete', help='delete a record of specific zone')
    set_option(prs_delete, 'domain')
    conn_options(prs_delete, conn)
    prs_delete.set_defaults(func=delete)
813365
def delete_policy(vhost, name, runas=None):
    '''
    
    '''
    if runas is None and not salt.utils.platform.is_windows():
        runas = salt.utils.user.get_user()
    res = __salt__['cmd.run_all'](
        [RABBITMQCTL, 'clear_policy', '-p', vhost, name],
        reset_system_locale=False,
        runas=runas,
        python_shell=False)
    log.debug('Delete policy: %s', res['stdout'])
    return _format_response(res, 'Deleted')