Container for the parameters to the DisableAlarmActions operation.

Disables actions for the specified alarms. When an alarm's actions are disabled the alarm's state may change, but none of the alarm's actions will execute.

Inheritance: Amazon.Runtime.AmazonWebServiceRequest
コード例 #1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.CloudWatch.Model.DisableAlarmActionsRequest();

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

            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);
        }
コード例 #2
0
 /// <summary>
 /// <para> Disables actions for the specified alarms. When an alarm's
 /// actions are disabled the alarm's state may change, but none of the
 /// alarm's actions will execute. </para>
 /// </summary>
 /// 
 /// <param name="disableAlarmActionsRequest">Container for the necessary
 ///           parameters to execute the DisableAlarmActions service method on
 ///           AmazonCloudWatch.</param>
 /// 
 public DisableAlarmActionsResponse DisableAlarmActions(DisableAlarmActionsRequest disableAlarmActionsRequest)
 {
     IRequest<DisableAlarmActionsRequest> request = new DisableAlarmActionsRequestMarshaller().Marshall(disableAlarmActionsRequest);
     DisableAlarmActionsResponse response = Invoke<DisableAlarmActionsRequest, DisableAlarmActionsResponse> (request, this.signer, DisableAlarmActionsResponseUnmarshaller.GetInstance());
     return response;
 }
コード例 #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the DisableAlarmActions operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DisableAlarmActions operation on AmazonCloudWatchClient.</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 EndDisableAlarmActions
        ///         operation.</returns>
        public IAsyncResult BeginDisableAlarmActions(DisableAlarmActionsRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new DisableAlarmActionsRequestMarshaller();
            var unmarshaller = DisableAlarmActionsResponseUnmarshaller.Instance;

            return BeginInvoke<DisableAlarmActionsRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
コード例 #4
0
        /// <summary>
        /// Disables actions for the specified alarms. When an alarm's actions are disabled the
        /// alarm's state may change, but none of the alarm's actions will execute.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DisableAlarmActions service method.</param>
        /// 
        /// <returns>The response from the DisableAlarmActions service method, as returned by CloudWatch.</returns>
        public DisableAlarmActionsResponse DisableAlarmActions(DisableAlarmActionsRequest request)
        {
            var marshaller = new DisableAlarmActionsRequestMarshaller();
            var unmarshaller = DisableAlarmActionsResponseUnmarshaller.Instance;

            return Invoke<DisableAlarmActionsRequest,DisableAlarmActionsResponse>(request, marshaller, unmarshaller);
        }
コード例 #5
0
        /// <summary>
        /// <para> Disables actions for the specified alarms. When an alarm's actions are disabled the alarm's state may change, but none of the alarm's
        /// actions will execute. </para>
        /// </summary>
        /// 
        /// <param name="disableAlarmActionsRequest">Container for the necessary parameters to execute the DisableAlarmActions service method on
        /// AmazonCloudWatch.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<DisableAlarmActionsResponse> DisableAlarmActionsAsync(DisableAlarmActionsRequest disableAlarmActionsRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DisableAlarmActionsRequestMarshaller();
            var unmarshaller = DisableAlarmActionsResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, DisableAlarmActionsRequest, DisableAlarmActionsResponse>(disableAlarmActionsRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
コード例 #6
0
		internal DisableAlarmActionsResponse DisableAlarmActions(DisableAlarmActionsRequest request)
        {
            var task = DisableAlarmActionsAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
コード例 #7
0
        /// <summary>
        /// <para> Disables actions for the specified alarms. When an alarm's actions are disabled the alarm's state may change, but none of the alarm's
        /// actions will execute. </para>
        /// </summary>
        /// 
        /// <param name="disableAlarmActionsRequest">Container for the necessary parameters to execute the DisableAlarmActions service method on
        /// AmazonCloudWatch.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public async Task<DisableAlarmActionsResponse> DisableAlarmActionsAsync(DisableAlarmActionsRequest disableAlarmActionsRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DisableAlarmActionsRequestMarshaller();
            var unmarshaller = DisableAlarmActionsResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, DisableAlarmActionsRequest, DisableAlarmActionsResponse>(disableAlarmActionsRequest, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }
コード例 #8
0
        /// <summary>
        /// Initiates the asynchronous execution of the EnableAlarmActions operation.
        /// <seealso cref="Amazon.CloudWatch.AmazonCloudWatch.EnableAlarmActions"/>
        /// </summary>
        /// 
        /// <param name="enableAlarmActionsRequest">Container for the necessary parameters to execute the EnableAlarmActions operation on
        ///          AmazonCloudWatch.</param>
コード例 #9
0
 /// 
 /// <param name="asyncResult">The IAsyncResult returned by the call to BeginGetMetricStatistics.</param>
 /// 
 /// <returns>Returns a GetMetricStatisticsResult from AmazonCloudWatch.</returns>
 public GetMetricStatisticsResponse EndGetMetricStatistics(IAsyncResult asyncResult)
 {
     return endOperation<GetMetricStatisticsResponse>(asyncResult);
 }
 
 IAsyncResult invokeGetMetricStatistics(GetMetricStatisticsRequest getMetricStatisticsRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new GetMetricStatisticsRequestMarshaller().Marshall(getMetricStatisticsRequest);
     var unmarshaller = GetMetricStatisticsResponseUnmarshaller.GetInstance();
コード例 #10
0
        public PutMetricDataResponse PutMetricData(PutMetricDataRequest putMetricDataRequest)
        {
            IAsyncResult asyncResult = invokePutMetricData(putMetricDataRequest, null, null, true);
            return EndPutMetricData(asyncResult);
        }

        

        /// <summary>
        /// Initiates the asynchronous execution of the PutMetricData operation.
        /// <seealso cref="Amazon.CloudWatch.AmazonCloudWatch.PutMetricData"/>
        /// </summary>
        /// 
        /// <param name="putMetricDataRequest">Container for the necessary parameters to execute the PutMetricData operation on
コード例 #11
0
		internal DisableAlarmActionsResponse DisableAlarmActions(DisableAlarmActionsRequest request)
        {
            var task = DisableAlarmActionsAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
コード例 #12
0
        /// <summary>
        /// Initiates the asynchronous execution of the DisableAlarmActions operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the DisableAlarmActions 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<DisableAlarmActionsResponse> DisableAlarmActionsAsync(DisableAlarmActionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new DisableAlarmActionsRequestMarshaller();
            var unmarshaller = DisableAlarmActionsResponseUnmarshaller.Instance;

            return InvokeAsync<DisableAlarmActionsRequest,DisableAlarmActionsResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
コード例 #13
0
ファイル: CloudWatchSamples.cs プロジェクト: aws/aws-sdk-net
    public static void CWDisableAlarmActions()
    {
      #region CWDisableAlarmActions
      var client = new AmazonCloudWatchClient();

      var request = new DisableAlarmActionsRequest
      {
        AlarmNames = new List<string>() 
          { "awseb-e-kkbEXAMPLE-stack-CloudwatchAlarmLow-1WVXD9EXAMPLE" }
      };

      client.DisableAlarmActions(request);
      #endregion
    }
コード例 #14
0
 private Amazon.CloudWatch.Model.DisableAlarmActionsResponse CallAWSServiceOperation(IAmazonCloudWatch client, Amazon.CloudWatch.Model.DisableAlarmActionsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CloudWatch", "DisableAlarmActions");
     try
     {
         #if DESKTOP
         return(client.DisableAlarmActions(request));
         #elif CORECLR
         return(client.DisableAlarmActionsAsync(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;
     }
 }