-
Notifications
You must be signed in to change notification settings - Fork 410
Expand file tree
/
Copy pathISwarmOperations.cs
More file actions
242 lines (218 loc) · 9.16 KB
/
ISwarmOperations.cs
File metadata and controls
242 lines (218 loc) · 9.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
using System.Collections.Generic;
using System.Threading.Tasks;
using Docker.DotNet.Models;
using System.Threading;
using System.IO;
namespace Docker.DotNet
{
public interface ISwarmOperations
{
#region Swarm
/// <summary>
/// Get the unlock key.
/// </summary>
/// <remarks>
/// 200 - No Error.
/// 500 - Server Error.
/// 503 - Node is not part of a swarm.
/// </remarks>
Task<SwarmUnlockResponse> GetSwarmUnlockKeyAsync(CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Initialize a new swarm.
/// </summary>
/// <remarks>
/// 200 - No Error.
/// 400 - Bad parameters.
/// 500 - Server Error.
/// 503 - Node is already part of a swarm.
/// </remarks>
/// <param name="parameters">The join parameters.</param>
/// <returns>The node id.</returns>
Task<string> InitSwarmAsync(SwarmInitParameters parameters, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Inspect swarm.
/// </summary>
/// <remarks>
/// 200 - No Error.
/// 404 - No such swarm.
/// 500 - Server Error.
/// 503 - Node is not part of a swarm.
/// </remarks>
Task<SwarmInspectResponse> InspectSwarmAsync(CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Join an existing swarm.
/// </summary>
/// <remarks>
/// 200 - No Error.
/// 500 - Server Error.
/// 503 - Node is already part of a swarm.
/// </remarks>
/// <param name="parameters">The join parameters.</param>
Task JoinSwarmAsync(SwarmJoinParameters parameters, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Leave a swarm.
/// </summary>
/// <remarks>
/// 200 - No Error.
/// 500 - Server Error.
/// 503 - Node not part of a swarm.
/// </remarks>
/// <param name="parameters">The leave parameters.</param>
Task LeaveSwarmAsync(SwarmLeaveParameters parameters = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Unlock a locked manager.
/// </summary>
/// <remarks>
/// 200 - No Error.
/// 500 - Server Error.
/// 503 - Node is not part of a swarm.
/// </remarks>
/// <param name="parameters">The swarm's unlock key.</param>
Task UnlockSwarmAsync(SwarmUnlockParameters parameters, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Update a swarm.
/// </summary>
/// <remarks>
/// 200 - No Error.
/// 400 - Bad parameter.
/// 500 - Server Error.
/// 503 - Node is not part of a swarm.
/// </remarks>
/// <param name="parameters">The update parameters.</param>
Task UpdateSwarmAsync(SwarmUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken));
#endregion Swarm
#region Services
/// <summary>
/// Create a service.
/// </summary>
/// <remarks>
/// 200 - No error.
/// 400 - Bad parameter.
/// 403 - Network is not eligible for services.
/// 409 - Name conflicts with an existing service.
/// 500 - Server error.
/// 503 - Node is not part of a swarm.
/// </remarks>
Task<ServiceCreateResponse> CreateServiceAsync(ServiceCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Inspect a service.
/// </summary>
/// <remarks>
/// 200 - No error.
/// 404 - No such service.
/// 500 - Server error.
/// 503 - Node is not part of a swarm.
/// </remarks>
/// <param name="id">ID or name of service.</param>
/// <returns>The service spec.</returns>
Task<SwarmService> InspectServiceAsync(string id, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// List services with optional serviceFilters.
/// </summary>
/// <remarks>
/// 200 - No error.
/// 500 - Server error.
/// 503 - Node is not part of a swarm.
/// </remarks>
Task<IEnumerable<SwarmService>> ListServicesAsync(ServicesListParameters parameters = null, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Update a service.
/// </summary>
/// <remarks>
/// 200 - No error.
/// 400 - Bad parameter.
/// 404 - No such service.
/// 500 - Server error.
/// 503 - Node is not part of a swarm.
/// </remarks>
/// <param name="id">ID or name of service.</param>
/// <returns>The service spec.</returns>
Task<ServiceUpdateResponse> UpdateServiceAsync(string id, ServiceUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Delete a service.
/// </summary>
/// <remarks>
/// 200 - No error.
/// 404 - No such service.
/// 500 - Server error.
/// 503 - Node is not part of a swarm.
/// </remarks>
/// <param name="id">ID or name of service.</param>
Task RemoveServiceAsync(string id, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Get service logs.
///
/// Get {stdout} and {stderr} logs from all service tasks.
/// Note: This endpoint works only for services with the {json-file} or {journald} logging driver.
/// </summary>
/// <remarks>
/// docker service logs
///
/// HTTP GET /services/(id)/logs
///
/// 101 - Logs returned as a stream.
/// 200 - Logs returned as a string in response body.
/// 404 - No such service.
/// 500 - Server error.
/// 503 - Node is not part of a swarm.
/// </remarks>
/// <param name="id">ID or name of the service.</param>
Task<Stream> GetServiceLogsAsync(string id, ServiceLogsParameters parameters, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Gets the <code>stdout</code> and <code>stderr</code> logs from all service tasks.
/// This endpoint works only for services with the <code>json-file</code> or <code>journald</code> logging driver.
/// </summary>
/// <param name="id">ID or name of the service.</param>
/// <param name="tty">If the service was created with a TTY or not. If <see langword="false" />, the returned stream is multiplexed.</param>
/// <param name="parameters">The parameters used to retrieve the logs.</param>
/// <param name="cancellationToken">A token used to cancel this operation.</param>
/// <returns>A stream with the retrieved logs. If the service wasn't created with a TTY, this stream is multiplexed.</returns>
Task<MultiplexedStream> GetServiceLogsAsync(string id, bool tty, ServiceLogsParameters parameters, CancellationToken cancellationToken = default(CancellationToken));
#endregion Services
#region Nodes
/// <summary>
/// List nodes.
/// </summary>
/// <remarks>
/// 200 - No error.
/// 500 - Server error.
/// 503 - Node is not part of a swarm.
/// </remarks>
/// <returns></returns>
Task<IEnumerable<NodeListResponse>> ListNodesAsync(CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Inspect a node.
/// </summary>
/// <remarks>
/// 200 - No error.
/// 404 - No such node.
/// 500 - Server error.
/// 503 - Node is not part of a swarm.
/// </remarks>
Task<NodeListResponse> InspectNodeAsync(string id, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Delete a node.
/// </summary>
/// <remarks>
/// 200 - No error.
/// 404 - No such node.
/// 500 - Server error.
/// 503 - Node is not part of a swarm.
/// </remarks>
Task RemoveNodeAsync(string id, bool force, CancellationToken cancellationToken = default(CancellationToken));
/// <summary>
/// Update node.
/// </summary>
/// <remarks>
/// 200 - No error.
/// 404 - No such node.
/// 500 - Server error.
/// 503 - Node is not part of a swarm.
/// </remarks>
/// <param name="id">ID or name of the node.</param>
/// <param name="version">Current version of the node object.</param>
/// <param name="parameters">Parameters to update.</param>
Task UpdateNodeAsync(string id, ulong version, NodeUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken));
#endregion
}
}