

 **此页面仅适用于使用文件库和 2012 年原始 REST API 的 Amazon Glacier 服务的现有客户。**

如果您正在寻找归档存储解决方案，建议使用 Amazon S3 中的 Amazon Glacier 存储类别 S3 Glacier Instant Retrieval、S3 Glacier Flexible Retrieval 和 S3 Glacier Deep Archive。要了解有关这些存储选项的更多信息，请参阅 [Amazon Glacier 存储类别](https://www.amazonaws.cn/s3/storage-classes/glacier/)。

Amazon Glacier（最初基于保管库的独立服务）不再接受新客户。Amazon Glacier 是一项独立的服务 APIs ，拥有自己的服务，可将数据存储在文件库中，不同于亚马逊 S3 和 Amazon S3 Glacier 存储类别。在 Amazon Glacier 中，您现有的数据将确保安全，并且可以无限期地访问。无需进行迁移。对于低成本、长期的存档存储， Amazon 建议[使用 Amazon S3 Glacier 存储类别，这些存储类别](https://www.amazonaws.cn/s3/storage-classes/glacier/)基于S3存储桶 APIs、完全 Amazon Web Services 区域 可用性、更低的成本和 Amazon 服务集成，可提供卓越的客户体验。如果您希望加强功能，可以考虑使用我们的 [Amazon 将数据从 Amazon Glacier 文件库传输到 Amazon S3 Glacier 存储类别的解决方案指南](https://www.amazonaws.cn/solutions/guidance/data-transfer-from-amazon-s3-glacier-vaults-to-amazon-s3/)，迁移到 Amazon S3 Glacier 存储类别。

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

# 使用 Amazon Glacier 的代码示例 Amazon SDKs
<a name="service_code_examples"></a>

以下代码示例展示了如何将 Amazon Glacier 与 Amazon 软件开发套件 (SDK) 一起使用。

*操作*是大型程序的代码摘录，必须在上下文中运行。您可以通过操作了解如何调用单个服务函数，还可以通过函数相关场景的上下文查看操作。

*场景*是向您展示如何通过在一个服务中调用多个函数或与其他 Amazon Web Services 服务服务结合来完成特定任务的代码示例。

有关 S Amazon DK 开发者指南和代码示例的完整列表，请参阅[使用带有 Amazon SDK 的 Amazon Glacier](sdk-general-information-section.md)。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。

**Contents**
+ [基本功能](service_code_examples_basics.md)
  + [欢迎使用 Amazon Glacier](example_glacier_Hello_section.md)
  + [操作](service_code_examples_actions.md)
    + [`AddTagsToVault`](example_glacier_AddTagsToVault_section.md)
    + [`CreateVault`](example_glacier_CreateVault_section.md)
    + [`DeleteArchive`](example_glacier_DeleteArchive_section.md)
    + [`DeleteVault`](example_glacier_DeleteVault_section.md)
    + [`DeleteVaultNotifications`](example_glacier_DeleteVaultNotifications_section.md)
    + [`DescribeJob`](example_glacier_DescribeJob_section.md)
    + [`DescribeVault`](example_glacier_DescribeVault_section.md)
    + [`GetJobOutput`](example_glacier_GetJobOutput_section.md)
    + [`GetVaultNotifications`](example_glacier_GetVaultNotifications_section.md)
    + [`InitiateJob`](example_glacier_InitiateJob_section.md)
    + [`ListJobs`](example_glacier_ListJobs_section.md)
    + [`ListTagsForVault`](example_glacier_ListTagsForVault_section.md)
    + [`ListVaults`](example_glacier_ListVaults_section.md)
    + [`SetVaultNotifications`](example_glacier_SetVaultNotifications_section.md)
    + [`UploadArchive`](example_glacier_UploadArchive_section.md)
    + [`UploadMultipartPart`](example_glacier_UploadMultipartPart_section.md)
+ [场景](service_code_examples_scenarios.md)
  + [归档文件，获取通知并启动任务](example_glacier_Usage_UploadNotifyInitiate_section.md)
  + [获取档案内容并删除档案](example_glacier_Usage_RetrieveDelete_section.md)