/// <summary> /// Get the metric definitions of the specified plan. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group the resource is located under. /// </param> /// <param name='plan'> /// Name of the plan. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <MetricDefinitionList> ListMetricDefinitionsAsync(this IPlansOperations operations, string resourceGroupName, string plan, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListMetricDefinitionsWithHttpMessagesAsync(resourceGroupName, plan, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Create or update the plan. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group the resource is located under. /// </param> /// <param name='plan'> /// Name of the plan. /// </param> /// <param name='newPlan'> /// New plan. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Plan> CreateOrUpdateAsync(this IPlansOperations operations, string resourceGroupName, string plan, Plan newPlan, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, plan, newPlan, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get the specified plan. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group the resource is located under. /// </param> /// <param name='plan'> /// Name of the plan. /// </param> public static Plan Get(this IPlansOperations operations, string resourceGroupName, string plan) { return(operations.GetAsync(resourceGroupName, plan).GetAwaiter().GetResult()); }
/// <summary> /// Get the list of plans under a resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group the resource is located under. /// </param> public static IPage <Plan> List(this IPlansOperations operations, string resourceGroupName) { return(operations.ListAsync(resourceGroupName).GetAwaiter().GetResult()); }
/// <summary> /// Get the list of plans under a resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> public static IPage <Plan> ListNext(this IPlansOperations operations, string nextPageLink) { return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// List all plans across all subscriptions. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static IPage <Plan> ListAll(this IPlansOperations operations) { return(operations.ListAllAsync().GetAwaiter().GetResult()); }
/// <summary> /// Get the metric definitions of the specified plan. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group the resource is located under. /// </param> /// <param name='plan'> /// Name of the plan. /// </param> public static MetricDefinitionList ListMetricDefinitions(this IPlansOperations operations, string resourceGroupName, string plan) { return(operations.ListMetricDefinitionsAsync(resourceGroupName, plan).GetAwaiter().GetResult()); }
/// <summary> /// Delete the specified plan. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group the resource is located under. /// </param> /// <param name='plan'> /// Name of the plan. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this IPlansOperations operations, string resourceGroupName, string plan, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, plan, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Delete the specified plan. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group the resource is located under. /// </param> /// <param name='plan'> /// Name of the plan. /// </param> public static void Delete(this IPlansOperations operations, string resourceGroupName, string plan) { operations.DeleteAsync(resourceGroupName, plan).GetAwaiter().GetResult(); }
/// <summary> /// Create or update the plan. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group the resource is located under. /// </param> /// <param name='plan'> /// Name of the plan. /// </param> /// <param name='newPlan'> /// New plan. /// </param> public static Plan CreateOrUpdate(this IPlansOperations operations, string resourceGroupName, string plan, Plan newPlan) { return(operations.CreateOrUpdateAsync(resourceGroupName, plan, newPlan).GetAwaiter().GetResult()); }