AWS 文档 SDK 示例
将 DeleteVaultNotifications 与 AWS SDK 或 CLI 配合使用
以下代码示例演示如何使用 DeleteVaultNotifications。
- CLI
-
- AWS CLI
-
删除文件库的 SNS 通知
以下
delete-vault-notifications示例演示了如何删除 Amazon Simple Notification Service (Amazon SNS) 针对指定文件库发送的通知。aws glacier delete-vault-notifications \ --account-id111122223333\ --vault-nameexample_vault此命令不生成任何输出。
-
有关 API 详细信息,请参阅《AWS CLI 命令参考》中的 DeleteVaultNotifications
。
-
- Python
-
- 适用于 Python 的 SDK (Boto3)
-
注意
查看 GitHub,了解更多信息。在 AWS 代码示例存储库
中查找完整示例,了解如何进行设置和运行。 class GlacierWrapper: """Encapsulates Amazon S3 Glacier API operations.""" def __init__(self, glacier_resource): """ :param glacier_resource: A Boto3 Amazon S3 Glacier resource. """ self.glacier_resource = glacier_resource @staticmethod def stop_notifications(notification): """ Stops notifications to the configured Amazon SNS topic. :param notification: The notification configuration to remove. """ try: notification.delete() logger.info("Notifications stopped.") except ClientError: logger.exception("Couldn't stop notifications.") raise-
有关 API 详细信息,请参阅《AWS SDK for Python(Boto3)API Reference》中的 DeleteVaultNotifications。
-
DeleteVault
DescribeJob