示例#1
0
        public async Task <string> PostProcessGroupsLogAnalysisJobAsync(string pgId, string logPath, IEnumerable <string> hostFilter = null, string query = null, long?startTimestamp = null, long?endTimestamp = null,
                                                                        ExtractFields body = null, CancellationToken cancellationToken = default)
        {
            var queryParamValues = new Dictionary <string, object>
            {
                [nameof(hostFilter)]     = hostFilter == null ? null : string.Join(",", hostFilter),
                [nameof(query)]          = query,
                [nameof(startTimestamp)] = startTimestamp,
                [nameof(endTimestamp)]   = endTimestamp
            };

            string response = await GetLogMonitoringProcessGroupsUrl(pgId)
                              .AppendPathSegment(logPath)
                              .SetQueryParams(queryParamValues)
                              .PostJsonAsync(body, cancellationToken)
                              .ReceiveString()
                              .ConfigureAwait(false);

            return(response);
        }
示例#2
0
        public async Task <string> PostHostLogAnalysisJobAsync(string hostId, string logPath, string query = null, long?startTimestamp = null, long?endTimestamp = null, ExtractFields body = null,
                                                               CancellationToken cancellationToken         = default)
        {
            var queryParamValues = new Dictionary <string, object>
            {
                [nameof(query)]          = query,
                [nameof(startTimestamp)] = startTimestamp,
                [nameof(endTimestamp)]   = endTimestamp
            };

            string response = await GetLogMonitoringHostsUrl(hostId)
                              .AppendPathSegment(logPath)
                              .SetQueryParams(queryParamValues)
                              .PostJsonAsync(body, cancellationToken)
                              .ReceiveString()
                              .ConfigureAwait(false);

            return(response);
        }