示例#1
0
 /// <summary>
 /// Create or update a management lock by scope.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='scope'>
 /// The scope for the lock. When providing a scope for the assignment, use
 /// '/subscriptions/{subscriptionId}' for subscriptions,
 /// '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}' for
 /// resource groups, and
 /// '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePathIfPresent}/{resourceType}/{resourceName}'
 /// for resources.
 /// </param>
 /// <param name='lockName'>
 /// The name of lock.
 /// </param>
 /// <param name='parameters'>
 /// Create or update management lock parameters.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ManagementLockObject> CreateOrUpdateByScopeAsync(this IManagementLocksOperations operations, string scope, string lockName, ManagementLockObject parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateOrUpdateByScopeWithHttpMessagesAsync(scope, lockName, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }