コード例 #1
0
        /// <summary>
        /// <para> Publishes metric data points to Amazon CloudWatch. Amazon Cloudwatch associates the data points with the specified metric. If the
        /// specified metric does not exist, Amazon CloudWatch creates the metric. It can take up to fifteen minutes for a new metric to appear in calls
        /// to the ListMetrics action.</para> <para> The size of a PutMetricData request is limited to 8 KB for HTTP GET requests and 40 KB for HTTP
        /// POST requests. </para> <para><b>IMPORTANT:</b> Although the Value parameter accepts numbers of type Double, Amazon CloudWatch truncates
        /// values with very large exponents. Values with base-10 exponents greater than 126 (1 x 10^126) are truncated. Likewise, values with base-10
        /// exponents less than -130 (1 x 10^-130) are also truncated. </para> <para>Data that is timestamped 24 hours or more in the past may take in
        /// excess of 48 hours to become available from submission time using <c>GetMetricStatistics</c> .</para>
        /// </summary>
        ///
        /// <param name="putMetricDataRequest">Container for the necessary parameters to execute the PutMetricData service method on
        /// AmazonCloudWatch.</param>
        ///
        /// <exception cref="T:Amazon.CloudWatch.Model.InvalidParameterValueException" />
        /// <exception cref="T:Amazon.CloudWatch.Model.InternalServiceException" />
        /// <exception cref="T:Amazon.CloudWatch.Model.InvalidParameterCombinationException" />
        /// <exception cref="T:Amazon.CloudWatch.Model.MissingRequiredParameterException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        public Task <PutMetricDataResponse> PutMetricDataAsync(PutMetricDataRequest putMetricDataRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new PutMetricDataRequestMarshaller();
            var unmarshaller = PutMetricDataResponseUnmarshaller.GetInstance();

            return(Invoke <IRequest, PutMetricDataRequest, PutMetricDataResponse>(putMetricDataRequest, marshaller, unmarshaller, signer, cancellationToken));
        }
コード例 #2
0
        /// <summary>
        /// Publishes metric data points to Amazon CloudWatch. Amazon Cloudwatch associates the
        /// data points with the specified metric. If the specified metric does not exist, Amazon
        /// CloudWatch creates the metric. It can take up to fifteen minutes for a new metric
        /// to appear in calls to the <a>ListMetrics</a> action.
        ///
        ///
        /// <para>
        ///  The size of a PutMetricData request is limited to 8 KB for HTTP GET requests and
        /// 40 KB for HTTP POST requests.
        /// </para>
        ///  <important> Although the <code>Value</code> parameter accepts numbers of type <code>Double</code>,
        /// Amazon CloudWatch truncates values with very large exponents. Values with base-10
        /// exponents greater than 126 (1 x 10^126) are truncated. Likewise, values with base-10
        /// exponents less than -130 (1 x 10^-130) are also truncated. </important>
        /// <para>
        /// Data that is timestamped 24 hours or more in the past may take in excess of 48 hours
        /// to become available from submission time using <code>GetMetricStatistics</code>.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the PutMetricData service method.</param>
        ///
        /// <returns>The response from the PutMetricData 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.InvalidParameterCombinationException">
        /// Parameters that must not be used together were used together.
        /// </exception>
        /// <exception cref="Amazon.CloudWatch.Model.InvalidParameterValueException">
        /// Bad or out-of-range value was supplied for the input parameter.
        /// </exception>
        /// <exception cref="Amazon.CloudWatch.Model.MissingRequiredParameterException">
        /// An input parameter that is mandatory for processing the request is not supplied.
        /// </exception>
        public PutMetricDataResponse PutMetricData(PutMetricDataRequest request)
        {
            var marshaller   = new PutMetricDataRequestMarshaller();
            var unmarshaller = PutMetricDataResponseUnmarshaller.Instance;

            return(Invoke <PutMetricDataRequest, PutMetricDataResponse>(request, marshaller, unmarshaller));
        }
コード例 #3
0
        internal virtual PutMetricDataResponse PutMetricData(PutMetricDataRequest request)
        {
            var marshaller   = PutMetricDataRequestMarshaller.Instance;
            var unmarshaller = PutMetricDataResponseUnmarshaller.Instance;

            return(Invoke <PutMetricDataRequest, PutMetricDataResponse>(request, marshaller, unmarshaller));
        }
