Deletes a topic. All subscriptions to the topic are also deleted.
(topic)
| 70 | # snippet-start:[python.example_code.sns.DeleteTopic] |
| 71 | @staticmethod |
| 72 | def delete_topic(topic): |
| 73 | """ |
| 74 | Deletes a topic. All subscriptions to the topic are also deleted. |
| 75 | """ |
| 76 | try: |
| 77 | topic.delete() |
| 78 | logger.info("Deleted topic %s.", topic.arn) |
| 79 | except ClientError: |
| 80 | logger.exception("Couldn't delete topic %s.", topic.arn) |
| 81 | raise |
| 82 | |
| 83 | # snippet-end:[python.example_code.sns.DeleteTopic] |
| 84 |