diff --git a/gen/KubernetesWatchGenerator/IKubernetes.Watch.cs.template b/gen/KubernetesWatchGenerator/IKubernetes.Watch.cs.template index 06fe199..e174234 100644 --- a/gen/KubernetesWatchGenerator/IKubernetes.Watch.cs.template +++ b/gen/KubernetesWatchGenerator/IKubernetes.Watch.cs.template @@ -35,6 +35,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -55,6 +58,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); {{/.}} diff --git a/gen/KubernetesWatchGenerator/Kubernetes.Watch.cs.template b/gen/KubernetesWatchGenerator/Kubernetes.Watch.cs.template index 37620e2..bb356e2 100644 --- a/gen/KubernetesWatchGenerator/Kubernetes.Watch.cs.template +++ b/gen/KubernetesWatchGenerator/Kubernetes.Watch.cs.template @@ -24,10 +24,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"{{GetPathExpression .}}"; - return WatchObjectAsync<{{GetClassName operation}}>(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync<{{GetClassName operation}}>(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } {{/.}} diff --git a/src/KubernetesClient/IKubernetes.Watch.cs b/src/KubernetesClient/IKubernetes.Watch.cs index 890d595..77f6536 100644 --- a/src/KubernetesClient/IKubernetes.Watch.cs +++ b/src/KubernetesClient/IKubernetes.Watch.cs @@ -45,12 +45,15 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// /// /// A which represents the asynchronous operation, and returns a new watcher. /// - Task> WatchObjectAsync(string path, string @continue = null, string fieldSelector = null, bool? includeUninitialized = null, string labelSelector = null, int? limit = null, bool? pretty = null, int? timeoutSeconds = null, string resourceVersion = null, Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> WatchObjectAsync(string path, string @continue = null, string fieldSelector = null, bool? includeUninitialized = null, string labelSelector = null, int? limit = null, bool? pretty = null, int? timeoutSeconds = null, string resourceVersion = null, Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/KubernetesClient/Kubernetes.Watch.cs b/src/KubernetesClient/Kubernetes.Watch.cs index ed824d0..9ecf56e 100644 --- a/src/KubernetesClient/Kubernetes.Watch.cs +++ b/src/KubernetesClient/Kubernetes.Watch.cs @@ -13,7 +13,7 @@ namespace k8s public partial class Kubernetes { /// - public async Task> WatchObjectAsync(string path, string @continue = null, string fieldSelector = null, bool? includeUninitialized = null, string labelSelector = null, int? limit = null, bool? pretty = null, int? timeoutSeconds = null, string resourceVersion = null, Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> WatchObjectAsync(string path, string @continue = null, string fieldSelector = null, bool? includeUninitialized = null, string labelSelector = null, int? limit = null, bool? pretty = null, int? timeoutSeconds = null, string resourceVersion = null, Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -152,7 +152,7 @@ namespace k8s var stream = await httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); StreamReader reader = new StreamReader(stream); - return new Watcher(reader, onEvent, onError); + return new Watcher(reader, onEvent, onError, onClosed); } } } diff --git a/src/KubernetesClient/Watcher.cs b/src/KubernetesClient/Watcher.cs index 9d44ac6..18fcc9e 100644 --- a/src/KubernetesClient/Watcher.cs +++ b/src/KubernetesClient/Watcher.cs @@ -29,68 +29,36 @@ namespace k8s public bool Watching { get; private set; } private readonly CancellationTokenSource _cts; - private readonly StreamReader _streamReader; - - public Watcher(StreamReader streamReader, Action onEvent, Action onError) + private readonly StreamReader _streamReader; + private readonly Task _watcherLoop; + + /// + /// Initializes a new instance of the class. + /// + /// + /// A from which to read the events. + /// + /// + /// The action to invoke when the server sends a new event. + /// + /// + /// The action to invoke when an error occurs. + /// + /// + /// The action to invoke when the server closes the connection. + /// + public Watcher(StreamReader streamReader, Action onEvent, Action onError, Action onClosed = null) { _streamReader = streamReader; OnEvent += onEvent; - OnError += onError; + OnError += onError; + OnClosed += onClosed; - _cts = new CancellationTokenSource(); - - var token = _cts.Token; - - Task.Run(async () => - { - try - { - Watching = true; - - while (!streamReader.EndOfStream) - { - if (token.IsCancellationRequested) - { - return; - } - - var line = await streamReader.ReadLineAsync(); - - try - { - var genericEvent = SafeJsonConvert.DeserializeObject.WatchEvent>(line); - - if (genericEvent.Object.Kind == "Status") - { - var statusEvent = SafeJsonConvert.DeserializeObject.WatchEvent>(line); - var exception = new KubernetesException(statusEvent.Object); - this.OnError?.Invoke(exception); - } - else - { - var @event = SafeJsonConvert.DeserializeObject.WatchEvent>(line); - this.OnEvent?.Invoke(@event.Type, @event.Object); - } - } - catch (Exception e) - { - // error if deserialized failed or onevent throws - OnError?.Invoke(e); - } - } - } - catch (Exception e) - { - // error when transport error, IOException ect - OnError?.Invoke(e); - } - finally - { - Watching = false; - } - }, token); + _cts = new CancellationTokenSource(); + _watcherLoop = this.WatcherLoop(_cts.Token); } - + + /// public void Dispose() { _cts.Cancel(); @@ -105,13 +73,71 @@ namespace k8s /// /// add/remove callbacks when any exception was caught during watching /// - public event Action OnError; + public event Action OnError; + + /// + /// The event which is raised when the server closes th econnection. + /// + public event Action OnClosed; public class WatchEvent { public WatchEventType Type { get; set; } public T Object { get; set; } + } + + private async Task WatcherLoop(CancellationToken cancellationToken) + { + // Make sure we run async + await Task.Yield(); + + try + { + Watching = true; + string line; + + // ReadLineAsync will return null when we've reached the end of the stream. + while ((line = await this._streamReader.ReadLineAsync().ConfigureAwait(false)) != null) + { + if (cancellationToken.IsCancellationRequested) + { + return; + } + + try + { + var genericEvent = SafeJsonConvert.DeserializeObject.WatchEvent>(line); + + if (genericEvent.Object.Kind == "Status") + { + var statusEvent = SafeJsonConvert.DeserializeObject.WatchEvent>(line); + var exception = new KubernetesException(statusEvent.Object); + this.OnError?.Invoke(exception); + } + else + { + var @event = SafeJsonConvert.DeserializeObject.WatchEvent>(line); + this.OnEvent?.Invoke(@event.Type, @event.Object); + } + } + catch (Exception e) + { + // error if deserialized failed or onevent throws + OnError?.Invoke(e); + } + } + } + catch (Exception e) + { + // error when transport error, IOException ect + OnError?.Invoke(e); + } + finally + { + Watching = false; + OnClosed?.Invoke(); + } } } @@ -123,18 +149,22 @@ namespace k8s /// type of the event object /// the api response /// a callback when any event raised from api server - /// a callbak when any exception was caught during watching + /// a callbak when any exception was caught during watching + /// + /// The action to invoke when the server closes the connection. + /// /// a watch object public static Watcher Watch(this HttpOperationResponse response, Action onEvent, - Action onError = null) + Action onError = null, + Action onClosed = null) { if (!(response.Response.Content is WatcherDelegatingHandler.LineSeparatedHttpContent content)) { throw new KubernetesClientException("not a watchable request or failed response"); } - return new Watcher(content.StreamReader, onEvent, onError); + return new Watcher(content.StreamReader, onEvent, onError, onClosed); } /// @@ -143,13 +173,17 @@ namespace k8s /// type of the event object /// the api response /// a callback when any event raised from api server - /// a callbak when any exception was caught during watching + /// a callbak when any exception was caught during watching + /// + /// The action to invoke when the server closes the connection. + /// /// a watch object public static Watcher Watch(this HttpOperationResponse response, Action onEvent, - Action onError = null) + Action onError = null, + Action onClosed = null) { - return Watch((HttpOperationResponse) response, onEvent, onError); + return Watch((HttpOperationResponse)response, onEvent, onError, onClosed); } } } diff --git a/src/KubernetesClient/generated/IKubernetes.Watch.cs b/src/KubernetesClient/generated/IKubernetes.Watch.cs index 0f009be..0bbba2f 100644 --- a/src/KubernetesClient/generated/IKubernetes.Watch.cs +++ b/src/KubernetesClient/generated/IKubernetes.Watch.cs @@ -55,6 +55,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -76,6 +79,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -125,6 +129,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -146,6 +153,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -195,6 +203,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -216,6 +227,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -265,6 +277,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -286,6 +301,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -335,6 +351,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -356,6 +375,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -405,6 +425,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -426,6 +449,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -475,6 +499,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -496,6 +523,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -545,6 +573,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -566,6 +597,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -615,6 +647,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -636,6 +671,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -685,6 +721,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -706,6 +745,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -755,6 +795,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -776,6 +819,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -825,6 +869,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -846,6 +893,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -892,6 +940,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -912,6 +963,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -958,6 +1010,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -978,6 +1033,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -1024,6 +1080,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -1044,6 +1103,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -1090,6 +1150,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -1110,6 +1173,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -1156,6 +1220,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -1176,6 +1243,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -1222,6 +1290,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -1242,6 +1313,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -1288,6 +1360,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -1308,6 +1383,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -1354,6 +1430,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -1374,6 +1453,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -1420,6 +1500,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -1440,6 +1523,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -1489,6 +1573,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -1510,6 +1597,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -1559,6 +1647,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -1580,6 +1671,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -1629,6 +1721,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -1650,6 +1745,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -1699,6 +1795,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -1720,6 +1819,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -1769,6 +1869,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -1790,6 +1893,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -1839,6 +1943,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -1860,6 +1967,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -1909,6 +2017,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -1930,6 +2041,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -1979,6 +2091,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -2000,6 +2115,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -2049,6 +2165,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -2070,6 +2189,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -2119,6 +2239,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -2140,6 +2263,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -2189,6 +2313,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -2210,6 +2337,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -2259,6 +2387,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -2280,6 +2411,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -2329,6 +2461,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -2350,6 +2485,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -2399,6 +2535,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -2420,6 +2559,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -2469,6 +2609,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -2490,6 +2633,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -2539,6 +2683,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -2560,6 +2707,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -2606,6 +2754,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -2626,6 +2777,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -2675,6 +2827,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -2696,6 +2851,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -2745,6 +2901,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -2766,6 +2925,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -2815,6 +2975,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -2836,6 +2999,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -2885,6 +3049,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -2906,6 +3073,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -2955,6 +3123,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -2976,6 +3147,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -3025,6 +3197,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -3046,6 +3221,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -3092,6 +3268,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -3112,6 +3291,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -3158,6 +3338,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -3178,6 +3361,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -3227,6 +3411,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -3248,6 +3435,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -3297,6 +3485,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -3318,6 +3509,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -3364,6 +3556,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -3384,6 +3579,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -3430,6 +3626,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -3450,6 +3649,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -3499,6 +3699,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -3520,6 +3723,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -3569,6 +3773,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -3590,6 +3797,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -3636,6 +3844,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -3656,6 +3867,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -3702,6 +3914,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -3722,6 +3937,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -3771,6 +3987,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -3792,6 +4011,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -3841,6 +4061,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -3862,6 +4085,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -3908,6 +4132,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -3928,6 +4155,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -3977,6 +4205,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -3998,6 +4229,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -4044,6 +4276,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -4064,6 +4299,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -4110,6 +4346,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -4130,6 +4369,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -4176,6 +4416,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -4196,6 +4439,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); /// @@ -4242,6 +4486,9 @@ namespace k8s /// /// The action to invoke when an error occurs. /// + /// + /// The action to invoke when the server closes the connection. + /// /// /// A which can be used to cancel the asynchronous operation. /// @@ -4262,6 +4509,7 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)); } diff --git a/src/KubernetesClient/generated/Kubernetes.Watch.cs b/src/KubernetesClient/generated/Kubernetes.Watch.cs index 2de00f6..644c842 100644 --- a/src/KubernetesClient/generated/Kubernetes.Watch.cs +++ b/src/KubernetesClient/generated/Kubernetes.Watch.cs @@ -24,10 +24,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"api/v1/watch/namespaces/{@namespace}/configmaps/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -46,10 +47,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"api/v1/watch/namespaces/{@namespace}/endpoints/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -68,10 +70,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"api/v1/watch/namespaces/{@namespace}/events/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -90,10 +93,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"api/v1/watch/namespaces/{@namespace}/limitranges/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -112,10 +116,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"api/v1/watch/namespaces/{@namespace}/persistentvolumeclaims/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -134,10 +139,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"api/v1/watch/namespaces/{@namespace}/pods/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -156,10 +162,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"api/v1/watch/namespaces/{@namespace}/podtemplates/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -178,10 +185,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"api/v1/watch/namespaces/{@namespace}/replicationcontrollers/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -200,10 +208,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"api/v1/watch/namespaces/{@namespace}/resourcequotas/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -222,10 +231,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"api/v1/watch/namespaces/{@namespace}/secrets/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -244,10 +254,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"api/v1/watch/namespaces/{@namespace}/serviceaccounts/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -266,10 +277,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"api/v1/watch/namespaces/{@namespace}/services/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -287,10 +299,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"api/v1/watch/namespaces/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -308,10 +321,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"api/v1/watch/nodes/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -329,10 +343,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"api/v1/watch/persistentvolumes/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -350,10 +365,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -371,10 +387,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -392,10 +409,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -413,10 +431,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -434,10 +453,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/apiregistration.k8s.io/v1/watch/apiservices/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -455,10 +475,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/apiregistration.k8s.io/v1beta1/watch/apiservices/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -477,10 +498,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/apps/v1/watch/namespaces/{@namespace}/controllerrevisions/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -499,10 +521,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/apps/v1/watch/namespaces/{@namespace}/daemonsets/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -521,10 +544,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/apps/v1/watch/namespaces/{@namespace}/deployments/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -543,10 +567,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/apps/v1/watch/namespaces/{@namespace}/replicasets/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -565,10 +590,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/apps/v1/watch/namespaces/{@namespace}/statefulsets/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -587,10 +613,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/apps/v1beta1/watch/namespaces/{@namespace}/controllerrevisions/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -609,10 +636,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/apps/v1beta1/watch/namespaces/{@namespace}/statefulsets/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -631,10 +659,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/apps/v1beta2/watch/namespaces/{@namespace}/controllerrevisions/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -653,10 +682,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/apps/v1beta2/watch/namespaces/{@namespace}/daemonsets/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -675,10 +705,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/apps/v1beta2/watch/namespaces/{@namespace}/replicasets/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -697,10 +728,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/apps/v1beta2/watch/namespaces/{@namespace}/statefulsets/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -719,10 +751,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/autoscaling/v1/watch/namespaces/{@namespace}/horizontalpodautoscalers/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -741,10 +774,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/autoscaling/v2beta1/watch/namespaces/{@namespace}/horizontalpodautoscalers/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -763,10 +797,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/batch/v1/watch/namespaces/{@namespace}/jobs/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -785,10 +820,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/batch/v1beta1/watch/namespaces/{@namespace}/cronjobs/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -807,10 +843,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/batch/v2alpha1/watch/namespaces/{@namespace}/cronjobs/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -828,10 +865,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -850,10 +888,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/events.k8s.io/v1beta1/watch/namespaces/{@namespace}/events/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -872,10 +911,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/extensions/v1beta1/watch/namespaces/{@namespace}/daemonsets/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -894,10 +934,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/extensions/v1beta1/watch/namespaces/{@namespace}/ingresses/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -916,10 +957,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/extensions/v1beta1/watch/namespaces/{@namespace}/replicasets/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -938,10 +980,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/networking.k8s.io/v1/watch/namespaces/{@namespace}/networkpolicies/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -960,10 +1003,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/policy/v1beta1/watch/namespaces/{@namespace}/poddisruptionbudgets/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -981,10 +1025,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1002,10 +1047,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/rbac.authorization.k8s.io/v1/watch/clusterroles/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1024,10 +1070,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/rbac.authorization.k8s.io/v1/watch/namespaces/{@namespace}/rolebindings/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1046,10 +1093,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/rbac.authorization.k8s.io/v1/watch/namespaces/{@namespace}/roles/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1067,10 +1115,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1088,10 +1137,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1110,10 +1160,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{@namespace}/rolebindings/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1132,10 +1183,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{@namespace}/roles/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1153,10 +1205,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1174,10 +1227,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1196,10 +1250,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{@namespace}/rolebindings/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1218,10 +1273,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{@namespace}/roles/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1239,10 +1295,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1261,10 +1318,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/settings.k8s.io/v1alpha1/watch/namespaces/{@namespace}/podpresets/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1282,10 +1340,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/storage.k8s.io/v1/watch/storageclasses/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1303,10 +1362,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/storage.k8s.io/v1alpha1/watch/volumeattachments/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1324,10 +1384,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } /// @@ -1345,10 +1406,11 @@ namespace k8s Dictionary> customHeaders = null, Action onEvent = null, Action onError = null, + Action onClosed = null, CancellationToken cancellationToken = default(CancellationToken)) { string path = $"apis/storage.k8s.io/v1beta1/watch/volumeattachments/{name}"; - return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, cancellationToken: cancellationToken); + return WatchObjectAsync(path: path, @continue: @continue, fieldSelector: fieldSelector, includeUninitialized: includeUninitialized, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken); } } diff --git a/tests/KubernetesClient.Tests/WatchTests.cs b/tests/KubernetesClient.Tests/WatchTests.cs index eed51c8..92b3fb4 100644 --- a/tests/KubernetesClient.Tests/WatchTests.cs +++ b/tests/KubernetesClient.Tests/WatchTests.cs @@ -1,5 +1,7 @@ using System; using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; using System.IO; using System.Linq; using System.Net; @@ -86,6 +88,7 @@ namespace k8s.Tests { AsyncCountdownEvent eventsReceived = new AsyncCountdownEvent(4 /* first line of response is eaten by WatcherDelegatingHandler */); AsyncManualResetEvent serverShutdown = new AsyncManualResetEvent(); + AsyncManualResetEvent connectionClosed = new AsyncManualResetEvent(); using (var server = new MockKubeApiServer( @@ -130,7 +133,8 @@ namespace k8s.Tests errors += 1; eventsReceived.Signal(); - } + }, + onClosed: connectionClosed.Set ); // wait server yields all events @@ -150,12 +154,16 @@ namespace k8s.Tests // Let the server know it can initiate a shut down. serverShutdown.Set(); + + await Task.WhenAny(connectionClosed.WaitAsync(), Task.Delay(TestTimeout)); + Assert.True(connectionClosed.IsSet); } } [Fact] public async Task DisposeWatch() { + var connectionClosed = new AsyncManualResetEvent(); var eventsReceived = new AsyncCountdownEvent(1); bool serverRunning = true; @@ -185,7 +193,8 @@ namespace k8s.Tests { events.Add(type); eventsReceived.Signal(); - } + }, + onClosed: connectionClosed.Set ); // wait at least an event @@ -207,13 +216,14 @@ namespace k8s.Tests var timeout = Task.Delay(TestTimeout); - while(!timeout.IsCompleted && watcher.Watching) + while (!timeout.IsCompleted && watcher.Watching) { await Task.Yield(); } Assert.Empty(events); Assert.False(watcher.Watching); + Assert.True(connectionClosed.IsSet); } } @@ -222,6 +232,7 @@ namespace k8s.Tests { AsyncCountdownEvent eventsReceived = new AsyncCountdownEvent(4 /* first line of response is eaten by WatcherDelegatingHandler */); AsyncManualResetEvent serverShutdown = new AsyncManualResetEvent(); + var waitForClosed = new AsyncManualResetEvent(false); using (var server = new MockKubeApiServer(testOutput, async httpContext => { @@ -260,7 +271,8 @@ namespace k8s.Tests errors += 1; eventsReceived.Signal(); - } + }, + onClosed: waitForClosed.Set ); // wait server yields all events @@ -281,6 +293,10 @@ namespace k8s.Tests Assert.True(watcher.Watching); serverShutdown.Set(); + + await Task.WhenAny(waitForClosed.WaitAsync(), Task.Delay(TestTimeout)); + Assert.True(waitForClosed.IsSet); + Assert.False(watcher.Watching); } } @@ -289,6 +305,7 @@ namespace k8s.Tests { AsyncCountdownEvent eventsReceived = new AsyncCountdownEvent(4 /* first line of response is eaten by WatcherDelegatingHandler */); AsyncManualResetEvent serverShutdown = new AsyncManualResetEvent(); + AsyncManualResetEvent connectionClosed = new AsyncManualResetEvent(); using (var server = new MockKubeApiServer(testOutput, async httpContext => { @@ -328,7 +345,8 @@ namespace k8s.Tests errors += 1; eventsReceived.Signal(); - } + }, + onClosed: connectionClosed.Set ); // wait server yields all events @@ -349,6 +367,9 @@ namespace k8s.Tests Assert.True(watcher.Watching); serverShutdown.Set(); + + await Task.WhenAny(connectionClosed.WaitAsync(), Task.Delay(TestTimeout)); + Assert.True(connectionClosed.IsSet); } } @@ -358,6 +379,8 @@ namespace k8s.Tests Exception exceptionCatched = null; var exceptionReceived = new AsyncManualResetEvent(false); var waitForException = new AsyncManualResetEvent(false); + var waitForClosed = new AsyncManualResetEvent(false); + using (var server = new MockKubeApiServer(testOutput, async httpContext => { await WriteStreamLine(httpContext, MockKubeApiServer.MockPodResponse); @@ -375,12 +398,13 @@ namespace k8s.Tests waitForException.Set(); Watcher watcher; watcher = listTask.Watch( - (type, item) => { }, - e => + onEvent: (type, item) => { }, + onError: e => { exceptionCatched = e; exceptionReceived.Set(); - }); + }, + onClosed: waitForClosed.Set); // wait server down await Task.WhenAny(exceptionReceived.WaitAsync(), Task.Delay(TestTimeout)); @@ -390,6 +414,8 @@ namespace k8s.Tests "Timed out waiting for exception" ); + await Task.WhenAny(waitForClosed.WaitAsync(), Task.Delay(TestTimeout)); + Assert.True(waitForClosed.IsSet); Assert.False(watcher.Watching); Assert.IsType(exceptionCatched); } @@ -468,6 +494,7 @@ namespace k8s.Tests { AsyncCountdownEvent eventsReceived = new AsyncCountdownEvent(4); AsyncManualResetEvent serverShutdown = new AsyncManualResetEvent(); + AsyncManualResetEvent connectionClosed = new AsyncManualResetEvent(); using (var server = new MockKubeApiServer(testOutput, async httpContext => { @@ -507,7 +534,8 @@ namespace k8s.Tests errors += 1; eventsReceived.Signal(); - } + }, + onClosed: connectionClosed.Set ); // wait server yields all events @@ -528,10 +556,91 @@ namespace k8s.Tests Assert.True(watcher.Watching); serverShutdown.Set(); + + await Task.WhenAny(connectionClosed.WaitAsync(), Task.Delay(TestTimeout)); + Assert.True(connectionClosed.IsSet); } } - [Fact (Skip = "https://github.com/kubernetes-client/csharp/issues/165")] + [Fact(Skip = "Integration Test")] + public async Task WatcherIntegrationTest() + { + var kubernetesConfig = KubernetesClientConfiguration.BuildConfigFromConfigFile(kubeconfigPath: @"C:\Users\frede\Source\Repos\cloud\minikube.config"); + var kubernetes = new Kubernetes(kubernetesConfig); + + var job = await kubernetes.CreateNamespacedJobAsync( + new V1Job() + { + ApiVersion = "batch/v1", + Kind = V1Job.KubeKind, + Metadata = new V1ObjectMeta() + { + Name = nameof(WatcherIntegrationTest).ToLowerInvariant() + }, + Spec = new V1JobSpec() + { + + Template = new V1PodTemplateSpec() + { + Spec = new V1PodSpec() + { + Containers = new List() + { + new V1Container() + { + Image = "ubuntu/xenial", + Name = "runner", + Command = new List() + { + "/bin/bash", + "-c", + "--" + }, + Args = new List() + { + "trap : TERM INT; sleep infinity & wait" + } + } + }, + RestartPolicy = "Never" + }, + } + } + }, + "default"); + + Collection> events = new Collection>(); + + AsyncManualResetEvent started = new AsyncManualResetEvent(); + AsyncManualResetEvent connectionClosed = new AsyncManualResetEvent(); + + var watcher = await kubernetes.WatchNamespacedJobAsync( + job.Metadata.Name, + job.Metadata.NamespaceProperty, + job.Metadata.ResourceVersion, + timeoutSeconds: 30, + onEvent: + (type, source) => + { + Debug.WriteLine($"Watcher 1: {type}, {source}"); + events.Add(new Tuple(type, source)); + job = source; + started.Set(); + }, + onClosed: connectionClosed.Set).ConfigureAwait(false); + + await started.WaitAsync(); + + await Task.WhenAny(connectionClosed.WaitAsync(), Task.Delay(TimeSpan.FromMinutes(3))); + Assert.True(connectionClosed.IsSet); + + await kubernetes.DeleteNamespacedJobAsync( + new V1DeleteOptions(), + job.Metadata.Name, + job.Metadata.NamespaceProperty); + } + + [Fact(Skip = "https://github.com/kubernetes-client/csharp/issues/165")] public async Task DirectWatchEventsWithTimeout() { AsyncCountdownEvent eventsReceived = new AsyncCountdownEvent(4);