NAME
Kubernetes::REST::WatchEvent - A single event from the Kubernetes Watch API
VERSION
version 1.107
SYNOPSIS
$api->watch('Pod',
namespace => 'default',
on_event => sub {
my ($event) = @_;
say $event->type; # ADDED, MODIFIED, DELETED, ERROR, BOOKMARK
say $event->object->metadata->name; # inflated IO::K8s object
say $event->raw->{metadata}{name}; # original hashref
},
);
DESCRIPTION
Represents a single watch event from the Kubernetes API. Watch events are streamed as newline-delimited JSON objects with a type field and an object field.
type
Required. The event type string. One of: ADDED, MODIFIED, DELETED, ERROR, or BOOKMARK.
object
Required. The inflated IO::K8s object for the resource. For ERROR events this is a hashref (the Kubernetes Status object) instead.
raw
Required. The original object hashref from the watch event's JSON, before inflation. Useful for accessing fields that may not be mapped to the IO::K8s class.
SEE ALSO
Kubernetes::REST - Main API client
"watch" in Kubernetes::REST - Watch API documentation
Kubernetes::REST::LogEvent - Analogous event object for the Pod Log API
https://kubernetes.io/docs/reference/using-api/api-concepts/#efficient-detection-of-changes - Kubernetes watch documentation
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/pplu/kubernetes-rest/issues.
IRC
Join #kubernetes on irc.perl.org or message Getty directly.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHORS
Torsten Raudssus <getty@cpan.org>
Jose Luis Martinez Torres <jlmartin@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2019-2026 by Jose Luis Martinez Torres <jlmartin@cpan.org>.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004