コード例 #1
0
 /// <summary>
 /// Attach and create the lease of the disk to the virtual machine. This
 /// operation can take a while to complete.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='labName'>
 /// The name of the lab.
 /// </param>
 /// <param name='userName'>
 /// The name of the user profile.
 /// </param>
 /// <param name='name'>
 /// The name of the disk.
 /// </param>
 /// <param name='attachDiskProperties'>
 /// Properties of the disk to attach.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginAttachAsync(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name, AttachDiskProperties attachDiskProperties, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginAttachWithHttpMessagesAsync(resourceGroupName, labName, userName, name, attachDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
コード例 #2
0
 /// <summary>
 /// Attach and create the lease of the disk to the virtual machine. This
 /// operation can take a while to complete.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='labName'>
 /// The name of the lab.
 /// </param>
 /// <param name='userName'>
 /// The name of the user profile.
 /// </param>
 /// <param name='name'>
 /// The name of the disk.
 /// </param>
 /// <param name='attachDiskProperties'>
 /// Properties of the disk to attach.
 /// </param>
 public static void BeginAttach(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name, AttachDiskProperties attachDiskProperties)
 {
     operations.BeginAttachAsync(resourceGroupName, labName, userName, name, attachDiskProperties).GetAwaiter().GetResult();
 }