示例#1
0
 /// <summary>
 /// Execute an Analytics query
 /// </summary>
 /// <remarks>
 /// Executes an Analytics query for data.
 /// [Here](/documentation/2-Using-the-API/Query) is an example for using POST
 /// with an Analytics query.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='query'>
 /// The query to execute.
 /// </param>
 /// <param name='timespan'>
 /// Optional. The timespan over which to query data. This is an ISO8601 time
 /// period value.  This timespan is applied in addition to any that are
 /// specified in the query expression.
 /// </param>
 /// <param name='workspaces'>
 /// A list of workspaces that are included in the query.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <QueryResults> QueryAsync(this IOperationalInsightsDataClient operations, string query, System.TimeSpan?timespan = default(System.TimeSpan?), IList <string> workspaces = default(IList <string>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.QueryWithHttpMessagesAsync(query, timespan, workspaces, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#2
0
 /// <summary>
 /// Execute an Analytics query
 /// </summary>
 /// <remarks>
 /// Executes an Analytics query for data.
 /// [Here](/documentation/2-Using-the-API/Query) is an example for using POST
 /// with an Analytics query.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='query'>
 /// The query to execute.
 /// </param>
 /// <param name='timespan'>
 /// Optional. The timespan over which to query data. This is an ISO8601 time
 /// period value.  This timespan is applied in addition to any that are
 /// specified in the query expression.
 /// </param>
 /// <param name='workspaces'>
 /// A list of workspaces that are included in the query.
 /// </param>
 public static QueryResults Query(this IOperationalInsightsDataClient operations, string query, System.TimeSpan?timespan = default(System.TimeSpan?), IList <string> workspaces = default(IList <string>))
 {
     return(operations.QueryAsync(query, timespan, workspaces).GetAwaiter().GetResult());
 }