

文档 AWS SDK 示例 GitHub 存储库中还有更多 [S AWS DK 示例](https://github.com/awsdocs/aws-doc-sdk-examples)。

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# `DeleteVaultNotifications`与 AWS SDK 或 CLI 配合使用
<a name="glacier_example_glacier_DeleteVaultNotifications_section"></a>

以下代码示例演示如何使用 `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}}
```
此命令不生成任何输出。  
+  有关 API 的详细信息，请参阅*AWS CLI 命令参考[DeleteVaultNotifications](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/glacier/delete-vault-notifications.html)*中的。

------
#### [ Python ]

**适用于 Python 的 SDK（Boto3）**  
 还有更多相关信息 GitHub。在 [AWS 代码示例存储库](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python/example_code/glacier#code-examples)中查找完整示例，了解如何进行设置和运行。

```
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 的详细信息，请参阅适用[DeleteVaultNotifications](https://docs.aws.amazon.com/goto/boto3/glacier-2012-06-01/DeleteVaultNotifications)于 *Python 的AWS SDK (Boto3) API 参考*。

------