コード例 #1
0
        public Task<Stream> GetContainerLogsAsync(string id, GetContainerLogsParameters parameters, CancellationToken cancellationToken)
        {
            if (string.IsNullOrEmpty(id))
            {
                throw new ArgumentNullException("id");
            }

            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }

            string path = string.Format(CultureInfo.InvariantCulture, "containers/{0}/logs", id);
            IQueryString queryParameters = new QueryString<GetContainerLogsParameters>(parameters);
            return this.Client.MakeRequestForStreamAsync(new[] {NoSuchContainerHandler}, HttpMethod.Get, path, queryParameters, null, cancellationToken);
        }
コード例 #2
0
        /// <summary>
        /// Returns a log stream for Standard error and standard output
        /// </summary>
        /// <param name="id">Container ID</param>
        /// <param name="cancellationToken">CancellationTokenSource</param>
        /// <returns>Stream</returns>
        public async Task<Stream> ShowLogs(string id, System.Threading.CancellationToken cancellationToken)
        {
            var logParams = new GetContainerLogsParameters();
            //logParams.Follow = true;
            logParams.Stderr = true;
            logParams.Stdout = true; 

            var Stream = await client.Containers.GetContainerLogsAsync(id, logParams, cancellationToken);
            return Stream; 
        }