コード例 #4
0
        /// <summary>
        /// <para> Publishes metric data points to Amazon CloudWatch. Amazon
        /// Cloudwatch associates the data points with the specified metric. If
        /// the specified metric does not exist, Amazon CloudWatch creates the
        /// metric. </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> <para> The size of
        /// a PutMetricData request is limited to 8 KB for HTTP GET requests and
        /// 40 KB for HTTP POST requests. </para> <para><b>IMPORTANT:</b> Although
        /// the Value parameter accepts numbers of type Double, Amazon CloudWatch
        /// truncates values with very large exponents. Values with base-10
        /// exponents greater than 126 (1 x 10^126) are truncated. Likewise,
        /// values with base-10 exponents less than -130 (1 x 10^-130) are also
        /// truncated. </para>
        /// </summary>
        ///
        /// <param name="putMetricDataRequest">Container for the necessary
        ///           parameters to execute the PutMetricData service method on
        ///           AmazonCloudWatch.</param>
        ///
        /// <exception cref="InvalidParameterValueException"/>
        /// <exception cref="InternalServiceException"/>
        /// <exception cref="InvalidParameterCombinationException"/>
        /// <exception cref="MissingRequiredParameterException"/>
        public PutMetricDataResponse PutMetricData(PutMetricDataRequest putMetricDataRequest)
        {
            IRequest <PutMetricDataRequest> request  = new PutMetricDataRequestMarshaller().Marshall(putMetricDataRequest);
            PutMetricDataResponse           response = Invoke <PutMetricDataRequest, PutMetricDataResponse> (request, this.signer, PutMetricDataResponseUnmarshaller.GetInstance());

            return(response);
        }
コード例 #5
0
        /// <summary>
        /// Initiates the asynchronous execution of the PutMetricData operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the PutMetricData 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 <PutMetricDataResponse> PutMetricDataAsync(PutMetricDataRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new PutMetricDataRequestMarshaller();
            var unmarshaller = PutMetricDataResponseUnmarshaller.Instance;

            return(InvokeAsync <PutMetricDataRequest, PutMetricDataResponse>(request, marshaller,
                                                                             unmarshaller, cancellationToken));
        }
コード例 #6
0
 IAsyncResult invokePutMetricData(PutMetricDataRequest putMetricDataRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new PutMetricDataRequestMarshaller().Marshall(putMetricDataRequest);
     var unmarshaller = PutMetricDataResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
コード例 #7
0
        /// <summary>
        /// Initiates the asynchronous execution of the PutMetricData operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the PutMetricData 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/PutMetricData">REST API Reference for PutMetricData Operation</seealso>
        public virtual Task <PutMetricDataResponse> PutMetricDataAsync(PutMetricDataRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = PutMetricDataRequestMarshaller.Instance;
            options.ResponseUnmarshaller = PutMetricDataResponseUnmarshaller.Instance;

            return(InvokeAsync <PutMetricDataResponse>(request, options, cancellationToken));
        }
コード例 #8
0
        internal virtual PutMetricDataResponse PutMetricData(PutMetricDataRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = PutMetricDataRequestMarshaller.Instance;
            options.ResponseUnmarshaller = PutMetricDataResponseUnmarshaller.Instance;

            return(Invoke <PutMetricDataResponse>(request, options));
        }
コード例 #9
0
        /*
         * public async Task PutMetricAlarmAsync()
         * {
         * }
         */

        public async Task PutMetricDataAsync(PutMetricDataRequest request)
        {
            var httpRequest = new HttpRequestMessage(HttpMethod.Post, Endpoint)
            {
                Content = GetPostContent(request.ToParams())
            };

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

            // return PutMetricDataResult.Parse(responseText);
        }
コード例 #10
0
        internal PutMetricDataResponse PutMetricData(PutMetricDataRequest request)
        {
            var task = PutMetricDataAsync(request);

            try
            {
                return(task.Result);
            }
            catch (AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return(null);
            }
        }
コード例 #11
0
 /// <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
 ///          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 BeginPutMetricData(PutMetricDataRequest putMetricDataRequest, AsyncCallback callback, object state)
 {
     return(invokePutMetricData(putMetricDataRequest, callback, state, false));
 }
コード例 #12
0
        /// <summary>
        /// <para> Publishes metric data points to Amazon CloudWatch. Amazon Cloudwatch associates the data points with the specified metric. If the
        /// specified metric does not exist, Amazon CloudWatch creates the metric. </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> <para> The size of a
        /// PutMetricData request is limited to 8 KB for HTTP GET requests and 40 KB for HTTP POST requests. </para> <para><b>IMPORTANT:</b> Although
        /// the Value parameter accepts numbers of type Double, Amazon CloudWatch truncates values with very large exponents. Values with base-10
        /// exponents greater than 126 (1 x 10^126) are truncated. Likewise, values with base-10 exponents less than -130 (1 x 10^-130) are also
        /// truncated. </para>
        /// </summary>
        ///
        /// <param name="putMetricDataRequest">Container for the necessary parameters to execute the PutMetricData service method on
        ///          AmazonCloudWatch.</param>
        ///
        /// <exception cref="InvalidParameterValueException"/>
        /// <exception cref="InternalServiceException"/>
        /// <exception cref="InvalidParameterCombinationException"/>
        /// <exception cref="MissingRequiredParameterException"/>
        public PutMetricDataResponse PutMetricData(PutMetricDataRequest putMetricDataRequest)
        {
            IAsyncResult asyncResult = invokePutMetricData(putMetricDataRequest, null, null, true);

            return(EndPutMetricData(asyncResult));
        }