/// <summary> /// Update the quota limit for a specific resource to the specified value: /// 1. Use the Usages-GET and Quota-GET operations to determine the remaining /// quota for the specific resource and to calculate the new quota limit. These /// steps are detailed in [this /// example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). /// 2. Use this PUT operation to update the quota limit. Please check the URI /// in location header for the detailed status of the request. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceName'> /// Resource name for a given resource provider. For example: /// - SKU name for Microsoft.Compute /// - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices /// For Microsoft.Network PublicIPAddresses. /// </param> /// <param name='scope'> /// The target Azure resource URI. For example, /// `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. /// This is the target Azure resource URI for the List GET operation. If a /// `{resourceName}` is added after `/quotas`, then it's the target Azure /// resource URI in the GET operation for the specific resource. /// </param> /// <param name='properties'> /// Quota properties for the specified resource, based on the API called, /// Quotas or Usages. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <CurrentQuotaLimitBase> BeginUpdateAsync(this IQuotaOperations operations, string resourceName, string scope, QuotaProperties properties = default(QuotaProperties), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceName, scope, properties, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get the quota limit of a resource. The response can be used to determine /// the remaining quota to calculate a new quota limit that can be submitted /// with a PUT request. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceName'> /// Resource name for a given resource provider. For example: /// - SKU name for Microsoft.Compute /// - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices /// For Microsoft.Network PublicIPAddresses. /// </param> /// <param name='scope'> /// The target Azure resource URI. For example, /// `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. /// This is the target Azure resource URI for the List GET operation. If a /// `{resourceName}` is added after `/quotas`, then it's the target Azure /// resource URI in the GET operation for the specific resource. /// </param> public static CurrentQuotaLimitBase Get(this IQuotaOperations operations, string resourceName, string scope) { return(operations.GetAsync(resourceName, scope).GetAwaiter().GetResult()); }
/// <summary> /// Update the quota limit for a specific resource to the specified value: /// 1. Use the Usages-GET and Quota-GET operations to determine the remaining /// quota for the specific resource and to calculate the new quota limit. These /// steps are detailed in [this /// example](https://techcommunity.microsoft.com/t5/azure-governance-and-management/using-the-new-quota-rest-api/ba-p/2183670). /// 2. Use this PUT operation to update the quota limit. Please check the URI /// in location header for the detailed status of the request. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceName'> /// Resource name for a given resource provider. For example: /// - SKU name for Microsoft.Compute /// - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices /// For Microsoft.Network PublicIPAddresses. /// </param> /// <param name='scope'> /// The target Azure resource URI. For example, /// `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. /// This is the target Azure resource URI for the List GET operation. If a /// `{resourceName}` is added after `/quotas`, then it's the target Azure /// resource URI in the GET operation for the specific resource. /// </param> /// <param name='properties'> /// Quota properties for the specified resource, based on the API called, /// Quotas or Usages. /// </param> public static CurrentQuotaLimitBase BeginUpdate(this IQuotaOperations operations, string resourceName, string scope, QuotaProperties properties = default(QuotaProperties)) { return(operations.BeginUpdateAsync(resourceName, scope, properties).GetAwaiter().GetResult()); }
/// <summary> /// Get a list of current quota limits of all resources for the specified /// scope. The response from this GET operation can be leveraged to submit /// requests to update a quota. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='scope'> /// The target Azure resource URI. For example, /// `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. /// This is the target Azure resource URI for the List GET operation. If a /// `{resourceName}` is added after `/quotas`, then it's the target Azure /// resource URI in the GET operation for the specific resource. /// </param> public static IPage <CurrentQuotaLimitBase> List(this IQuotaOperations operations, string scope) { return(operations.ListAsync(scope).GetAwaiter().GetResult()); }