/// <summary>
 /// Restart the job .
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.SiteRecovery.IJobOperations.
 /// </param>
 /// <param name='jobId'>
 /// Required. Job ID.
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <returns>
 /// A standard service response for long running operations.
 /// </returns>
 public static Task<LongRunningOperationResponse> BeginRestartingAsync(this IJobOperations operations, string jobId, CustomRequestHeaders customRequestHeaders)
 {
     return operations.BeginRestartingAsync(jobId, customRequestHeaders, CancellationToken.None);
 }
 /// <summary>
 /// The Restart role operation restarts the specified virtual machine.
 /// (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157197.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineOperations.
 /// </param>
 /// <param name='serviceName'>
 /// The name of your service.
 /// </param>
 /// <param name='deploymentName'>
 /// The name of your deployment.
 /// </param>
 /// <param name='virtualMachineName'>
 /// The name of the virtual machine to restart.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse BeginRestarting(this IVirtualMachineOperations operations, string serviceName, string deploymentName, string virtualMachineName)
 {
     try
     {
         return operations.BeginRestartingAsync(serviceName, deploymentName, virtualMachineName).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The Restart role operation restarts the specified virtual machine.
 /// (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj157197.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IVirtualMachineOperations.
 /// </param>
 /// <param name='serviceName'>
 /// The name of your service.
 /// </param>
 /// <param name='deploymentName'>
 /// The name of your deployment.
 /// </param>
 /// <param name='virtualMachineName'>
 /// The name of the virtual machine to restart.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task<OperationResponse> BeginRestartingAsync(this IVirtualMachineOperations operations, string serviceName, string deploymentName, string virtualMachineName)
 {
     return operations.BeginRestartingAsync(serviceName, deploymentName, virtualMachineName, CancellationToken.None);
 }
 /// <summary>
 /// The operation to restart a virtual machine.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Compute.IVirtualMachineOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group.
 /// </param>
 /// <param name='vmName'>
 /// Required. The name of the virtual machine.
 /// </param>
 /// <returns>
 /// The compute long running operation response.
 /// </returns>
 public static Task<ComputeOperationResponse> BeginRestartingAsync(this IVirtualMachineOperations operations, string resourceGroupName, string vmName)
 {
     return operations.BeginRestartingAsync(resourceGroupName, vmName, CancellationToken.None);
 }