/// <summary>
        /// Creates or updates an alarm and associates it with the specified Amazon CloudWatch
        /// metric. Optionally, this operation can associate one or more Amazon Simple Notification
        /// Service resources with the alarm.
        ///
        ///
        /// <para>
        ///  When this operation creates an alarm, the alarm state is immediately set to <code>INSUFFICIENT_DATA</code>.
        /// The alarm is evaluated and its <code>StateValue</code> is set appropriately. Any actions
        /// associated with the <code>StateValue</code> is then executed.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the PutMetricAlarm service method.</param>
        ///
        /// <returns>The response from the PutMetricAlarm service method, as returned by CloudWatch.</returns>
        /// <exception cref="Amazon.CloudWatch.Model.LimitExceededException">
        /// The quota for alarms for this customer has already been reached.
        /// </exception>
        public PutMetricAlarmResponse PutMetricAlarm(PutMetricAlarmRequest request)
        {
            var marshaller   = new PutMetricAlarmRequestMarshaller();
            var unmarshaller = PutMetricAlarmResponseUnmarshaller.Instance;

            return(Invoke <PutMetricAlarmRequest, PutMetricAlarmResponse>(request, marshaller, unmarshaller));
        }
Пример #2
0
        internal virtual PutMetricAlarmResponse PutMetricAlarm(PutMetricAlarmRequest request)
        {
            var marshaller   = PutMetricAlarmRequestMarshaller.Instance;
            var unmarshaller = PutMetricAlarmResponseUnmarshaller.Instance;

            return(Invoke <PutMetricAlarmRequest, PutMetricAlarmResponse>(request, marshaller, unmarshaller));
        }
Пример #3
0
        /// <summary>
        /// <para> Creates or updates an alarm and associates it with the specified Amazon CloudWatch metric. Optionally, this operation can associate
        /// one or more Amazon Simple Notification Service resources with the alarm. </para> <para> When this operation creates an alarm, the alarm
        /// state is immediately set to <c>INSUFFICIENT_DATA</c> . The alarm is evaluated and its <c>StateValue</c> is set appropriately. Any actions
        /// associated with the <c>StateValue</c> is then executed. </para> <para><b>NOTE:</b> When updating an existing alarm, its StateValue is left
        /// unchanged. </para>
        /// </summary>
        ///
        /// <param name="putMetricAlarmRequest">Container for the necessary parameters to execute the PutMetricAlarm service method on
        /// AmazonCloudWatch.</param>
        ///
        /// <exception cref="T:Amazon.CloudWatch.Model.LimitExceededException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        public Task <PutMetricAlarmResponse> PutMetricAlarmAsync(PutMetricAlarmRequest putMetricAlarmRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new PutMetricAlarmRequestMarshaller();
            var unmarshaller = PutMetricAlarmResponseUnmarshaller.GetInstance();

            return(Invoke <IRequest, PutMetricAlarmRequest, PutMetricAlarmResponse>(putMetricAlarmRequest, marshaller, unmarshaller, signer, cancellationToken));
        }
