/// <summary>
        /// Returns a list of valid metrics stored for the AWS account owner. Returned metrics
        /// can be used with <a>GetMetricStatistics</a> to obtain statistical data for a given
        /// metric.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListMetrics service method.</param>
        ///
        /// <returns>The response from the ListMetrics service method, as returned by CloudWatch.</returns>
        /// <exception cref="Amazon.CloudWatch.Model.InternalServiceException">
        /// Indicates that the request processing has failed due to some unknown error, exception,
        /// or failure.
        /// </exception>
        /// <exception cref="Amazon.CloudWatch.Model.InvalidParameterValueException">
        /// Bad or out-of-range value was supplied for the input parameter.
        /// </exception>
        public ListMetricsResponse ListMetrics(ListMetricsRequest request)
        {
            var marshaller   = new ListMetricsRequestMarshaller();
            var unmarshaller = ListMetricsResponseUnmarshaller.Instance;

            return(Invoke <ListMetricsRequest, ListMetricsResponse>(request, marshaller, unmarshaller));
        }
Ejemplo n.º 2
0
        internal virtual ListMetricsResponse ListMetrics(ListMetricsRequest request)
        {
            var marshaller   = ListMetricsRequestMarshaller.Instance;
            var unmarshaller = ListMetricsResponseUnmarshaller.Instance;

            return(Invoke <ListMetricsRequest, ListMetricsResponse>(request, marshaller, unmarshaller));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// <para> Returns a list of valid metrics stored for the AWS account owner. Returned metrics can be used with GetMetricStatistics to obtain
        /// statistical data for a given metric. </para> <para><b>NOTE:</b> Up to 500 results are returned for any one call. To retrieve further
        /// results, use returned NextToken values with subsequent ListMetrics operations. </para> <para><b>NOTE:</b> If you create a metric with the
        /// PutMetricData action, allow up to fifteen minutes for the metric to appear in calls to the ListMetrics action. Statistics about the metric,
        /// however, are available sooner using GetMetricStatistics. </para>
        /// </summary>
        ///
        /// <param name="listMetricsRequest">Container for the necessary parameters to execute the ListMetrics service method on
        /// AmazonCloudWatch.</param>
        ///
        /// <returns>The response from the ListMetrics service method, as returned by AmazonCloudWatch.</returns>
        ///
        /// <exception cref="T:Amazon.CloudWatch.Model.InternalServiceException" />
        /// <exception cref="T:Amazon.CloudWatch.Model.InvalidParameterValueException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        public Task <ListMetricsResponse> ListMetricsAsync(ListMetricsRequest listMetricsRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new ListMetricsRequestMarshaller();
            var unmarshaller = ListMetricsResponseUnmarshaller.GetInstance();

            return(Invoke <IRequest, ListMetricsRequest, ListMetricsResponse>(listMetricsRequest, marshaller, unmarshaller, signer, cancellationToken));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// <para> Returns a list of valid metrics stored for the AWS account
        /// owner. Returned metrics can be used with <c>GetMetricStatistics</c> to
        /// obtain statistical data for a given metric. </para> <para><b>NOTE:</b>
        /// Up to 500 results are returned for any one call. To retrieve further
        /// results, use returned NextToken values with subsequent ListMetrics
        /// operations. </para> <para><b>NOTE:</b> If you create a metric with the
        /// PutMetricData action, allow up to fifteen minutes for the metric to
        /// appear in calls to the ListMetrics action. </para>
        /// </summary>
        ///
        /// <param name="listMetricsRequest">Container for the necessary
        ///           parameters to execute the ListMetrics service method on
        ///           AmazonCloudWatch.</param>
        ///
        /// <returns>The response from the ListMetrics service method, as returned
        ///         by AmazonCloudWatch.</returns>
        ///
        /// <exception cref="InternalServiceException"/>
        /// <exception cref="InvalidParameterValueException"/>
        public ListMetricsResponse ListMetrics(ListMetricsRequest listMetricsRequest)
        {
            IRequest <ListMetricsRequest> request  = new ListMetricsRequestMarshaller().Marshall(listMetricsRequest);
            ListMetricsResponse           response = Invoke <ListMetricsRequest, ListMetricsResponse> (request, this.signer, ListMetricsResponseUnmarshaller.GetInstance());

            return(response);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the ListMetrics operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListMetrics 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 <ListMetricsResponse> ListMetricsAsync(ListMetricsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new ListMetricsRequestMarshaller();
            var unmarshaller = ListMetricsResponseUnmarshaller.Instance;

            return(InvokeAsync <ListMetricsRequest, ListMetricsResponse>(request, marshaller,
                                                                         unmarshaller, cancellationToken));
        }
Ejemplo n.º 6
0
 IAsyncResult invokeListMetrics(ListMetricsRequest listMetricsRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new ListMetricsRequestMarshaller().Marshall(listMetricsRequest);
     var unmarshaller = ListMetricsResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Initiates the asynchronous execution of the ListMetrics operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListMetrics 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/ListMetrics">REST API Reference for ListMetrics Operation</seealso>
        public virtual Task <ListMetricsResponse> ListMetricsAsync(ListMetricsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListMetricsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListMetricsResponseUnmarshaller.Instance;

            return(InvokeAsync <ListMetricsResponse>(request, options, cancellationToken));
        }
Ejemplo n.º 8
0
        internal virtual ListMetricsResponse ListMetrics(ListMetricsRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListMetricsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListMetricsResponseUnmarshaller.Instance;

            return(Invoke <ListMetricsResponse>(request, options));
        }
Ejemplo n.º 9
0
        public async Task <List <Metric> > ListMetricsAsyncAsync(ListMetricsRequest request)
        {
            var httpRequest = new HttpRequestMessage(HttpMethod.Post, Endpoint)
            {
                Content = GetPostContent(request.ToParams())
            };

            var responseText = await SendAsync(httpRequest).ConfigureAwait(false);

            return(ListMetricsResponse.Parse(responseText));
        }
        private static IDictionary <string, string> ConvertListMetrics(ListMetricsRequest request)
        {
            IDictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["Action"] = "ListMetrics";
            if (request.IsSetNextToken())
            {
                dictionary["NextToken"] = request.NextToken;
            }
            return(dictionary);
        }
Ejemplo n.º 11
0
        /**
         * Convert ListMetricsRequest to name value pairs
         */
        private static IDictionary <string, string> ConvertListMetrics(ListMetricsRequest request)
        {
            IDictionary <string, string> parameters = new Dictionary <string, string>();

            parameters["Action"] = "ListMetrics";
            if (request.IsSetNextToken())
            {
                parameters["NextToken"] = request.NextToken;
            }

            return(parameters);
        }
Ejemplo n.º 12
0
        internal ListMetricsResponse ListMetrics(ListMetricsRequest request)
        {
            var task = ListMetricsAsync(request);

            try
            {
                return(task.Result);
            }
            catch (AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return(null);
            }
        }
Ejemplo n.º 13
0
 /// <summary>
 /// Initiates the asynchronous execution of the ListMetrics operation.
 /// <seealso cref="Amazon.CloudWatch.AmazonCloudWatch.ListMetrics"/>
 /// </summary>
 ///
 /// <param name="listMetricsRequest">Container for the necessary parameters to execute the ListMetrics 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 EndListMetrics
 ///         operation.</returns>
 public IAsyncResult BeginListMetrics(ListMetricsRequest listMetricsRequest, AsyncCallback callback, object state)
 {
     return(invokeListMetrics(listMetricsRequest, callback, state, false));
 }
Ejemplo n.º 14
0
        /// <summary>
        /// <para> Returns a list of valid metrics stored for the AWS account owner. Returned metrics can be used with GetMetricStatistics to obtain
        /// statistical data for a given metric. </para> <para><b>NOTE:</b> Up to 500 results are returned for any one call. To retrieve further
        /// results, use returned NextToken values with subsequent ListMetrics operations. </para> <para><b>NOTE:</b> If you create a metric with the
        /// PutMetricData action, allow up to fifteen minutes for the metric to appear in calls to the ListMetrics action. Statistics about the metric,
        /// however, are available sooner using GetMetricStatistics. </para>
        /// </summary>
        ///
        /// <param name="listMetricsRequest">Container for the necessary parameters to execute the ListMetrics service method on
        ///          AmazonCloudWatch.</param>
        ///
        /// <returns>The response from the ListMetrics service method, as returned by AmazonCloudWatch.</returns>
        ///
        /// <exception cref="InternalServiceException"/>
        /// <exception cref="InvalidParameterValueException"/>
        public ListMetricsResponse ListMetrics(ListMetricsRequest listMetricsRequest)
        {
            IAsyncResult asyncResult = invokeListMetrics(listMetricsRequest, null, null, true);

            return(EndListMetrics(asyncResult));
        }
Ejemplo n.º 15
0
 /// <summary>
 /// List Metrics
 /// </summary>
 /// <param name="request">List Metrics  request</param>
 /// <returns>List Metrics  Response from the service</returns>
 public ListMetricsResponse ListMetrics(ListMetricsRequest request)
 {
     return(Invoke <ListMetricsResponse>(ConvertListMetrics(request)));
 }