Options for initiating an archive retrieval.
상속: CommonOptions
예제 #1
0
        /// <summary>
        /// This method initiates an archive retieval job for the specified archive and returns back the job id.
        /// Once the job is complete
        /// </summary>
        /// <param name="vaultName">The name of the vault that contains the archive to initiate the job for.</param>
        /// <param name="archiveId">The archive id that the download job will retrieve.</param>
        /// <param name="options">Additional options that can be used for initiating archive retrieval.</param>
        /// <returns>The job id for the initiated job.</returns>
        public async Task <string> InitiateArchiveRetrievalJobAsync(string vaultName, string archiveId, InitiateArchiveRetrievalOptions options)
        {
            InitiateJobRequest jobRequest = new InitiateJobRequest()
            {
                VaultName     = vaultName,
                JobParameters = new JobParameters()
                {
                    ArchiveId = archiveId,
                    Type      = "archive-retrieval"
                }
            };

            if (options != null)
            {
                jobRequest.AccountId = options.AccountId;
                jobRequest.JobParameters.SNSTopic = options.SNSTopic;
                jobRequest.JobParameters.Tier     = options.Tier;
            }

            var glacierClientTask = await glacierClient.InitiateJobAsync(jobRequest).ConfigureAwait(false);

            return(glacierClientTask.JobId);
        }
        /// <summary>
        /// This method initiates an archive retieval job for the specified archive and returns back the job id.
        /// Once the is complete
        /// </summary>
        /// <param name="vaultName">The name of the vault that contains the archive to initiate the job for.</param>
        /// <param name="archiveId">The archive id that the download job will retrieve.</param>
        /// <param name="options">Additional options that can be used for initiating archive retrieval.</param>
        /// <returns>The job id for the initiated job.</returns>
        public string InitiateArchiveRetrievalJob(string vaultName, string archiveId, InitiateArchiveRetrievalOptions options)
        {
            InitiateJobRequest jobRequest = new InitiateJobRequest()
            {
                VaultName     = vaultName,
                JobParameters = new JobParameters()
                {
                    ArchiveId = archiveId,
                    Type      = "archive-retrieval"
                }
            };

            if (options != null)
            {
                jobRequest.AccountId = options.AccountId;
                jobRequest.JobParameters.SNSTopic = options.SNSTopic;
            }

            var jobId = glacierClient.InitiateJob(jobRequest).JobId;

            return(jobId);
        }
예제 #3
0
        /// <summary>
        /// This method initiates an archive retieval job for the specified archive and returns back the job id.
        /// Once the is complete
        /// </summary>
        /// <param name="vaultName">The name of the vault that contains the archive to initiate the job for.</param>
        /// <param name="archiveId">The archive id that the download job will retrieve.</param>
        /// <param name="options">Additional options that can be used for initiating archive retrieval.</param>
        /// <returns>The job id for the initiated job.</returns>
        public string InitiateArchiveRetrievalJob(string vaultName, string archiveId, InitiateArchiveRetrievalOptions options)
        {
            InitiateJobRequest jobRequest = new InitiateJobRequest()
            {
                VaultName = vaultName,
                JobParameters = new JobParameters()
                {
                    ArchiveId = archiveId,
                    Type = "archive-retrieval"
                }
            };

            if (options != null)
            {
                jobRequest.AccountId = options.AccountId;
                jobRequest.JobParameters.SNSTopic = options.SNSTopic;
            }

            var jobId = glacierClient.InitiateJob(jobRequest).InitiateJobResult.JobId;
            return jobId;
        }
        /// <summary>
        /// This method initiates an archive retieval job for the specified archive and returns back the job id.
        /// Once the job is complete
        /// </summary>
        /// <param name="vaultName">The name of the vault that contains the archive to initiate the job for.</param>
        /// <param name="archiveId">The archive id that the download job will retrieve.</param>
        /// <param name="options">Additional options that can be used for initiating archive retrieval.</param>
        /// <returns>The job id for the initiated job.</returns>
        public async Task<string> InitiateArchiveRetrievalJobAsync(string vaultName, string archiveId, InitiateArchiveRetrievalOptions options)
        { 
            InitiateJobRequest jobRequest = new InitiateJobRequest()
            {
                VaultName = vaultName,
                JobParameters = new JobParameters()
                {
                    ArchiveId = archiveId,
                    Type = "archive-retrieval"
                }
            };

            if (options != null)
            {
                jobRequest.AccountId = options.AccountId;
                jobRequest.JobParameters.SNSTopic = options.SNSTopic;
            }

            var glacierClientTask = await glacierClient.InitiateJobAsync(jobRequest).ConfigureAwait(false);
            return glacierClientTask.JobId;
        }