Container for the parameters to the DescribeJob operation.

This operation returns information about a job you previously initiated, including the job initiation date, the user who initiated the job, the job status code/message and the Amazon SNS topic to notify after Amazon Glacier completes the job. For more information about initiating a job, see InitiateJob.

NOTE: This operation enables you to check the status of your job. However, it is strongly recommended that you set up an Amazon SNS topic and specify it in your initiate job request so that Amazon Glacier can notify the topic after it completes the job.

A job ID will not expire for at least 24 hours after Amazon Glacier completes the job.

An AWS account has full permission to perform all operations (actions). However, AWS Identity and Access Management (IAM) users don't have any permissions by default. You must grant them explicit permission to perform specific actions. For more information, see Access Control Using AWS Identity and Access Management (IAM) .

For information about the underlying REST API, go to Working with Archives in Amazon Glacier in the Amazon Glacier Developer Guide .

Inheritance: AmazonGlacierRequest
        public static DescribeJobResult describeJob(FolderVaultMapping mapping, string jobId)
        {
            using (AmazonGlacierClient client = new AmazonGlacierClient(mapping.AccessKey, mapping.SecretKey, mapping.Endpoint))
            {
                DescribeJobRequest req = new DescribeJobRequest();
                req.AccountId = "-";
                req.JobId = jobId;
                req.VaultName = mapping.VaultName;

                return client.DescribeJob(req).DescribeJobResult;
            }
        }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Glacier.Model.DescribeJobRequest();

            if (cmdletContext.AccountId != null)
            {
                request.AccountId = cmdletContext.AccountId;
            }
            if (cmdletContext.JobId != null)
            {
                request.JobId = cmdletContext.JobId;
            }
            if (cmdletContext.VaultName != null)
            {
                request.VaultName = cmdletContext.VaultName;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeJob operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeJob operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<DescribeJobResponse> DescribeJobAsync(DescribeJobRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DescribeJobRequestMarshaller();
            var unmarshaller = DescribeJobResponseUnmarshaller.Instance;

            return InvokeAsync<DescribeJobRequest,DescribeJobResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
        internal DescribeJobResponse DescribeJob(DescribeJobRequest request)
        {
            var marshaller = new DescribeJobRequestMarshaller();
            var unmarshaller = DescribeJobResponseUnmarshaller.Instance;

            return Invoke<DescribeJobRequest,DescribeJobResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeJob operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeJob operation on AmazonGlacierClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeJob
        ///         operation.</returns>
        public IAsyncResult BeginDescribeJob(DescribeJobRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new DescribeJobRequestMarshaller();
            var unmarshaller = DescribeJobResponseUnmarshaller.Instance;

            return BeginInvoke<DescribeJobRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeJob operation.
        /// <seealso cref="Amazon.Glacier.IAmazonGlacier.DescribeJob"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeJob operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
		public Task<DescribeJobResponse> DescribeJobAsync(DescribeJobRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DescribeJobRequestMarshaller();
            var unmarshaller = DescribeJobResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, DescribeJobRequest, DescribeJobResponse>(request, marshaller, unmarshaller, signer, cancellationToken);
        }
        /// <summary>
        /// <para>This operation returns information about a job you previously initiated, including the job initiation date, the user who initiated the
        /// job, the job status code/message and the Amazon SNS topic to notify after Amazon Glacier completes the job. For more information about
        /// initiating a job, see InitiateJob. </para> <para><b>NOTE:</b> This operation enables you to check the status of your job. However, it is
        /// strongly recommended that you set up an Amazon SNS topic and specify it in your initiate job request so that Amazon Glacier can notify the
        /// topic after it completes the job. </para> <para>A job ID will not expire for at least 24 hours after Amazon Glacier completes the job.
        /// </para> <para>An AWS account has full permission to perform all operations (actions). However, AWS Identity and Access Management (IAM)
        /// users don't have any permissions by default. You must grant them explicit permission to perform specific actions. For more information, see
        /// <a href="http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html">Access Control Using AWS Identity and
        /// Access Management (IAM)</a> .</para> <para> For information about the underlying REST API, go to <a href="http://docs.aws.amazon.com/amazonglacier/latest/dev/api-describe-job-get.html">Working with Archives in Amazon Glacier</a> in the
        /// <i>Amazon Glacier Developer Guide</i> .
        /// </para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeJob service method on AmazonGlacier.</param>
        /// 
        /// <returns>The response from the DescribeJob service method, as returned by AmazonGlacier.</returns>
        /// 
        /// <exception cref="T:Amazon.Glacier.Model.ResourceNotFoundException" />
        /// <exception cref="T:Amazon.Glacier.Model.MissingParameterValueException" />
        /// <exception cref="T:Amazon.Glacier.Model.ServiceUnavailableException" />
        /// <exception cref="T:Amazon.Glacier.Model.InvalidParameterValueException" />
		public DescribeJobResponse DescribeJob(DescribeJobRequest request)
        {
            var task = DescribeJobAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
Exemple #8
0
        public GlacierArchiveInfo ArchiveInfo(string jobId)
        {
            DescribeJobRequest describeJobRequest = new DescribeJobRequest()
            {
                AccountId = "-",
                JobId = jobId,
                VaultName = _vault
            };

            DescribeJobResponse response = _amazonGlacierClient.DescribeJob(describeJobRequest);
            return new GlacierArchiveInfo(response.DescribeJobResult);
        }
Exemple #9
0
        public bool JobCompleted(string jobId)
        {
            DescribeJobRequest describeJobRequest = new DescribeJobRequest()
            {
                AccountId = "-",
                JobId = jobId,
                VaultName = _vault
            };

            DescribeJobResponse response = _amazonGlacierClient.DescribeJob(describeJobRequest);
            return response.DescribeJobResult.Completed;
        }
 /// <summary>
 /// <para>This operation returns information about a job you previously initiated, including the job initiation date, the user who initiated the
 /// job, the job status code/message and the Amazon SNS topic to notify after Amazon Glacier completes the job. For more information about
 /// initiating a job, see InitiateJob. </para> <para><b>NOTE:</b> This operation enables you to check the status of your job. However, it is
 /// strongly recommended that you set up an Amazon SNS topic and specify it in your initiate job request so that Amazon Glacier can notify the
 /// topic after it completes the job. </para> <para>A job ID will not expire for at least 24 hours after Amazon Glacier completes the job.
 /// </para> <para>An AWS account has full permission to perform all operations (actions). However, AWS Identity and Access Management (IAM)
 /// users don't have any permissions by default. You must grant them explicit permission to perform specific actions. For more information, see
 /// Access Control Using AWS Identity and Access Management (IAM).</para> <para> For information about the underlying REST API, go to Working
 /// with Archives in Amazon Glacier in the <i>Amazon Glacier Developer Guide</i> .
 /// </para>
 /// </summary>
 /// 
 /// <param name="describeJobRequest">Container for the necessary parameters to execute the DescribeJob service method on AmazonGlacier.</param>
 /// 
 /// <returns>The response from the DescribeJob service method, as returned by AmazonGlacier.</returns>
 /// 
 /// <exception cref="ResourceNotFoundException"/>
 /// <exception cref="MissingParameterValueException"/>
 /// <exception cref="ServiceUnavailableException"/>
 /// <exception cref="InvalidParameterValueException"/>
 public DescribeJobResponse DescribeJob(DescribeJobRequest describeJobRequest)
 {
     IAsyncResult asyncResult = invokeDescribeJob(describeJobRequest, null, null, true);
     return EndDescribeJob(asyncResult);
 }
 /// <summary>
 /// Initiates the asynchronous execution of the DescribeJob operation.
 /// <seealso cref="Amazon.Glacier.AmazonGlacier.DescribeJob"/>
 /// </summary>
 /// 
 /// <param name="describeJobRequest">Container for the necessary parameters to execute the DescribeJob operation on AmazonGlacier.</param>
 /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
 /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
 ///          procedure using the AsyncState property.</param>
 /// 
 /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDescribeJob
 ///         operation.</returns>
 public IAsyncResult BeginDescribeJob(DescribeJobRequest describeJobRequest, AsyncCallback callback, object state)
 {
     return invokeDescribeJob(describeJobRequest, callback, state, false);
 }
 IAsyncResult invokeDescribeJob(DescribeJobRequest describeJobRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new DescribeJobRequestMarshaller().Marshall(describeJobRequest);
     var unmarshaller = DescribeJobResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
        /// <summary>
        /// <para>This operation returns information about a job you previously initiated, including the job initiation date, the user who initiated the
        /// job, the job status code/message and the Amazon SNS topic to notify after Amazon Glacier completes the job. For more information about
        /// initiating a job, see InitiateJob. </para> <para><b>NOTE:</b> This operation enables you to check the status of your job. However, it is
        /// strongly recommended that you set up an Amazon SNS topic and specify it in your initiate job request so that Amazon Glacier can notify the
        /// topic after it completes the job. </para> <para>A job ID will not expire for at least 24 hours after Amazon Glacier completes the job.
        /// </para> <para>An AWS account has full permission to perform all operations (actions). However, AWS Identity and Access Management (IAM)
        /// users don't have any permissions by default. You must grant them explicit permission to perform specific actions. For more information, see
        /// <a href="http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html">Access Control Using AWS Identity and
        /// Access Management (IAM)</a> .</para> <para> For information about the underlying REST API, go to <a href="http://docs.aws.amazon.com/amazonglacier/latest/dev/api-describe-job-get.html">Working with Archives in Amazon Glacier</a> in the
        /// <i>Amazon Glacier Developer Guide</i> .
        /// </para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeJob service method on AmazonGlacier.</param>
        /// 
        /// <returns>The response from the DescribeJob service method, as returned by AmazonGlacier.</returns>
        /// 
        /// <exception cref="T:Amazon.Glacier.Model.ResourceNotFoundException" />
        /// <exception cref="T:Amazon.Glacier.Model.MissingParameterValueException" />
        /// <exception cref="T:Amazon.Glacier.Model.ServiceUnavailableException" />
        /// <exception cref="T:Amazon.Glacier.Model.InvalidParameterValueException" />
		public DescribeJobResponse DescribeJob(DescribeJobRequest request)
        {
            var task = DescribeJobAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
        private static bool IsInventoryReady(string jobId, string vaultName)
        {
            using (IAmazonGlacier client = new AmazonGlacierClient(RegionEndpoint.EUWest1))
            {
                DescribeJobRequest request = new DescribeJobRequest()
                {
                    JobId = jobId,
                    VaultName = vaultName
                };

                DescribeJobResponse response = client.DescribeJob(request);
                return response.Completed;
            }
        }
 private Amazon.Glacier.Model.DescribeJobResponse CallAWSServiceOperation(IAmazonGlacier client, Amazon.Glacier.Model.DescribeJobRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Glacier", "DescribeJob");
     try
     {
         #if DESKTOP
         return(client.DescribeJob(request));
         #elif CORECLR
         return(client.DescribeJobAsync(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;
     }
 }
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeJob operation.
        /// <seealso cref="Amazon.Glacier.IAmazonGlacier.DescribeJob"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DescribeJob operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
		public async Task<DescribeJobResponse> DescribeJobAsync(DescribeJobRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DescribeJobRequestMarshaller();
            var unmarshaller = DescribeJobResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, DescribeJobRequest, DescribeJobResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }