此页面仅适用于使用 Vaults 和 2012 年原始 REST API 的 Amazon Glacier 服务的现有客户。
如果您正在寻找档案存储解决方案,我们建议您在亚马逊 S3、S3 Glacier 即时检索、S3 Glacier 灵活检索和 S3 Glacier Deep Archive Deep Archive 中使用 Amazon Glacier 存储类。要了解有关这些存储选项的更多信息,请参阅 Amazon Glacier 存储类别。
从 2025 年 12 月 15 日起,Amazon Glacier(最初基于保管库的独立服务)将不再接受新客户,对现有客户不产生任何影响。Amazon Glacier 是一项独立的服务 APIs ,拥有自己的服务,可将数据存储在文件库中,不同于亚马逊 S3 和 Amazon S3 Glacier 存储类别。在 Amazon Glacier 中,您的现有数据将保持安全且可以无限期地访问。无需迁移。对于低成本、长期的存档存储, AWS 建议使用 Amazon S3 Glacier 存储类别,这些存储类别基于S3存储桶 APIs、完全 AWS 区域 可用性、更低的成本和 AWS 服务集成,可提供卓越的客户体验。如果您想要增强功能,可以考虑使用我们的AWS 解决方案指南迁移到 Amazon S3 Glacier 存储类别,将数据从 Amazon Glacier 文件库传输到 Amazon S3 Glacier 存储类。
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
DeleteVaultNotifications与 AWS SDK 或 CLI 配合使用
以下代码示例演示如何使用 DeleteVaultNotifications。
- CLI
-
- AWS CLI
-
删除文件库的 SNS 通知
以下 delete-vault-notifications 示例演示了如何删除 Amazon Simple Notification Service (Amazon SNS) 针对指定文件库发送的通知。
aws glacier delete-vault-notifications \
--account-id 111122223333 \
--vault-name example_vault
此命令不生成任何输出。
- Python
-
- 适用于 Python 的 SDK (Boto3)
-
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
有关 S AWS DK 开发者指南和代码示例的完整列表,请参阅使用带有 AWS SDK 的 Amazon Glacier。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。