/// <summary> /// The Begin Updating Deployment Status By Deployment Name operation /// initiates a change in the running status of a deployment. The /// status of a deployment can be running or suspended. This operation /// is an asynchronous operation. To determine whether the Management /// service has finished processing the request, call Get Operation /// Status. For more information on asynchronous operations, see /// Tracking Asynchronous Service Management Requests at /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460791.aspx. /// (see /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460808.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IDeploymentOperations. /// </param> /// <param name='serviceName'> /// Required. The cloud service to swap deployments for. /// </param> /// <param name='deploymentName'> /// Required. The name of your deployment. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Begin Updating Deployment /// Status By Deployment Name operation. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task<AzureOperationResponse> BeginUpdatingStatusByDeploymentNameAsync(this IDeploymentOperations operations, string serviceName, string deploymentName, DeploymentUpdateStatusParameters parameters) { return operations.BeginUpdatingStatusByDeploymentNameAsync(serviceName, deploymentName, parameters, CancellationToken.None); }
/// <summary> /// The Update Deployment Status operation initiates a change in the /// running status of a deployment. The status of a deployment can be /// running or suspended. The Update Deployment Status operation is /// an asynchronous operation. To determine whether the Management /// service has finished processing the request, call Get Operation /// Status. For more information on asynchronous operations, see /// Tracking Asynchronous Service Management Requests. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/ee460808.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.Compute.IDeploymentOperations. /// </param> /// <param name='serviceName'> /// The cloud service to swap deployments for. /// </param> /// <param name='deploymentName'> /// The name of your deployment. /// </param> /// <param name='parameters'> /// Parameters supplied to the Update Deployment Status operation. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse BeginUpdatingStatusByDeploymentName(this IDeploymentOperations operations, string serviceName, string deploymentName, DeploymentUpdateStatusParameters parameters) { try { return operations.BeginUpdatingStatusByDeploymentNameAsync(serviceName, deploymentName, parameters).Result; } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }