|
| 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.Management.CosmosDB |
| 12 | +{ |
| 13 | + using Microsoft.Rest; |
| 14 | + using Microsoft.Rest.Azure; |
| 15 | + using Models; |
| 16 | + using System.Collections; |
| 17 | + using System.Collections.Generic; |
| 18 | + using System.Threading; |
| 19 | + using System.Threading.Tasks; |
| 20 | + |
| 21 | + /// <summary> |
| 22 | + /// Extension methods for CollectionOperations. |
| 23 | + /// </summary> |
| 24 | + public static partial class CollectionOperationsExtensions |
| 25 | + { |
| 26 | + /// <summary> |
| 27 | + /// Retrieves the metrics determined by the given filter for the given database |
| 28 | + /// account and collection. |
| 29 | + /// </summary> |
| 30 | + /// <param name='operations'> |
| 31 | + /// The operations group for this extension method. |
| 32 | + /// </param> |
| 33 | + /// <param name='resourceGroupName'> |
| 34 | + /// The name of the resource group. The name is case insensitive. |
| 35 | + /// </param> |
| 36 | + /// <param name='accountName'> |
| 37 | + /// Cosmos DB database account name. |
| 38 | + /// </param> |
| 39 | + /// <param name='databaseRid'> |
| 40 | + /// Cosmos DB database rid. |
| 41 | + /// </param> |
| 42 | + /// <param name='collectionRid'> |
| 43 | + /// Cosmos DB collection rid. |
| 44 | + /// </param> |
| 45 | + /// <param name='filter'> |
| 46 | + /// An OData filter expression that describes a subset of metrics to return. |
| 47 | + /// The parameters that can be filtered are name.value (name of the metric, can |
| 48 | + /// have an or of multiple names), startTime, endTime, and timeGrain. The |
| 49 | + /// supported operator is eq. |
| 50 | + /// </param> |
| 51 | + public static IEnumerable<Metric> ListMetrics(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter) |
| 52 | + { |
| 53 | + return operations.ListMetricsAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).GetAwaiter().GetResult(); |
| 54 | + } |
| 55 | + |
| 56 | + /// <summary> |
| 57 | + /// Retrieves the metrics determined by the given filter for the given database |
| 58 | + /// account and collection. |
| 59 | + /// </summary> |
| 60 | + /// <param name='operations'> |
| 61 | + /// The operations group for this extension method. |
| 62 | + /// </param> |
| 63 | + /// <param name='resourceGroupName'> |
| 64 | + /// The name of the resource group. The name is case insensitive. |
| 65 | + /// </param> |
| 66 | + /// <param name='accountName'> |
| 67 | + /// Cosmos DB database account name. |
| 68 | + /// </param> |
| 69 | + /// <param name='databaseRid'> |
| 70 | + /// Cosmos DB database rid. |
| 71 | + /// </param> |
| 72 | + /// <param name='collectionRid'> |
| 73 | + /// Cosmos DB collection rid. |
| 74 | + /// </param> |
| 75 | + /// <param name='filter'> |
| 76 | + /// An OData filter expression that describes a subset of metrics to return. |
| 77 | + /// The parameters that can be filtered are name.value (name of the metric, can |
| 78 | + /// have an or of multiple names), startTime, endTime, and timeGrain. The |
| 79 | + /// supported operator is eq. |
| 80 | + /// </param> |
| 81 | + /// <param name='cancellationToken'> |
| 82 | + /// The cancellation token. |
| 83 | + /// </param> |
| 84 | + public static async Task<IEnumerable<Metric>> ListMetricsAsync(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter, CancellationToken cancellationToken = default(CancellationToken)) |
| 85 | + { |
| 86 | + using (var _result = await operations.ListMetricsWithHttpMessagesAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter, null, cancellationToken).ConfigureAwait(false)) |
| 87 | + { |
| 88 | + return _result.Body; |
| 89 | + } |
| 90 | + } |
| 91 | + |
| 92 | + /// <summary> |
| 93 | + /// Retrieves the usages (most recent storage data) for the given collection. |
| 94 | + /// </summary> |
| 95 | + /// <param name='operations'> |
| 96 | + /// The operations group for this extension method. |
| 97 | + /// </param> |
| 98 | + /// <param name='resourceGroupName'> |
| 99 | + /// The name of the resource group. The name is case insensitive. |
| 100 | + /// </param> |
| 101 | + /// <param name='accountName'> |
| 102 | + /// Cosmos DB database account name. |
| 103 | + /// </param> |
| 104 | + /// <param name='databaseRid'> |
| 105 | + /// Cosmos DB database rid. |
| 106 | + /// </param> |
| 107 | + /// <param name='collectionRid'> |
| 108 | + /// Cosmos DB collection rid. |
| 109 | + /// </param> |
| 110 | + /// <param name='filter'> |
| 111 | + /// An OData filter expression that describes a subset of usages to return. The |
| 112 | + /// supported parameter is name.value (name of the metric, can have an or of |
| 113 | + /// multiple names). |
| 114 | + /// </param> |
| 115 | + public static IEnumerable<Usage> ListUsages(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string)) |
| 116 | + { |
| 117 | + return operations.ListUsagesAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter).GetAwaiter().GetResult(); |
| 118 | + } |
| 119 | + |
| 120 | + /// <summary> |
| 121 | + /// Retrieves the usages (most recent storage data) for the given collection. |
| 122 | + /// </summary> |
| 123 | + /// <param name='operations'> |
| 124 | + /// The operations group for this extension method. |
| 125 | + /// </param> |
| 126 | + /// <param name='resourceGroupName'> |
| 127 | + /// The name of the resource group. The name is case insensitive. |
| 128 | + /// </param> |
| 129 | + /// <param name='accountName'> |
| 130 | + /// Cosmos DB database account name. |
| 131 | + /// </param> |
| 132 | + /// <param name='databaseRid'> |
| 133 | + /// Cosmos DB database rid. |
| 134 | + /// </param> |
| 135 | + /// <param name='collectionRid'> |
| 136 | + /// Cosmos DB collection rid. |
| 137 | + /// </param> |
| 138 | + /// <param name='filter'> |
| 139 | + /// An OData filter expression that describes a subset of usages to return. The |
| 140 | + /// supported parameter is name.value (name of the metric, can have an or of |
| 141 | + /// multiple names). |
| 142 | + /// </param> |
| 143 | + /// <param name='cancellationToken'> |
| 144 | + /// The cancellation token. |
| 145 | + /// </param> |
| 146 | + public static async Task<IEnumerable<Usage>> ListUsagesAsync(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) |
| 147 | + { |
| 148 | + using (var _result = await operations.ListUsagesWithHttpMessagesAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter, null, cancellationToken).ConfigureAwait(false)) |
| 149 | + { |
| 150 | + return _result.Body; |
| 151 | + } |
| 152 | + } |
| 153 | + |
| 154 | + /// <summary> |
| 155 | + /// Retrieves metric definitions for the given collection. |
| 156 | + /// </summary> |
| 157 | + /// <param name='operations'> |
| 158 | + /// The operations group for this extension method. |
| 159 | + /// </param> |
| 160 | + /// <param name='resourceGroupName'> |
| 161 | + /// The name of the resource group. The name is case insensitive. |
| 162 | + /// </param> |
| 163 | + /// <param name='accountName'> |
| 164 | + /// Cosmos DB database account name. |
| 165 | + /// </param> |
| 166 | + /// <param name='databaseRid'> |
| 167 | + /// Cosmos DB database rid. |
| 168 | + /// </param> |
| 169 | + /// <param name='collectionRid'> |
| 170 | + /// Cosmos DB collection rid. |
| 171 | + /// </param> |
| 172 | + public static IEnumerable<MetricDefinition> ListMetricDefinitions(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid) |
| 173 | + { |
| 174 | + return operations.ListMetricDefinitionsAsync(resourceGroupName, accountName, databaseRid, collectionRid).GetAwaiter().GetResult(); |
| 175 | + } |
| 176 | + |
| 177 | + /// <summary> |
| 178 | + /// Retrieves metric definitions for the given collection. |
| 179 | + /// </summary> |
| 180 | + /// <param name='operations'> |
| 181 | + /// The operations group for this extension method. |
| 182 | + /// </param> |
| 183 | + /// <param name='resourceGroupName'> |
| 184 | + /// The name of the resource group. The name is case insensitive. |
| 185 | + /// </param> |
| 186 | + /// <param name='accountName'> |
| 187 | + /// Cosmos DB database account name. |
| 188 | + /// </param> |
| 189 | + /// <param name='databaseRid'> |
| 190 | + /// Cosmos DB database rid. |
| 191 | + /// </param> |
| 192 | + /// <param name='collectionRid'> |
| 193 | + /// Cosmos DB collection rid. |
| 194 | + /// </param> |
| 195 | + /// <param name='cancellationToken'> |
| 196 | + /// The cancellation token. |
| 197 | + /// </param> |
| 198 | + public static async Task<IEnumerable<MetricDefinition>> ListMetricDefinitionsAsync(this ICollectionOperations operations, string resourceGroupName, string accountName, string databaseRid, string collectionRid, CancellationToken cancellationToken = default(CancellationToken)) |
| 199 | + { |
| 200 | + using (var _result = await operations.ListMetricDefinitionsWithHttpMessagesAsync(resourceGroupName, accountName, databaseRid, collectionRid, null, cancellationToken).ConfigureAwait(false)) |
| 201 | + { |
| 202 | + return _result.Body; |
| 203 | + } |
| 204 | + } |
| 205 | + |
| 206 | + } |
| 207 | +} |
0 commit comments