示例#1
0
 /// <summary>
 /// Modify properties of disks.
 /// </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='disk'>
 /// A Disk.
 /// </param>
 public static Disk Update(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name, DiskFragment disk)
 {
     return(operations.UpdateAsync(resourceGroupName, labName, userName, name, disk).GetAwaiter().GetResult());
 }
示例#2
0
 /// <summary>
 /// Revokes access to a disk.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='diskName'>
 /// The name of the managed disk that is being created. The name can't be
 /// changed after the disk is created. Supported characters for the name are
 /// a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <OperationStatusResponseInner> BeginRevokeAccessAsync(this IDisksOperations operations, string resourceGroupName, string diskName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginRevokeAccessWithHttpMessagesAsync(resourceGroupName, diskName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#3
0
 /// <summary>
 /// Delete disk. 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>
 public static void Delete(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name)
 {
     operations.DeleteAsync(resourceGroupName, labName, userName, name).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Updates (patches) a disk.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='diskName'>
 /// The name of the managed disk that is being created. The name can't be
 /// changed after the disk is created. Supported characters for the name are
 /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
 /// </param>
 /// <param name='disk'>
 /// Disk object supplied in the body of the Patch disk operation.
 /// </param>
 public static Disk Update(this IDisksOperations operations, string resourceGroupName, string diskName, DiskUpdate disk)
 {
     return(operations.UpdateAsync(resourceGroupName, diskName, disk).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Revokes access to a disk.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='diskName'>
 /// The name of the managed disk that is being created. The name can't be
 /// changed after the disk is created. Supported characters for the name are
 /// a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginRevokeAccessAsync(this IDisksOperations operations, string resourceGroupName, string diskName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginRevokeAccessWithHttpMessagesAsync(resourceGroupName, diskName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
示例#6
0
 /// <summary>
 /// Returns a list of disks.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='userSubscriptionId'>
 /// User Subscription Id which the resource belongs to.
 /// </param>
 /// <param name='status'>
 /// The parameters of disk state.
 /// </param>
 /// <param name='sharePath'>
 /// The source share which the resource belongs to.
 /// </param>
 /// <param name='count'>
 /// The maximum number of disks to return.
 /// </param>
 /// <param name='start'>
 /// The start index of disks in query.
 /// </param>
 public static IEnumerable <Disk> List(this IDisksOperations operations, string location, string userSubscriptionId = default(string), string status = default(string), string sharePath = default(string), int?count = default(int?), int?start = default(int?))
 {
     return(operations.ListAsync(location, userSubscriptionId, status, sharePath, count, start).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Lists all the disks under a subscription.
 /// </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 <Disk> ListNext(this IDisksOperations operations, string nextPageLink)
 {
     return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Lists all the disks under a subscription.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IPage <Disk> List(this IDisksOperations operations)
 {
     return(operations.ListAsync().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Grants access to a disk.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='diskName'>
 /// The name of the managed disk that is being created. The name can't be
 /// changed after the disk is created. Supported characters for the name are
 /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
 /// </param>
 /// <param name='grantAccessData'>
 /// Access data object supplied in the body of the get disk access operation.
 /// </param>
 public static AccessUri BeginGrantAccess(this IDisksOperations operations, string resourceGroupName, string diskName, GrantAccessData grantAccessData)
 {
     return(operations.BeginGrantAccessAsync(resourceGroupName, diskName, grantAccessData).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Gets information about a disk.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='diskName'>
 /// The name of the managed disk that is being created. The name can't be
 /// changed after the disk is created. Supported characters for the name are
 /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
 /// </param>
 public static Disk Get(this IDisksOperations operations, string resourceGroupName, string diskName)
 {
     return(operations.GetAsync(resourceGroupName, diskName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Lists all the disks under a resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 public static IPage <Disk> ListByResourceGroup(this IDisksOperations operations, string resourceGroupName)
 {
     return(operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult());
 }
示例#12
0
 /// <summary>
 /// Detach and break the lease of the disk attached 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='leasedByLabVmId'>
 /// The resource ID of the Lab VM to which the disk is attached.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginDetachAsync(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name, string leasedByLabVmId = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginDetachWithHttpMessagesAsync(resourceGroupName, labName, userName, name, leasedByLabVmId, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
示例#13
0
 /// <summary>
 /// Revokes access to a disk.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='diskName'>
 /// The name of the managed disk that is being created. The name can't be
 /// changed after the disk is created. Supported characters for the name are
 /// a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
 /// </param>
 public static OperationStatusResponse BeginRevokeAccess(this IDisksOperations operations, string resourceGroupName, string diskName)
 {
     return(operations.BeginRevokeAccessAsync(resourceGroupName, diskName).GetAwaiter().GetResult());
 }
示例#14
0
 /// <summary>
 /// Deletes a disk.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='diskName'>
 /// The name of the managed disk that is being created. The name can't be
 /// changed after the disk is created. Supported characters for the name are
 /// a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
 /// </param>
 public static OperationStatusResponse Delete(this IDisksOperations operations, string resourceGroupName, string diskName)
 {
     return(operations.DeleteAsync(resourceGroupName, diskName).GetAwaiter().GetResult());
 }
示例#15
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 Attach(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name, AttachDiskProperties attachDiskProperties)
 {
     operations.AttachAsync(resourceGroupName, labName, userName, name, attachDiskProperties).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Revokes access to a disk.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='diskName'>
 /// The name of the managed disk that is being created. The name can't be
 /// changed after the disk is created. Supported characters for the name are
 /// a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.
 /// </param>
 public static void BeginRevokeAccess(this IDisksOperations operations, string resourceGroupName, string diskName)
 {
     operations.BeginRevokeAccessAsync(resourceGroupName, diskName).GetAwaiter().GetResult();
 }
示例#17
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 AttachAsync(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name, AttachDiskProperties attachDiskProperties, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.AttachWithHttpMessagesAsync(resourceGroupName, labName, userName, name, attachDiskProperties, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
示例#18
0
 /// <summary>
 /// Returns the disk.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='location'>
 /// Location of the resource.
 /// </param>
 /// <param name='diskId'>
 /// The disk guid as identity.
 /// </param>
 public static Disk Get(this IDisksOperations operations, string location, string diskId)
 {
     return(operations.GetAsync(location, diskId).GetAwaiter().GetResult());
 }