delete_topic ( $topic_arn, $opt )

The DeleteTopic action deletes a topic and all its subscriptions. Deleting a topic might prevent some messages previously sent to the topic from being delivered to subscribers. This action is idempotent, so deleting a topic that does not exist will not result in an error.

Access

public

Parameters

Parameter

Type

Required

Description

$topic_arn

string

Required

The ARN of the topic you want to delete.

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Delete a topic.

$sns = new AmazonSNS();

// Delete a topic
$response = $sns->delete_topic('arn:aws:sns:us-east-1:9876543210:example-topic');

// Success?
var_dump($response->isOK());
Result:
bool(true)

Related Methods

Source

Method defined in services/sns.class.php | Toggle source view (7 lines) | View on GitHub

public function delete_topic($topic_arn, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['TopicArn'] = $topic_arn;
    
    return $this->authenticate('DeleteTopic', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback