/// <summary> /// Retrieves all alarms for a single metric. Specify a statistic, period, or unit to /// filter the set of alarms further. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeAlarmsForMetric service method.</param> /// /// <returns>The response from the DescribeAlarmsForMetric service method, as returned by CloudWatch.</returns> public DescribeAlarmsForMetricResponse DescribeAlarmsForMetric(DescribeAlarmsForMetricRequest request) { var marshaller = new DescribeAlarmsForMetricRequestMarshaller(); var unmarshaller = DescribeAlarmsForMetricResponseUnmarshaller.Instance; return(Invoke <DescribeAlarmsForMetricRequest, DescribeAlarmsForMetricResponse>(request, marshaller, unmarshaller)); }
/// <summary> /// <para> Retrieves all alarms for a single metric. Specify a statistic, period, or unit to filter the set of alarms further. </para> /// </summary> /// /// <param name="describeAlarmsForMetricRequest">Container for the necessary parameters to execute the DescribeAlarmsForMetric service method on /// AmazonCloudWatch.</param> /// /// <returns>The response from the DescribeAlarmsForMetric service method, as returned by AmazonCloudWatch.</returns> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task <DescribeAlarmsForMetricResponse> DescribeAlarmsForMetricAsync(DescribeAlarmsForMetricRequest describeAlarmsForMetricRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeAlarmsForMetricRequestMarshaller(); var unmarshaller = DescribeAlarmsForMetricResponseUnmarshaller.GetInstance(); return(Invoke <IRequest, DescribeAlarmsForMetricRequest, DescribeAlarmsForMetricResponse>(describeAlarmsForMetricRequest, marshaller, unmarshaller, signer, cancellationToken)); }
internal virtual DescribeAlarmsForMetricResponse DescribeAlarmsForMetric(DescribeAlarmsForMetricRequest request) { var marshaller = DescribeAlarmsForMetricRequestMarshaller.Instance; var unmarshaller = DescribeAlarmsForMetricResponseUnmarshaller.Instance; return(Invoke <DescribeAlarmsForMetricRequest, DescribeAlarmsForMetricResponse>(request, marshaller, unmarshaller)); }
/// <summary> /// <para> Retrieves all alarms for a single metric. Specify a statistic, /// period, or unit to filter the set of alarms further. </para> /// </summary> /// /// <param name="describeAlarmsForMetricRequest">Container for the /// necessary parameters to execute the DescribeAlarmsForMetric service /// method on AmazonCloudWatch.</param> /// /// <returns>The response from the DescribeAlarmsForMetric service method, /// as returned by AmazonCloudWatch.</returns> /// public DescribeAlarmsForMetricResponse DescribeAlarmsForMetric(DescribeAlarmsForMetricRequest describeAlarmsForMetricRequest) { IRequest <DescribeAlarmsForMetricRequest> request = new DescribeAlarmsForMetricRequestMarshaller().Marshall(describeAlarmsForMetricRequest); DescribeAlarmsForMetricResponse response = Invoke <DescribeAlarmsForMetricRequest, DescribeAlarmsForMetricResponse> (request, this.signer, DescribeAlarmsForMetricResponseUnmarshaller.GetInstance()); return(response); }
/// <summary> /// Initiates the asynchronous execution of the DescribeAlarmsForMetric operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeAlarmsForMetric 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 <DescribeAlarmsForMetricResponse> DescribeAlarmsForMetricAsync(DescribeAlarmsForMetricRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeAlarmsForMetricRequestMarshaller(); var unmarshaller = DescribeAlarmsForMetricResponseUnmarshaller.Instance; return(InvokeAsync <DescribeAlarmsForMetricRequest, DescribeAlarmsForMetricResponse>(request, marshaller, unmarshaller, cancellationToken)); }
IAsyncResult invokeDescribeAlarmsForMetric(DescribeAlarmsForMetricRequest describeAlarmsForMetricRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DescribeAlarmsForMetricRequestMarshaller().Marshall(describeAlarmsForMetricRequest); var unmarshaller = DescribeAlarmsForMetricResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
internal virtual DescribeAlarmsForMetricResponse DescribeAlarmsForMetric(DescribeAlarmsForMetricRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeAlarmsForMetricRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeAlarmsForMetricResponseUnmarshaller.Instance; return(Invoke <DescribeAlarmsForMetricResponse>(request, options)); }
internal DescribeAlarmsForMetricResponse DescribeAlarmsForMetric(DescribeAlarmsForMetricRequest request) { var task = DescribeAlarmsForMetricAsync(request); try { return(task.Result); } catch (AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return(null); } }
public static void CWDescribeAlarmsForMetric() { #region CWDescribeAlarmsForMetric var client = new AmazonCloudWatchClient(); var dimension = new Dimension { Name = "AutoScalingGroupName", Value = "awseb-e-kkbEXAMPLE-stack-AutoScalingGroup-F4TAUEXAMPLE" }; var request = new DescribeAlarmsForMetricRequest { Dimensions = new List <Dimension>() { dimension }, MetricName = "NetworkOut", Namespace = "AWS/EC2" }; var response = client.DescribeAlarmsForMetric(request); if (response.MetricAlarms.Count > 0) { foreach (var alarm in response.MetricAlarms) { Console.WriteLine(); Console.WriteLine(alarm.AlarmName); Console.WriteLine(alarm.AlarmDescription); Console.WriteLine(alarm.MetricName + " " + alarm.ComparisonOperator + " " + alarm.Threshold); } } else { Console.WriteLine("No alarms."); } #endregion Console.ReadLine(); }
public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonCloudWatchConfig config = new AmazonCloudWatchConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonCloudWatchClient client = new AmazonCloudWatchClient(creds, config); DescribeAlarmsForMetricResponse resp = new DescribeAlarmsForMetricResponse(); DescribeAlarmsForMetricRequest req = new DescribeAlarmsForMetricRequest { }; resp = client.DescribeAlarmsForMetric(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.MetricAlarms) { AddObject(obj); } }
/// <summary> /// Initiates the asynchronous execution of the DescribeAlarmsForMetric operation. /// <seealso cref="Amazon.CloudWatch.AmazonCloudWatch.DescribeAlarmsForMetric"/> /// </summary> /// /// <param name="describeAlarmsForMetricRequest">Container for the necessary parameters to execute the DescribeAlarmsForMetric 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> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking /// EndDescribeAlarmsForMetric operation.</returns> public IAsyncResult BeginDescribeAlarmsForMetric(DescribeAlarmsForMetricRequest describeAlarmsForMetricRequest, AsyncCallback callback, object state) { return(invokeDescribeAlarmsForMetric(describeAlarmsForMetricRequest, callback, state, false)); }
/// <summary> /// <para> Retrieves all alarms for a single metric. Specify a statistic, period, or unit to filter the set of alarms further. </para> /// </summary> /// /// <param name="describeAlarmsForMetricRequest">Container for the necessary parameters to execute the DescribeAlarmsForMetric service method on /// AmazonCloudWatch.</param> /// /// <returns>The response from the DescribeAlarmsForMetric service method, as returned by AmazonCloudWatch.</returns> /// public DescribeAlarmsForMetricResponse DescribeAlarmsForMetric(DescribeAlarmsForMetricRequest describeAlarmsForMetricRequest) { IAsyncResult asyncResult = invokeDescribeAlarmsForMetric(describeAlarmsForMetricRequest, null, null, true); return(EndDescribeAlarmsForMetric(asyncResult)); }
/// <summary> /// Initiates the asynchronous execution of the DescribeAlarmsForMetric operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeAlarmsForMetric 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/DescribeAlarmsForMetric">REST API Reference for DescribeAlarmsForMetric Operation</seealso> public virtual Task <DescribeAlarmsForMetricResponse> DescribeAlarmsForMetricAsync(DescribeAlarmsForMetricRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = DescribeAlarmsForMetricRequestMarshaller.Instance; options.ResponseUnmarshaller = DescribeAlarmsForMetricResponseUnmarshaller.Instance; return(InvokeAsync <DescribeAlarmsForMetricResponse>(request, options, cancellationToken)); }