

 **このページは、ボールトと 2012 年リリース当時の REST API を使用する、Amazon Glacier サービスの既存のお客様のみを対象としています。**

アーカイブストレージソリューションをお探しの場合は、Amazon S3 の Amazon Glacier ストレージクラス (S3 Glacier Instant Retrieval、S3 Glacier Flexible Retrieval、S3 Glacier Deep Archive) を使用することをお勧めします。これらのストレージオプションの詳細については、「[Amazon Glacier ストレージクラス](https://aws.amazon.com/s3/storage-classes/glacier/)」を参照してください。

Amazon Glacier (元のスタンドアロンボールトベースのサービス) は、新規顧客を受け入れなくなりました。Amazon Glacier は、ボールトにデータを保存する独自の API を備えたスタンドアロンサービスであり、Amazon S3 および Amazon S3 Glacier ストレージクラスとは異なります。既存のデータは Amazon Glacier で無期限に安全性が確保され、引き続きアクセス可能です。移行は必要ありません。低コストの長期アーカイブストレージの場合、 は [Amazon S3 Glacier ストレージクラス](https://aws.amazon.com/s3/storage-classes/glacier/) AWS を推奨します。これにより、S3 バケットベースの APIs、低コスト、 AWS サービス統合で優れたカスタマーエクスペリエンスを実現できます。 AWS リージョン 拡張機能が必要な場合は、[Amazon Glacier ボールトから Amazon S3 Glacier ストレージクラスにデータを転送するためのAWS ソリューションガイダンス](https://aws.amazon.com/solutions/guidance/data-transfer-from-amazon-s3-glacier-vaults-to-amazon-s3/)を使用して、Amazon S3 Glacier ストレージクラスへの移行を検討してください。

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# を使用して Amazon Glacier のボールトからアーカイブをダウンロードする AWS SDK for .NET
<a name="getting-started-download-archive-dotnet"></a>

次の C\$1 コード例では、 の高レベル API を使用して AWS SDK for .NET 、 で以前にアップロードしたアーカイブをダウンロードします[を使用して Amazon Glacier のボールトにアーカイブをアップロードする AWS SDK for .NET](getting-started-upload-archive-dotnet.md)。このコード例では、以下の点に注意してください。

 
+ この例では、指定された Amazon Glacier リージョンのエンドポイントに対して、`ArchiveTransferManager` クラスのインスタンスを作成します。
+ このコード例では、以前に「[ステップ 2: Amazon Glacier でボールトを作成する](getting-started-create-vault.md)」でボールトを作成した場所に合わせて、 リージョン 米国西部(オレゴン) (`us-west-2`) を使用します。
+ この例では、`ArchiveTransferManager` クラスの `Download` API オペレーションを使用してアーカイブをダウンロードしています。この例は、Amazon Simple Notification Service (Amazon SNS) トピックと、そのトピックにサブスクライブされている Amazon Simple Queue Service (Amazon SQS) キューを作成します。の指示に従って AWS Identity and Access Management (IAM) 管理者ユーザーを作成した場合[ステップ 1: Amazon Glacier を使用する前に](getting-started-before-you-begin.md)、ユーザーには Amazon SNS トピックと Amazon SQS キューの作成と使用に必要な IAM アクセス許可があります。
+ その後、この例ではアーカイブの取り出しジョブを開始し、使用可能にするアーカイブを探してキューをポーリングします。アーカイブが使用可能になると、ダウンロードが開始されます。取得時間に関する詳細については、「[アーカイブの取り出しオプション](downloading-an-archive-two-steps.md#api-downloading-an-archive-two-steps-retrieval-options)」を参照してください。

この例を実行するための詳しい手順については、「[コード例の実行](using-aws-sdk-for-dot-net.md#setting-up-and-testing-sdk-dotnet)」を参照してください。ここに示したコードは、「[ステップ 3: Amazon Glacier でボールトにアーカイブをアップロードする](getting-started-upload-archive.md)」でアップロードしたファイルのアーカイブ ID で更新する必要があります。

**Example — の高レベル API を使用してアーカイブをダウンロードする AWS SDK for .NET**  <a name="GS_ExampleDownloadArchiveDotNet"></a>

```
using System;
using Amazon.Glacier;
using Amazon.Glacier.Transfer;
using Amazon.Runtime;

namespace glacier.amazon.com.rproxy.govskope.us.docsamples
{
    class ArchiveDownloadHighLevel_GettingStarted
    {
        static string vaultName = "examplevault";
        static string archiveId = "*** Provide archive ID ***";
        static string downloadFilePath = "*** Provide the file name and path to where to store the download ***";

        public static void Main(string[] args)
        {
            try
            {
                var manager = new ArchiveTransferManager(Amazon.RegionEndpoint.USWest2);

                var options = new DownloadOptions();
                options.StreamTransferProgress += ArchiveDownloadHighLevel_GettingStarted.progress;
                // Download an archive.
                Console.WriteLine("Intiating the archive retrieval job and then polling SQS queue for the archive to be available.");
                Console.WriteLine("Once the archive is available, downloading will begin.");
                manager.Download(vaultName, archiveId, downloadFilePath, options);
                Console.WriteLine("To continue, press Enter");
                Console.ReadKey();
            }
            catch (AmazonGlacierException e) { Console.WriteLine(e.Message); }
            catch (AmazonServiceException e) { Console.WriteLine(e.Message); }
            catch (Exception e) { Console.WriteLine(e.Message); }
            Console.WriteLine("To continue, press Enter");
            Console.ReadKey();
        }

        static int currentPercentage = -1;
        static void progress(object sender, StreamTransferProgressArgs args)
        {
            if (args.PercentDone != currentPercentage)
            {
                currentPercentage = args.PercentDone;
                Console.WriteLine("Downloaded {0}%", args.PercentDone);
            }
        }
    }
}
```