示例#1
0
        /*
         * public async Task DeleteAlarmsAsync() { }
         *
         * public async Task DescribeAlarmHistoryAsync() { }
         *
         * public async Task DescribeAlarmsAsync() { }
         *
         * public async Task DesribeAlarmsForMetricAsync() { }
         *
         * public async Task DisableAlarmActions() { }
         *
         * public async Task EnableAlarmActionsAsync() { }
         */

        public async Task <GetMetricStatatisticsResponse> GetMetricStatisticsAsync(GetMetricStatisticsRequest request)
        {
            var httpRequest = new HttpRequestMessage(HttpMethod.Post, Endpoint)
            {
                Content = GetPostContent(request.ToParams())
            };

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

            return(GetMetricStatatisticsResponse.Parse(responseText));

            // return PutMetricDataResult.Parse(responseText);
        }
示例#2
0
        public static GetMetricStatatisticsResponse Parse(string xmlText)
        {
            var result = new GetMetricStatatisticsResponse();

            var rootEl = XElement.Parse(xmlText); // ListMetricsResponse

            var resultEl = rootEl.Element(NS + "GetMetricStatisticsResult");

            var datapointsEl = resultEl.Element(NS + "Datapoints");

            result.Label = resultEl.Element(NS + "Label").Value;

            foreach (var datapoint in datapointsEl.Elements())
            {
                result.Datapoints.Add(DataPoint.FromXml(NS, datapoint));
            }

            return(result);
        }