コード例 #1
0
 /// <summary>
 /// Create or update the service limits (quota) of a resource to requested
 /// value.
 /// Steps:
 ///
 /// 1. Make the Get request to get the quota information for specific resource.
 ///
 /// 2. To increase the quota, update the limit field in the response from Get
 /// request to new value.
 ///
 /// 3. Submit the JSON to the quota request API to update the quota.
 /// The Create quota request may be constructed as follows. The PUT operation
 /// can be used to update the quota.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='subscriptionId'>
 /// Azure subscription id.
 /// </param>
 /// <param name='providerId'>
 /// Azure resource provider id.
 /// </param>
 /// <param name='location'>
 /// Azure region.
 /// </param>
 /// <param name='resourceName'>
 /// The resource name for a resource provider, such as SKU name for
 /// Microsoft.Compute, Sku or TotalLowPriorityCores for
 /// Microsoft.MachineLearningServices
 /// </param>
 /// <param name='createQuotaRequest'>
 /// Quota requests payload.
 /// </param>
 public static object CreateOrUpdate(this IQuotaOperations operations, string subscriptionId, string providerId, string location, string resourceName, CurrentQuotaLimitBase createQuotaRequest)
 {
     return(operations.CreateOrUpdateAsync(subscriptionId, providerId, location, resourceName, createQuotaRequest).GetAwaiter().GetResult());
 }
コード例 #2
0
 /// <summary>
 /// Create or update the quota limit for the specified resource with the
 /// requested value. To update the quota, follow these steps:
 /// 1. Use the GET operation for quotas and usages to determine how much quota
 /// remains 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 CreateOrUpdate(this IQuotaOperations operations, string resourceName, string scope, QuotaProperties properties = default(QuotaProperties))
 {
     return(operations.CreateOrUpdateAsync(resourceName, scope, properties).GetAwaiter().GetResult());
 }