Etcd - Client library for etcd
version 0.004
use Etcd; my $etcd = Etcd->new; say "server version: ".$etcd->server_version; # Key space API # See Etcd::Keys for more info $etcd->set("/message", "hello world"); say "message is: ".$etcd->get("/message")->node->value; # Stats API # See Etcd::Stats for more info say "leader is: ".$etcd->stats("leader")->{leader};
This is a client library for accessing and manipulating data in an etcd cluster. It targets the etcd v2 API.
This module is quite low-level. You're expected to have a good understanding of etcd and its API to understand the methods this module provides. See "SEE ALSO" for further reading.
my $etcd = Etcd->new( %args );
This constructor returns a new Etcd object. Valid arguments include:
host
Hostname or IP address of an etcd server (default: 127.0.0.1)
127.0.0.1
port
Port where the etcd server is listening (default: 4001)
4001
ssl
Use SSL/TLS (ie HTTPS) when talking to the etcd server (default: off)
http
A HTTP::Tiny object to use to access the server. If not specified, one will be created
HTTP::Tiny
my $version = $etcd->server_version;
Queries and returns the server version as a string.
Individual API endpoints are implemented in separate modules. See the documentation for the following modules for more information:
Etcd::Keys - Key space API
Etcd::Stats - Stats API
HTTP::Tiny - for further HTTP client configuration, especially SSL configuration
https://github.com/coreos/etcd - etcd source and documentation
https://coreos.com/docs/distributed-configuration/etcd-api/ - etcd API documentation
Please report bugs or feature requests through the issue tracker at https://github.com/robn/p5-etcd/issues. You will be notified automatically of any progress on your issue.
This is open source software. The code repository is available for public review and contribution under the terms of the license.
https://github.com/robn/p5-etcd
git clone https://github.com/robn/p5-etcd.git
Robert Norris <rob@eatenbyagrue.org>
Matt Harrington
This software is copyright (c) 2014 by Robert Norris.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Etcd, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Etcd
CPAN shell
perl -MCPAN -e shell install Etcd
For more information on module installation, please visit the detailed CPAN module installation guide.