public string RequestDownload(string id)
        {
            var jobRequest = new InitiateJobRequest()
            {
                VaultName     = this.VaultName,
                JobParameters = new JobParameters()
                {
                    Type      = "archive-retrieval",
                    ArchiveId = id
                }
            };

            var jobResponse = Service.InitiateJob(jobRequest);

            return(jobResponse.JobId);
        }
        public void GlacierInitiateJob()
        {
            #region to-initiate-an-inventory-retrieval-job-1482186883826

            var response = client.InitiateJob(new InitiateJobRequest
            {
                AccountId     = "-",
                JobParameters = new JobParameters {
                    Description = "My inventory job",
                    Format      = "CSV",
                    SNSTopic    = "arn:aws:sns:us-west-2:111111111111:Glacier-InventoryRetrieval-topic-Example",
                    Type        = "inventory-retrieval"
                },
                VaultName = "examplevault"
            });

            string jobId    = response.JobId;
            string location = response.Location;

            #endregion
        }
        /// <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);
        }
 private Amazon.Glacier.Model.InitiateJobResponse CallAWSServiceOperation(IAmazonGlacier client, Amazon.Glacier.Model.InitiateJobRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Glacier", "InitiateJob");
     try
     {
         #if DESKTOP
         return(client.InitiateJob(request));
         #elif CORECLR
         return(client.InitiateJobAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }