/// <summary> /// The Shutdown Roles operation stops the specified set of virtual /// machines. /// </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='parameters'> /// The set of virtual machine roles to shutdown and their post /// shutdown state. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task<OperationResponse> BeginShuttingDownRolesAsync(this IVirtualMachineOperations operations, string serviceName, string deploymentName, VirtualMachineShutdownRolesParameters parameters) { return operations.BeginShuttingDownRolesAsync(serviceName, deploymentName, parameters, CancellationToken.None); }
/// <summary> /// The Shutdown Roles operation stops the specified set of virtual /// machines. /// </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='parameters'> /// The set of virtual machine roles to shutdown and their post /// shutdown state. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse BeginShuttingDownRoles(this IVirtualMachineOperations operations, string serviceName, string deploymentName, VirtualMachineShutdownRolesParameters parameters) { try { return operations.BeginShuttingDownRolesAsync(serviceName, deploymentName, parameters).Result; } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }