예제 #1
0
        public async Task <CalculatedServiceMetric> AddCalculatedServiceMetricAsync(CalculatedServiceMetric body, CancellationToken cancellationToken = default)
        {
            var response = await GetCalculatedMetricsServiceUrl()
                           .PostJsonAsync(body, cancellationToken)
                           .ReceiveJsonWithErrorChecking <CalculatedServiceMetric>()
                           .ConfigureAwait(false);

            return(response);
        }
예제 #2
0
        public async Task <bool> UpdateCalculatedServiceMetricAsync(string metricKey, CalculatedServiceMetric body, CancellationToken cancellationToken = default)
        {
            var response = await GetCalculatedMetricsServiceUrl()
                           .AppendPathSegment(metricKey)
                           .PutJsonAsync(body, cancellationToken)
                           .ConfigureAwait(false);

            return(response.IsSuccessStatusCode);
        }