Delete an SNS topic.

    CLI example to delete a topic::

        salt myminion boto_sns.delete mytopic region=us-east-1
322163
def delete(name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    conn.delete_topic(get_arn(name, region, key, keyid, profile))
    log.info('Deleted SNS topic %s', name)
    _invalidate_cache()
    return True
570130
def delete(name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        return conn.delete_stack(name)
    except BotoServerError as e:
        msg = 'Failed to create stack {0}.'.format(name)
        log.error(msg)
        log.debug(e)
        return six.text_type(e)
734451
public int deleteTopic(String topic, String password) throws IOException {
        KV<Receive, ErrorMapping> response = send(new DeleterRequest(topic, password));
        return Utils.deserializeIntArray(response.k.buffer())[0];
    }
1320828
@Override
	public void delete() throws JMSException
    {
        if (connection == null)
            throw new FFMQException("Temporary topic already deleted","TOPIC_DOES_NOT_EXIST");
        
        connection.deleteTemporaryTopic(name);
        connection = null;
    }
1061817
def delete(name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        url = conn.get_queue_url(QueueName=name)['QueueUrl']
        conn.delete_queue(QueueUrl=url)
    except botocore.exceptions.ClientError as e:
        return {'error': __utils__['boto3.get_error'](e)}
    return {'result': True}
188420
def delete(name, wait=False, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)

    try:
        conn.delete_cache_cluster(name)
        if not wait:
            log.info('Deleted cache cluster %s.', name)
            return True
        while True:
            config = get_config(name, region, key, keyid, profile)
            if not config:
                return True
            if config['cache_cluster_status'] == 'deleting':
                return True
            time.sleep(2)
        log.info('Deleted cache cluster %s.', name)
        return True
    except boto.exception.BotoServerError as e:
        msg = 'Failed to delete cache cluster {0}.'.format(name)
        log.error(msg)
        log.debug(e)
        return False
750043
async def unsubscribe(self, topic: str):
        

        req_msg = {
            'type': 'unsubscribe',
            'topic': topic,
            'response': True
        }

        await self._conn.send_message(req_msg)
915018
public function do_delete($topic)
    {
        $redis = is_object($this->_redis) ? $this->_redis : $this->_getRedis();
        foreach ($this->_priorities as $priority) {
            $redis->delete($this->_prefix . $topic . ':' . $priority);
        }
    }
926402
function deleteNetwork() {
			setTimeout(function () {
				//cluster failed, delete network if it was not provided by the user
				let networksOptions = Object.assign({}, options);
				networksOptions.params = {name: oneDeployment.options.network};
				networks.delete(networksOptions, (error) => {
					if (error) {
						options.soajs.log.error(error);
					} else {
						options.soajs.log.debug("VPC Network Deleted Successfully.");
					}
				});
			}, (process.env.SOAJS_CLOOSTRO_TEST) ? 1 : 5 * 60 * 1000);
		}
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}
943057
def remove_async_sns_topic(self, lambda_name):
        
        topic_name = get_topic_name(lambda_name)
        removed_arns = []
        for sub in self.sns_client.list_subscriptions()['Subscriptions']:
            if topic_name in sub['TopicArn']:
                self.sns_client.delete_topic(TopicArn=sub['TopicArn'])
                removed_arns.append(sub['TopicArn'])
        return removed_arns
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)
1190309
def get_sns_topic_arn(topic_name, account, region):
    
    if topic_name.count(':') == 5 and topic_name.startswith('arn:aws:sns:'):
        return topic_name
    session = boto3.Session(profile_name=account, region_name=region)
    sns_client = session.client('sns')

    topics = sns_client.list_topics()['Topics']

    matched_topic = None
    for topic in topics:
        topic_arn = topic['TopicArn']
        if topic_name == topic_arn.split(':')[-1]:
            matched_topic = topic_arn
            break
    else:
        LOG.critical("No topic with name %s found.", topic_name)
        raise SNSTopicNotFound('No topic with name {0} found'.format(topic_name))
    return matched_topic
247773
def _delete_resource(name, name_param, desc, res_type, wait=0, status_param=None,
                     status_gone='deleted', region=None, key=None, keyid=None, profile=None,
                     **args):
    '''
    
    '''
    try:
        wait = int(wait)
    except Exception:
        raise SaltInvocationError("Bad value ('{0}') passed for 'wait' param - must be an "
                                  "int or boolean.".format(wait))
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    if name_param in args:
        log.info(
            "'name: %s' param being overridden by explicitly provided '%s: %s'",
            name, name_param, args[name_param]
        )
        name = args[name_param]
    else:
        args[name_param] = name
    args = dict([(k, v) for k, v in args.items() if not k.startswith('_')])
    try:
        func = 'delete_'+res_type
        f = getattr(conn, func)
        if wait:
            func = 'describe_'+res_type+'s'
            s = globals()[func]
    except (AttributeError, KeyError) as e:
        raise SaltInvocationError("No function '{0}()' found: {1}".format(func, e.message))
    try:

        f(**args)
        if not wait:
            log.info('%s %s deletion requested.', desc.title(), name)
            return True
        log.info('Waiting up to %s seconds for %s %s to be deleted.', wait, desc, name)
        orig_wait = wait
        while wait > 0:
            r = s(name=name, conn=conn)
            if not r or r[0].get(status_param) == status_gone:
                log.info('%s %s deleted.', desc.title(), name)
                return True
            sleep = wait if wait % 60 == wait else 60
            log.info('Sleeping %s seconds for %s %s to be deleted.',
                     sleep, desc, name)
            time.sleep(sleep)
            wait -= sleep
        log.error('%s %s not deleted after %s seconds!', desc.title(), name, orig_wait)

        return False
    except botocore.exceptions.ClientError as e:
        log.error('Failed to delete %s %s: %s', desc, name, e)
        return False
998949
def delete(options = {})
      options = options.merge(
        auto_scaling_group_name: @group_name,
        topic_arn: @topic_arn
      )
      resp = @client.delete_notification_configuration(options)
      resp.data
    end
985821
def remove_node(cls, cluster_id_label, private_dns, parameters=None):
        
        conn = Qubole.agent(version=Cluster.api_version)
        parameters = {} if not parameters else parameters
        data = {"private_dns" : private_dns, "parameters" : parameters}
        return conn.delete(cls.element_path(cluster_id_label) + "/nodes", data)
90533
public void serviceName_topic_topicId_DELETE(String serviceName, String topicId) throws IOException {
		String qPath = "/dbaas/queue/{serviceName}/topic/{topicId}";
		StringBuilder sb = path(qPath, serviceName, topicId);
		exec(qPath, "DELETE", sb.toString(), null);
	}