Пример #4
0
        /// <summary>
        /// <para> Creates or updates an alarm and associates it with the
        /// specified Amazon CloudWatch metric. Optionally, this operation can
        /// associate one or more Amazon Simple Notification Service resources
        /// with the alarm. </para> <para> When this operation creates an alarm,
        /// the alarm state is immediately set to <c>INSUFFICIENT_DATA</c> . The
        /// alarm is evaluated and its <c>StateValue</c> is set appropriately.
        /// Any actions associated with the <c>StateValue</c> is then executed.
        /// </para> <para><b>NOTE:</b> When updating an existing alarm, its
        /// StateValue is left unchanged. </para>
        /// </summary>
        ///
        /// <param name="putMetricAlarmRequest">Container for the necessary
        ///           parameters to execute the PutMetricAlarm service method on
        ///           AmazonCloudWatch.</param>
        ///
        /// <exception cref="LimitExceededException"/>
        public PutMetricAlarmResponse PutMetricAlarm(PutMetricAlarmRequest putMetricAlarmRequest)
        {
            IRequest <PutMetricAlarmRequest> request  = new PutMetricAlarmRequestMarshaller().Marshall(putMetricAlarmRequest);
            PutMetricAlarmResponse           response = Invoke <PutMetricAlarmRequest, PutMetricAlarmResponse> (request, this.signer, PutMetricAlarmResponseUnmarshaller.GetInstance());

            return(response);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the PutMetricAlarm operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the PutMetricAlarm 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 <PutMetricAlarmResponse> PutMetricAlarmAsync(PutMetricAlarmRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new PutMetricAlarmRequestMarshaller();
            var unmarshaller = PutMetricAlarmResponseUnmarshaller.Instance;

            return(InvokeAsync <PutMetricAlarmRequest, PutMetricAlarmResponse>(request, marshaller,
                                                                               unmarshaller, cancellationToken));
        }
Пример #6
0
 IAsyncResult invokePutMetricAlarm(PutMetricAlarmRequest putMetricAlarmRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new PutMetricAlarmRequestMarshaller().Marshall(putMetricAlarmRequest);
     var unmarshaller = PutMetricAlarmResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
Пример #7
0
        /// <summary>
        /// Initiates the asynchronous execution of the PutMetricAlarm operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the PutMetricAlarm 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>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutMetricAlarm">REST API Reference for PutMetricAlarm Operation</seealso>
        public virtual Task <PutMetricAlarmResponse> PutMetricAlarmAsync(PutMetricAlarmRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = PutMetricAlarmRequestMarshaller.Instance;
            options.ResponseUnmarshaller = PutMetricAlarmResponseUnmarshaller.Instance;

            return(InvokeAsync <PutMetricAlarmResponse>(request, options, cancellationToken));
        }
Пример #8
0
        internal virtual PutMetricAlarmResponse PutMetricAlarm(PutMetricAlarmRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = PutMetricAlarmRequestMarshaller.Instance;
            options.ResponseUnmarshaller = PutMetricAlarmResponseUnmarshaller.Instance;

            return(Invoke <PutMetricAlarmResponse>(request, options));
        }
Пример #9
0
        internal PutMetricAlarmResponse PutMetricAlarm(PutMetricAlarmRequest request)
        {
            var task = PutMetricAlarmAsync(request);

            try
            {
                return(task.Result);
            }
            catch (AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return(null);
            }
        }
Пример #10
0
 /// <summary>
 /// Initiates the asynchronous execution of the PutMetricAlarm operation.
 /// <seealso cref="Amazon.CloudWatch.AmazonCloudWatch.PutMetricAlarm"/>
 /// </summary>
 ///
 /// <param name="putMetricAlarmRequest">Container for the necessary parameters to execute the PutMetricAlarm operation on
 ///          AmazonCloudWatch.</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>
 public IAsyncResult BeginPutMetricAlarm(PutMetricAlarmRequest putMetricAlarmRequest, AsyncCallback callback, object state)
 {
     return(invokePutMetricAlarm(putMetricAlarmRequest, callback, state, false));
 }
Пример #11
0
        /// <summary>
        /// <para> Creates or updates an alarm and associates it with the specified Amazon CloudWatch metric. Optionally, this operation can associate
        /// one or more Amazon Simple Notification Service resources with the alarm. </para> <para> When this operation creates an alarm, the alarm
        /// state is immediately set to <c>INSUFFICIENT_DATA</c> . The alarm is evaluated and its <c>StateValue</c> is set appropriately. Any actions
        /// associated with the <c>StateValue</c> is then executed. </para> <para><b>NOTE:</b> When updating an existing alarm, its StateValue is left
        /// unchanged. </para>
        /// </summary>
        ///
        /// <param name="putMetricAlarmRequest">Container for the necessary parameters to execute the PutMetricAlarm service method on
        ///          AmazonCloudWatch.</param>
        ///
        /// <exception cref="LimitExceededException"/>
        public PutMetricAlarmResponse PutMetricAlarm(PutMetricAlarmRequest putMetricAlarmRequest)
        {
            IAsyncResult asyncResult = invokePutMetricAlarm(putMetricAlarmRequest, null, null, true);

            return(EndPutMetricAlarm(asyncResult));
        }