/// <summary>
        ///     Creates an instance of the client.
        /// </summary>
        /// <param name="serverEndpoint">The server endpoint.</param>
        /// <param name="options">The configuration options for this client instance.</param>
        /// <returns>The <see cref="IOctopusAsyncClient" /> instance.</returns>
        public Task <IOctopusAsyncClient> CreateAsyncClient(OctopusServerEndpoint serverEndpoint, OctopusClientOptions options = default)
        {
            options ??= new OctopusClientOptions();
            var requestingTool = DetermineRequestingTool();

            return(OctopusAsyncClient.Create(serverEndpoint, options, requestingTool));
        }
        /// <summary>
        ///     Creates an instance of the client.
        /// </summary>
        /// <param name="serverEndpoint">The server endpoint.</param>
        /// <param name="octopusClientOptions"></param>
        /// <returns>The <see cref="IOctopusAsyncClient" /> instance.</returns>
        public Task <IOctopusAsyncClient> CreateAsyncClient(OctopusServerEndpoint serverEndpoint,
                                                            OctopusClientOptions octopusClientOptions = null)
        {
            var requestingTool = DetermineRequestingTool();

            return(OctopusAsyncClient.Create(serverEndpoint, octopusClientOptions, requestingTool));
        }
Example #3
0
        private static async Task <IOctopusAsyncClient> Create(OctopusServerEndpoint serverEndpoint, OctopusClientOptions options, bool addHandler, string requestingTool = null)
        {
            var client = new OctopusAsyncClient(serverEndpoint, options ?? new OctopusClientOptions(), addHandler, requestingTool);
            // User used to see this exception
            // System.PlatformNotSupportedException: The handler does not support custom handling of certificates with this combination of libcurl (7.29.0) and its SSL backend
            await client.Repository.LoadRootDocument().ConfigureAwait(false);

            return(client);
        }
        private static async Task <IOctopusAsyncClient> Create(OctopusServerEndpoint serverEndpoint, OctopusClientOptions options, bool addHandler)
        {
            var client = new OctopusAsyncClient(serverEndpoint, options ?? new OctopusClientOptions(), addHandler);

            try
            {
                client.RootDocument = await client.EstablishSession().ConfigureAwait(false);

                return(client);
            }
            catch
            {
                client.Dispose();
                throw;
            }
        }
Example #5
0
 /// <summary>
 /// Creates an instance of the client.
 /// </summary>
 /// <param name="serverEndpoint">The server endpoint.</param>
 /// <param name="octopusClientOptions"></param>
 /// <returns>The <see cref="IOctopusAsyncClient" /> instance.</returns>
 public Task <IOctopusAsyncClient> CreateAsyncClient(OctopusServerEndpoint serverEndpoint, OctopusClientOptions octopusClientOptions = null)
 {
     return(OctopusAsyncClient.Create(serverEndpoint, octopusClientOptions));
 }