此頁面僅適用於使用 Vaults 和 2012 年原始 REST API 的 Amazon Glacier 服務的現有客戶。
如果您要尋找封存儲存解決方案,建議您在 Amazon Glacier Instant Retrieval、S3 Glacier Flexible Retrieval 和 S3 Glacier Deep Archive 中使用 Amazon Glacier 儲存類別。 Amazon S3 若要進一步了解這些儲存選項,請參閱 Amazon Glacier 儲存類別。
自 2025 年 12 月 15 日起,Amazon Glacier (原始獨立保存庫型服務) 將不再接受新客戶,不會影響現有客戶。Amazon Glacier 是一項獨立服務,具有自己的 APIs,可將資料存放在保存庫中,並與 Amazon S3 和 Amazon S3 Glacier 儲存類別不同。您現有的資料將在 Amazon Glacier 中無限期保持安全且可存取。不需要遷移。對於低成本、長期的封存儲存, AWS 建議採用 Amazon S3 Glacier 儲存類別,透過 S3 儲存貯體型 APIs、完整 AWS 區域 可用性、降低成本 AWS 和服務整合,提供卓越的客戶體驗。如果您想要增強功能,請考慮使用我們的解決方案指南,將資料從 Amazon S3 Glacier 保存庫傳輸至 Amazon S3 Glacier 儲存類別,以遷移至 Amazon S3 Glacier 儲存類別。 AWS Amazon Glacier Amazon S3
本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
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
-
- SDK for Python (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
如需 AWS SDK 開發人員指南和程式碼範例的完整清單,請參閱 搭配 AWS SDK 使用 Amazon Glacier 。此主題也包含有關入門的資訊和舊版 SDK 的詳細資訊。