|
2 | 2 | using System.Threading.Tasks;
|
3 | 3 | using Docker.DotNet.Models;
|
4 | 4 | using System.Threading;
|
| 5 | +using System.IO; |
5 | 6 |
|
6 | 7 | namespace Docker.DotNet
|
7 | 8 | {
|
@@ -154,6 +155,42 @@ public interface ISwarmOperations
|
154 | 155 | /// <param name="id">ID or name of service.</param>
|
155 | 156 | Task RemoveServiceAsync(string id, CancellationToken cancellationToken = default(CancellationToken));
|
156 | 157 |
|
| 158 | + /// <summary> |
| 159 | + /// Gets <c>stdout</c> and <c>stderr</c> logs from services. |
| 160 | + /// </summary> |
| 161 | + /// <param name="id">The ID or name of the service.</param> |
| 162 | + /// <param name="parameters">Specifics of how to perform the operation.</param> |
| 163 | + /// <param name="cancellationToken">When triggered, the operation will stop at the next available time, if possible.</param> |
| 164 | + /// <returns>A <see cref="Task"/> that will complete once all log lines have been read.</returns> |
| 165 | + /// <remarks> |
| 166 | + /// This method is only suited for services with the <c>json-file</c> or <c>journald</c> logging driver. |
| 167 | + /// |
| 168 | + /// HTTP GET /services/(id)/logs |
| 169 | + /// |
| 170 | + /// 101 - Logs returned as a stream. |
| 171 | + /// 200 - Logs returned as a string in response body. |
| 172 | + /// 404 - No such service. |
| 173 | + /// 500 - Server error. |
| 174 | + /// 503 - Node is not part of a swarm. |
| 175 | + /// </remarks> |
| 176 | + Task<Stream> GetServiceLogsAsync(string id, ServiceLogsParameters parameters, CancellationToken cancellationToken = default(CancellationToken)); |
| 177 | + |
| 178 | + /// <summary> |
| 179 | + /// Gets <c>stdout</c> and <c>stderr</c> logs from services. |
| 180 | + /// </summary> |
| 181 | + /// <param name="id">The ID or name of the service.</param> |
| 182 | + /// <param name="tty">Indicates whether the service was created with a TTY. If <see langword="false"/>, the returned stream is multiplexed.</param> |
| 183 | + /// <param name="parameters">Specifics of how to perform the operation.</param> |
| 184 | + /// <param name="cancellationToken">When triggered, the operation will stop at the next available time, if possible.</param> |
| 185 | + /// <returns> |
| 186 | + /// A <see cref="Task{TResult}"/> that resolves to a <see cref="MultiplexedStream"/>, which provides the log information. |
| 187 | + /// If the service wasn't created with a TTY, this stream is multiplexed. |
| 188 | + /// </returns> |
| 189 | + /// <remarks> |
| 190 | + /// This method is only suited for services with the <c>json-file</c> or <c>journald</c> logging driver. |
| 191 | + /// </remarks> |
| 192 | + Task<MultiplexedStream> GetServiceLogsAsync(string id, bool tty, ServiceLogsParameters parameters, CancellationToken cancellationToken = default(CancellationToken)); |
| 193 | + |
157 | 194 | #endregion Services
|
158 | 195 |
|
159 | 196 | #region Nodes
|
|
0 commit comments