| | 1 | | // <auto-generated> |
| | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | 4 | | // license information. |
| | 5 | | // |
| | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | 8 | | // regenerated. |
| | 9 | | // </auto-generated> |
| | 10 | |
|
| | 11 | | namespace Microsoft.Azure.ApplicationInsights.Query |
| | 12 | | { |
| | 13 | | using Models; |
| | 14 | | using System.Collections; |
| | 15 | | using System.Collections.Generic; |
| | 16 | | using System.Threading; |
| | 17 | | using System.Threading.Tasks; |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Extension methods for QueryOperations. |
| | 21 | | /// </summary> |
| | 22 | | public static partial class QueryOperationsExtensions |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Execute an Analytics query |
| | 26 | | /// </summary> |
| | 27 | | /// <remarks> |
| | 28 | | /// Executes an Analytics query for data. |
| | 29 | | /// [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) |
| | 30 | | /// is an example for using POST with an Analytics query. |
| | 31 | | /// </remarks> |
| | 32 | | /// <param name='operations'> |
| | 33 | | /// The operations group for this extension method. |
| | 34 | | /// </param> |
| | 35 | | /// <param name='appId'> |
| | 36 | | /// ID of the application. This is Application ID from the API Access settings |
| | 37 | | /// blade in the Azure portal. |
| | 38 | | /// </param> |
| | 39 | | /// <param name='query'> |
| | 40 | | /// The query to execute. |
| | 41 | | /// </param> |
| | 42 | | /// <param name='timespan'> |
| | 43 | | /// Optional. The timespan over which to query data. This is an ISO8601 time |
| | 44 | | /// period value. This timespan is applied in addition to any that are |
| | 45 | | /// specified in the query expression. |
| | 46 | | /// </param> |
| | 47 | | /// <param name='applications'> |
| | 48 | | /// A list of Application IDs for cross-application queries. |
| | 49 | | /// </param> |
| | 50 | | public static QueryResults Execute(this IQueryOperations operations, string appId, string query, string time |
| | 51 | | { |
| 0 | 52 | | return operations.ExecuteAsync(appId, query, timespan, applications).GetAwaiter().GetResult(); |
| | 53 | | } |
| | 54 | |
|
| | 55 | | /// <summary> |
| | 56 | | /// Execute an Analytics query |
| | 57 | | /// </summary> |
| | 58 | | /// <remarks> |
| | 59 | | /// Executes an Analytics query for data. |
| | 60 | | /// [Here](https://dev.applicationinsights.io/documentation/Using-the-API/Query) |
| | 61 | | /// is an example for using POST with an Analytics query. |
| | 62 | | /// </remarks> |
| | 63 | | /// <param name='operations'> |
| | 64 | | /// The operations group for this extension method. |
| | 65 | | /// </param> |
| | 66 | | /// <param name='appId'> |
| | 67 | | /// ID of the application. This is Application ID from the API Access settings |
| | 68 | | /// blade in the Azure portal. |
| | 69 | | /// </param> |
| | 70 | | /// <param name='query'> |
| | 71 | | /// The query to execute. |
| | 72 | | /// </param> |
| | 73 | | /// <param name='timespan'> |
| | 74 | | /// Optional. The timespan over which to query data. This is an ISO8601 time |
| | 75 | | /// period value. This timespan is applied in addition to any that are |
| | 76 | | /// specified in the query expression. |
| | 77 | | /// </param> |
| | 78 | | /// <param name='applications'> |
| | 79 | | /// A list of Application IDs for cross-application queries. |
| | 80 | | /// </param> |
| | 81 | | /// <param name='cancellationToken'> |
| | 82 | | /// The cancellation token. |
| | 83 | | /// </param> |
| | 84 | | public static async Task<QueryResults> ExecuteAsync(this IQueryOperations operations, string appId, string q |
| | 85 | | { |
| 0 | 86 | | using (var _result = await operations.ExecuteWithHttpMessagesAsync(appId, query, timespan, applications, |
| | 87 | | { |
| 0 | 88 | | return _result.Body; |
| | 89 | | } |
| 0 | 90 | | } |
| | 91 | |
|
| | 92 | | } |
| | 93 | | } |