Example #1
0
 /// <summary>
 /// <para>Deletes the compose deployment from the cluster.</para>
 /// </summary>
 /// <param name="client"><see cref="System.Fabric.FabricClient"/> object.</param>
 /// <param name="description">
 /// <para>The <see cref="Description.DeleteComposeDeploymentDescription"/> that determines which compose deployment should be deleted.</para>
 /// </param>
 /// <param name="timeout">
 /// <para>Defines the maximum amount of time the system will allow this operation to continue before returning System.TimeoutException.</para>
 /// </param>
 /// <returns>
 ///   <para>A <see cref="System.Threading.Tasks.Task" /> representing the operation.</para>
 /// </returns>
 /// <exception cref="System.Fabric.FabricObjectClosedException">
 /// <para>The <see cref="System.Fabric.FabricClient" /> object is in a closed state. Dispose of the <see cref="System.Fabric.FabricClient" /> object you are using and instantiate a new <see cref="System.Fabric.FabricClient" /> object.</para>
 /// </exception>
 /// <exception cref="System.Fabric.FabricElementNotFoundException">
 /// <para>
 ///     <see cref="System.Fabric.FabricErrorCode.ComposeDeploymentNotFound" />: The compose deployment does not exist.
 /// </para>
 /// </exception>
 /// <exception cref="System.Fabric.FabricTransientException">
 /// <para>
 ///     <see cref="System.Fabric.FabricErrorCode.ApplicationUpgradeInProgress" />: The application is being upgraded. </para>
 /// </exception>
 /// <exception cref="System.TimeoutException">
 /// <para>The request timed out but may have already been accepted for processing by the system.</para>
 /// </exception>
 /// <exception cref="System.OperationCanceledException">
 /// <para>The request was canceled before the timeout expired but may have already been accepted for processing by the system.</para>
 /// </exception>
 /// <remarks>
 /// <para>All application state will be lost and cannot be recovered after the application is deleted.</para>
 /// </remarks>
 public static Task DeleteComposeDeploymentAsync(
     this FabricClient.ComposeDeploymentClient client,
     DeleteComposeDeploymentDescription description,
     TimeSpan timeout)
 {
     return(client.DeleteComposeDeploymentWrapperAsync(description.ToWrapper(), timeout));
 }
        protected void DeleteComposeDeployment(DeleteComposeDeploymentDescription description)
        {
            var clusterConnection = this.GetClusterConnection();

            try
            {
                clusterConnection.DeleteComposeDeploymentAsync(
                    description,
                    this.GetTimeout(),
                    this.GetCancellationToken()).Wait();
            }
            catch (AggregateException aggregateException)
            {
                aggregateException.Handle((ae) =>
                {
                    this.ThrowTerminatingError(
                        ae,
                        Constants.RemoveComposeDeploymentInstanceErrorId,
                        clusterConnection);
                    return(true);
                });
            }
        }