NAME

Kubernetes::REST::WatchEvent - A single event from the Kubernetes Watch API

VERSION

version 1.002

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

The event type string. One of: ADDED, MODIFIED, DELETED, ERROR, or BOOKMARK.

object

The inflated IO::K8s object for the resource. For ERROR events this is a hashref (the Kubernetes Status object).

raw

The original hashref from the JSON before inflation. Useful for accessing fields that may not be mapped to the IO::K8s class.

SEE ALSO

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 <torsten@raudssus.de>

  • Jose Luis Martinez Torres <jlmartin@cpan.org> (JLMARTIN, original author, inactive)

COPYRIGHT AND LICENSE

This software is Copyright (c) 2019 by Jose Luis Martinez.

This is free software, licensed under:

The Apache License, Version 2.0, January 2004