Ejemplo n.º 1
0
 public static async Task <IPage <VirtualMachine> > ListAllAsync(this IVirtualMachinesOperations operations, string statusOnly, CancellationToken cancellationToken)
 {
     using (var _result = await operations.ListAllWithHttpMessagesAsync(statusOnly, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Retrieves information about the run-time state of a virtual machine.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// The name of the virtual machine.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <VirtualMachineInstanceView> InstanceViewAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.InstanceViewWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get all virtual machines for a lab.
 /// </summary>
 /// <remarks>
 /// Returns a list of all virtual machines for a lab.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='labName'>
 /// The name of the lab that uniquely identifies it within containing lab
 /// account. Used in resource URIs.
 /// </param>
 /// <param name='filter'>
 /// The filter to apply to the operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <VirtualMachine> > ListByLabAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string labName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByLabWithHttpMessagesAsync(resourceGroupName, labName, filter, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Lists all of the virtual machines in the specified subscription. Use the
 /// nextLink property in the response to get the next page of virtual machines.
 /// </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>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <VirtualMachineInner> > ListAllNextAsync(this IVirtualMachinesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Run command on the VM.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// The name of the virtual machine.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Run command operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <RunCommandResultInner> BeginRunCommandAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, RunCommandInput parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginRunCommandWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// The operation to redeploy a virtual machine.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// The name of the virtual machine.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <OperationStatusResponseInner> BeginRedeployAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginRedeployWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// The operation to create or update a virtual machine.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// The name of the virtual machine.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the Create Virtual Machine operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <VirtualMachineInner> CreateOrUpdateAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, VirtualMachineInner parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vmName, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets the async operation status.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='clusterName'>
 /// The name of the cluster.
 /// </param>
 /// <param name='operationId'>
 /// The long running operation id.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <AsyncOperationResult> GetAsyncOperationStatusAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string clusterName, string operationId, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetAsyncOperationStatusWithHttpMessagesAsync(resourceGroupName, clusterName, operationId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Lists the HDInsight clusters hosts
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='clusterName'>
 /// The name of the cluster.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <HostInfo> > ListHostsAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListHostsWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get a Virtual Machines
 /// </summary>
 /// <remarks>
 /// Get a Virtual Machines
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='id'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <VirtualMachine> GetAsync(this IVirtualMachinesOperations operations, string id, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(id, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get virtual machine.
 /// </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='name'>
 /// The name of the virtual machine.
 /// </param>
 /// <param name='expand'>
 /// Specify the $expand query. Example:
 /// 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)'
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <LabVirtualMachineInner> GetAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, expand, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// List virtual machines in a given lab.
 /// </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='odataQuery'>
 /// OData parameters to apply to the operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <LabVirtualMachineInner> > ListAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string labName, ODataQuery <LabVirtualMachineInner> odataQuery = default(ODataQuery <LabVirtualMachineInner>), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, odataQuery, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Create or replace an existing 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='name'>
 /// The name of the virtual machine.
 /// </param>
 /// <param name='labVirtualMachine'>
 /// A virtual machine.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <LabVirtualMachineInner> BeginCreateOrUpdateAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string labName, string name, LabVirtualMachineInner labVirtualMachine, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, name, labVirtualMachine, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
        public static AzureOperationResponse <VirtualMachine> GetWithInstanceView(this IVirtualMachinesOperations iVmExtensionOperations,
                                                                                  string rgName, string vmName)
        {
            const InstanceViewTypes expand = InstanceViewTypes.InstanceView;
            var result = iVmExtensionOperations.GetWithHttpMessagesAsync(rgName, vmName, expand).GetAwaiter().GetResult();

            return(result);
        }
Ejemplo n.º 15
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Clusters               = new ClustersOperations(this);
     Applications           = new ApplicationsOperations(this);
     Locations              = new LocationsOperations(this);
     Configurations         = new ConfigurationsOperations(this);
     Extensions             = new ExtensionsOperations(this);
     ScriptActions          = new ScriptActionsOperations(this);
     ScriptExecutionHistory = new ScriptExecutionHistoryOperations(this);
     Operations             = new Operations(this);
     VirtualMachines        = new VirtualMachinesOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2018-06-01-preview";
     AcceptLanguage = "en-US";
     LongRunningOperationRetryTimeout = 30;
     GenerateClientRequestId          = true;
     SerializationSettings            = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     CustomInitialize();
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
 /// <summary>
 /// The operation to delete a virtual machine.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// The name of the virtual machine.
 public static async Task DeleteAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName)
 {
     await DeleteAsync(operations, resourceGroupName, vmName, false, default(CancellationToken));
 }
 /// <summary>
 /// The operation to delete a virtual machine.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// The name of the virtual machine.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginDeleteAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken)
 {
     await BeginDeleteAsync(operations, resourceGroupName, vmName, false, cancellationToken);
 }
 /// <summary>
 /// Redeploy a lab virtual machine to a different compute node. For
 /// troubleshooting connectivity.
 /// </summary>
 /// <remarks>
 /// Action to redeploy a lab virtual machine to a different compute node. For
 /// troubleshooting connectivity.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='labName'>
 /// The name of the lab that uniquely identifies it within containing lab
 /// account. Used in resource URIs.
 /// </param>
 /// <param name='virtualMachineName'>
 /// The ID of the virtual machine that uniquely identifies it within the
 /// containing lab. Used in resource URIs.
 /// </param>
 public static void BeginRedeploy(this IVirtualMachinesOperations operations, string resourceGroupName, string labName, string virtualMachineName)
 {
     operations.BeginRedeployAsync(resourceGroupName, labName, virtualMachineName).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Get all virtual machines for a lab.
 /// </summary>
 /// <remarks>
 /// Returns a list of all virtual machines for a lab.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='labName'>
 /// The name of the lab that uniquely identifies it within containing lab
 /// account. Used in resource URIs.
 /// </param>
 /// <param name='filter'>
 /// The filter to apply to the operation.
 /// </param>
 public static IPage <VirtualMachine> ListByLab(this IVirtualMachinesOperations operations, string resourceGroupName, string labName, string filter = default(string))
 {
     return(operations.ListByLabAsync(resourceGroupName, labName, filter).GetAwaiter().GetResult());
 }
 /// <summary>
 /// The operation to perform maintenance on a virtual machine.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// The name of the virtual machine.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginPerformMaintenanceAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginPerformMaintenanceWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Reset a lab virtual machine password.
 /// </summary>
 /// <remarks>
 /// Resets a lab virtual machine password.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// The request body.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='labName'>
 /// The name of the lab that uniquely identifies it within containing lab
 /// account. Used in resource URIs.
 /// </param>
 /// <param name='virtualMachineName'>
 /// The ID of the virtual machine that uniquely identifies it within the
 /// containing lab. Used in resource URIs.
 /// </param>
 public static void BeginResetPassword(this IVirtualMachinesOperations operations, ResetPasswordBody body, string resourceGroupName, string labName, string virtualMachineName)
 {
     operations.BeginResetPasswordAsync(body, resourceGroupName, labName, virtualMachineName).GetAwaiter().GetResult();
 }
 /// <summary>
 /// The operation to power off (stop) a virtual machine. The virtual machine
 /// can be restarted with the same provisioned resources. You are still charged
 /// for this virtual machine.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// The name of the virtual machine.
 /// </param>
 /// <param name='skipShutdown'>
 /// The parameter to request non-graceful VM shutdown. True value for this flag
 /// indicates non-graceful shutdown whereas false indicates otherwise. Default
 /// value for this flag is false if not specified
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginPowerOffAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool?skipShutdown = false, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginPowerOffWithHttpMessagesAsync(resourceGroupName, vmName, skipShutdown, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Reimages the virtual machine which has an ephemeral OS disk back to its
 /// initial state.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// The name of the virtual machine.
 /// </param>
 /// <param name='tempDisk'>
 /// Specifies whether to reimage temp disk. Default value: false. Note: This
 /// temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS
 /// disk.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginReimageAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool?tempDisk = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginReimageWithHttpMessagesAsync(resourceGroupName, vmName, tempDisk, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Converts virtual machine disks from blob-based to managed disks. Virtual
 /// machine must be stop-deallocated before invoking this operation.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// The name of the virtual machine.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task ConvertToManagedDisksAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.ConvertToManagedDisksWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Lists all available virtual machine sizes to which the specified virtual
 /// machine can be resized.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// The name of the virtual machine.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IEnumerable <VirtualMachineSizeInner> > ListAvailableSizesAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListAvailableSizesWithHttpMessagesAsync(resourceGroupName, vmName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Reset a lab virtual machine password.
 /// </summary>
 /// <remarks>
 /// Resets a lab virtual machine password.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// The request body.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='labName'>
 /// The name of the lab that uniquely identifies it within containing lab
 /// account. Used in resource URIs.
 /// </param>
 /// <param name='virtualMachineName'>
 /// The ID of the virtual machine that uniquely identifies it within the
 /// containing lab. Used in resource URIs.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginResetPasswordAsync(this IVirtualMachinesOperations operations, ResetPasswordBody body, string resourceGroupName, string labName, string virtualMachineName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginResetPasswordWithHttpMessagesAsync(body, resourceGroupName, labName, virtualMachineName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// The operation to retrieve SAS URIs for a virtual machine's boot diagnostic
 /// logs.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// The name of the virtual machine.
 /// </param>
 /// <param name='sasUriExpirationTimeInMinutes'>
 /// Expiration duration in minutes for the SAS URIs with a value between 1 to
 /// 1440 minutes. &lt;br&gt;&lt;br&gt;NOTE: If not specified, SAS URIs will be
 /// generated with a default expiration duration of 120 minutes.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <RetrieveBootDiagnosticsDataResultInner> RetrieveBootDiagnosticsDataAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, int?sasUriExpirationTimeInMinutes = default(int?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.RetrieveBootDiagnosticsDataWithHttpMessagesAsync(resourceGroupName, vmName, sasUriExpirationTimeInMinutes, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// The operation to delete a virtual machine.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// The name of the virtual machine.
 /// </param>
 /// <param name='forceDeletion'>
 /// Optional parameter to force delete virtual machines.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IVirtualMachinesOperations operations, string resourceGroupName, string vmName, bool?forceDeletion = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vmName, forceDeletion, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Get all virtual machines for a lab.
 /// </summary>
 /// <remarks>
 /// Returns a list of all virtual machines for a lab.
 /// </remarks>
 /// <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 <VirtualMachine> ListByLabNext(this IVirtualMachinesOperations operations, string nextPageLink)
 {
     return(operations.ListByLabNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get a lab virtual machine.
 /// </summary>
 /// <remarks>
 /// Returns the properties for a lab virtual machine.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The name of the resource group. The name is case insensitive.
 /// </param>
 /// <param name='labName'>
 /// The name of the lab that uniquely identifies it within containing lab
 /// account. Used in resource URIs.
 /// </param>
 /// <param name='virtualMachineName'>
 /// The ID of the virtual machine that uniquely identifies it within the
 /// containing lab. Used in resource URIs.
 /// </param>
 public static VirtualMachine Get(this IVirtualMachinesOperations operations, string resourceGroupName, string labName, string virtualMachineName)
 {
     return(operations.GetAsync(resourceGroupName, labName, virtualMachineName).GetAwaiter().GetResult());
 }