Container for the parameters to the ResetCache operation. Resets all cache disks that have encountered a error and makes the disks available for reconfiguration as cache storage. If your cache disk encounters a error, the gateway prevents read and write operations on virtual tapes in the gateway. For example, an error can occur when a disk is corrupted or removed from the gateway. When a cache is reset, the gateway loses its cache storage. At this point you can reconfigure the disks as cache disks.

If the cache disk you are resetting contains data that has not been uploaded to Amazon S3 yet, that data can be lost. After you reset cache disks, there will be no configured cache disks left in the gateway, so you must configure at least one new cache disk for your gateway to function properly.

Inheritance: AmazonStorageGatewayRequest
Esempio n. 1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.StorageGateway.Model.ResetCacheRequest();

            if (cmdletContext.GatewayARN != null)
            {
                request.GatewayARN = cmdletContext.GatewayARN;
            }

            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 ResetCache operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ResetCache operation on AmazonStorageGatewayClient.</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 EndResetCache
        ///         operation.</returns>
        public IAsyncResult BeginResetCache(ResetCacheRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new ResetCacheRequestMarshaller();
            var unmarshaller = ResetCacheResponseUnmarshaller.Instance;

            return BeginInvoke<ResetCacheRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        /// <summary>
        /// Resets all cache disks that have encountered a error and makes the disks available
        /// for reconfiguration as cache storage. If your cache disk encounters a error, the gateway
        /// prevents read and write operations on virtual tapes in the gateway. For example, an
        /// error can occur when a disk is corrupted or removed from the gateway. When a cache
        /// is reset, the gateway loses its cache storage. At this point you can reconfigure the
        /// disks as cache disks.
        /// 
        ///  <important> 
        /// <para>
        /// If the cache disk you are resetting contains data that has not been uploaded to Amazon
        /// S3 yet, that data can be lost. After you reset cache disks, there will be no configured
        /// cache disks left in the gateway, so you must configure at least one new cache disk
        /// for your gateway to function properly.
        /// </para>
        ///  </important>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ResetCache service method.</param>
        /// 
        /// <returns>The response from the ResetCache service method, as returned by StorageGateway.</returns>
        /// <exception cref="Amazon.StorageGateway.Model.InternalServerErrorException">
        /// An internal server error has occurred during the request. For more information, see
        /// the error and message fields.
        /// </exception>
        /// <exception cref="Amazon.StorageGateway.Model.InvalidGatewayRequestException">
        /// An exception occurred because an invalid gateway request was issued to the service.
        /// For more information, see the error and message fields.
        /// </exception>
        public ResetCacheResponse ResetCache(ResetCacheRequest request)
        {
            var marshaller = new ResetCacheRequestMarshaller();
            var unmarshaller = ResetCacheResponseUnmarshaller.Instance;

            return Invoke<ResetCacheRequest,ResetCacheResponse>(request, marshaller, unmarshaller);
        }
 /// <summary>
 /// Resets all cache disks that have encountered a error and makes the disks available
 /// for reconfiguration as cache storage. If your cache disk encounters a error, the gateway
 /// prevents read and write operations on virtual tapes in the gateway. For example, an
 /// error can occur when a disk is corrupted or removed from the gateway. When a cache
 /// is reset, the gateway loses its cache storage. At this point you can reconfigure the
 /// disks as cache disks.
 /// 
 ///  <important> 
 /// <para>
 /// If the cache disk you are resetting contains data that has not been uploaded to Amazon
 /// S3 yet, that data can be lost. After you reset cache disks, there will be no configured
 /// cache disks left in the gateway, so you must configure at least one new cache disk
 /// for your gateway to function properly.
 /// </para>
 ///  </important>
 /// </summary>
 /// <param name="gatewayARN">A property of ResetCacheRequest used to execute the ResetCache service method.</param>
 /// 
 /// <returns>The response from the ResetCache service method, as returned by StorageGateway.</returns>
 /// <exception cref="Amazon.StorageGateway.Model.InternalServerErrorException">
 /// An internal server error has occurred during the request. For more information, see
 /// the error and message fields.
 /// </exception>
 /// <exception cref="Amazon.StorageGateway.Model.InvalidGatewayRequestException">
 /// An exception occurred because an invalid gateway request was issued to the service.
 /// For more information, see the error and message fields.
 /// </exception>
 public ResetCacheResponse ResetCache(string gatewayARN)
 {
     var request = new ResetCacheRequest();
     request.GatewayARN = gatewayARN;
     return ResetCache(request);
 }
        /// <summary>
        /// Initiates the asynchronous execution of the ResetCache operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ResetCache 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<ResetCacheResponse> ResetCacheAsync(ResetCacheRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ResetCacheRequestMarshaller();
            var unmarshaller = ResetCacheResponseUnmarshaller.Instance;

            return InvokeAsync<ResetCacheRequest,ResetCacheResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
 /// <summary>
 /// This operation resets all cache disks that have encountered a error and makes the
 /// disks available for reconfiguration as cache storage. If your cache disk encounters
 /// a error, the gateway prevents read and write operations on virtual tapes in the gateway.
 /// For example, an error can occur when a disk is corrupted or removed from the gateway.
 /// When a cache is reset, the gateway loses its cache storage. At this point you can
 /// reconfigure the disks as cache disks. 
 /// 
 ///  <important> 
 /// <para>
 /// If the cache disk you are resetting contains data that has not been uploaded to Amazon
 /// S3 yet, that data can be lost. After you reset cache disks, there will be no configured
 /// cache disks left in the gateway, so you must configure at least one new cache disk
 /// for your gateway to function properly.
 /// </para>
 ///  </important>
 /// </summary>
 /// <param name="gatewayARN">A property of ResetCacheRequest used to execute the ResetCache service method.</param>
 /// <param name="cancellationToken">
 ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
 /// </param>
 /// 
 /// <returns>The response from the ResetCache service method, as returned by StorageGateway.</returns>
 /// <exception cref="Amazon.StorageGateway.Model.InternalServerErrorException">
 /// An internal server error has occurred during the request. See the error and message
 /// fields for more information.
 /// </exception>
 /// <exception cref="Amazon.StorageGateway.Model.InvalidGatewayRequestException">
 /// An exception occurred because an invalid gateway request was issued to the service.
 /// See the error and message fields for more information.
 /// </exception>
 public Task<ResetCacheResponse> ResetCacheAsync(string gatewayARN, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
 {
     var request = new ResetCacheRequest();
     request.GatewayARN = gatewayARN;
     return ResetCacheAsync(request, cancellationToken);
 }
Esempio n. 7
0
 private Amazon.StorageGateway.Model.ResetCacheResponse CallAWSServiceOperation(IAmazonStorageGateway client, Amazon.StorageGateway.Model.ResetCacheRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Storage Gateway", "ResetCache");
     try
     {
         #if DESKTOP
         return(client.ResetCache(request));
         #elif CORECLR
         return(client.ResetCacheAsync(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;
     }
 }