Skip to content

Commit

Permalink
Bunp up version for release.
Browse files Browse the repository at this point in the history
  • Loading branch information
hexfusion committed Jun 17, 2017
1 parent 938ea5a commit 9963a74
Show file tree
Hide file tree
Showing 22 changed files with 169 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ install:
script:
- perl Makefile.PL
- make
- make test
- prove -b -r -s -j$(test-jobs) $(test-files)
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Revision history for Net::Etcd
0.012
[ ENHANCEMENTS ]
* Add full support for header based authentication via grpc-gateway. Requires etcd 3.1.0+
* Improve POD

0.011
[ ENHANCEMENTS ]
* Add full support for Txn with tests. Recommended for use with etcd 3.2.0+
Expand Down
12 changes: 7 additions & 5 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ lib/Net/Etcd/User.pm
lib/Net/Etcd/User/Role.pm
lib/Net/Etcd/Watch.pm
t/00-load.t
t/key_value.t
t/lease.t
t/01-key_value.t
t/02-lease.t
t/manifest.t
t/03-maint.t
t/pod-coverage.t
t/pod-spelling.t
t/pod.t
t/txn.t
t/user.t
t/watch.t
t/04-txn.t
t/05-user.t
t/06-watch.t
t/99-auth.t
.travis.yml
86 changes: 69 additions & 17 deletions README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME
Net::Etcd
Net::Etcd - etcd v3 REST API.

SYNOPSIS
Etcd v3.1.0 or greater is required. To use the v3 API make sure to set environment
Expand Down Expand Up @@ -35,58 +35,110 @@ SYNOPSIS
# attach lease to put
$etcd->put( { key => 'foo2', value => 'bar2', lease => 7587821338341002662 } );

# add new user
$etcd->user( { name => 'samba', password => 'foo' } )->add;

# add new user role
$role = $etcd->role( { name => 'myrole' } )->add;

# grant role
$etcd->user_role( { user => 'samba', role => 'myrole' } )->grant;

DESCRIPTION
Net::Etcd is object oriented interface to the v3 REST API provided by
the etcd grpc-gateway <https://github.com/grpc-ecosystem/grpc-gateway>.

ACCESSORS
host
The etcd host. Defaults to 127.0.0.1

port
username
Default 2379.

name
Username for authentication

password
Authentication credentials

ssl
api_root
api_prefix
To enable set to 1

api_version
defaults to /v3alpha

api_path
The full api path. Defaults to http://127.0.0.1:2379/v3alpha

auth_token
The token that is passed during authentication. This is generated during
the authentication process and stored until no longer valid or username
is changed.

PUBLIC METHODS
watch
Returns a Net::Etcd::Watch object.
See Net::Etcd::Watch

$etcd->watch({ key =>'foo', range_end => 'fop' })

role
Returns a Net::Etcd::Auth::Role object.
See Net::Etcd::Auth::Role

$etcd->role({ role => 'foo' });

user_role
Returns a Net::Etcd::User::Role object.
See Net::Etcd::User::Role

$etcd->user_role({ name => 'samba', role => 'foo' });

auth
Returns a Net::Etcd::Auth object.
See Net::Etcd::Auth

$etcd->auth({ name => 'samba', password => 'foo' })->authenticate;
$etcd->auth()->enable;
$etcd->auth()->disable

lease
Returns a Net::Etcd::Lease object.
See Net::Etcd::Lease

$etcd->lease( { ID => 7587821338341002662, TTL => 20 } )->grant;

maintenance
Returns a Net::Etcd::Maintenance object.
See Net::Etcd::Maintenance

$etcd->maintenance()->snapshot

user
Returns a Net::Etcd::User object.
See Net::Etcd::User

$etcd->user( { name => 'samba', password => 'foo' } )->add;

put
Returns a Net::Etcd::KV::Put object.
See Net::Etcd::KV::Put

$etcd->put({ key =>'foo1', value => 'bar' });

range
Returns a Net::Etcd::KV::Range object.
See Net::Etcd::KV::Range

$etcd->range({ key =>'test0', range_end => 'test100' });

txn
Returns a Net::Etcd::KV::Txn object.
See Net::Etcd::KV::Txn

$etcd->txn({ compare => \@compare, success => \@op });

op
See Net::Etcd::KV::Op

$etcd->op({ request_put => $put });
$etcd->op({ request_delete_range => $range });

compare
See Net::Etcd::KV::Compare

$etcd->compare( { key => 'foo', result => 'EQUAL', target => 'VALUE', value => 'baz' });
$etcd->compare( { key => 'foo', target => 'CREATE', result => 'NOT_EQUAL', create_revision => '2' });

configuration
Initialize configuration checks to see it etcd is installed locally.
Expand All @@ -99,9 +151,9 @@ ACKNOWLEDGEMENTS

CAVEATS
The etcd <https://github.com/coreos/etcd> v3 API is in heavy development
and can change at anytime please see
https://github.com/coreos/etcd/blob/master/Documentation/dev-guide/api_r
eference_v3.md for latest details.
and can change at anytime please see api_reference_v3
<https://github.com/coreos/etcd/blob/master/Documentation/dev-guide/api_
reference_v3.md> for latest details.

LICENSE AND COPYRIGHT
Copyright 2017 Sam Batschelet (hexfusion).
Expand Down
86 changes: 71 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# NAME

Net::Etcd
Net::Etcd - etcd v3 REST API.

# SYNOPSIS

Expand Down Expand Up @@ -39,6 +39,15 @@ Net::Etcd
# attach lease to put
$etcd->put( { key => 'foo2', value => 'bar2', lease => 7587821338341002662 } );

# add new user
$etcd->user( { name => 'samba', password => 'foo' } )->add;

# add new user role
$role = $etcd->role( { name => 'myrole' } )->add;

# grant role
$etcd->user_role( { user => 'samba', role => 'myrole' } )->grant;

# DESCRIPTION

[Net::Etcd](https://metacpan.org/pod/Net::Etcd) is object oriented interface to the v3 REST API provided by the etcd [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway).
Expand All @@ -47,71 +56,114 @@ Net::Etcd

## host

The etcd host. Defaults to 127.0.0.1

## port

## username
Default 2379.

## name

Username for authentication

## password

Authentication credentials

## ssl

## api\_root
To enable set to 1

## api\_prefix
## api\_version

defaults to /v3alpha

## api\_path

The full api path. Defaults to http://127.0.0.1:2379/v3alpha

## auth\_token

The token that is passed during authentication. This is generated during the
authentication process and stored until no longer valid or username is changed.

# PUBLIC METHODS

## watch

Returns a [Net::Etcd::Watch](https://metacpan.org/pod/Net::Etcd::Watch) object.
See [Net::Etcd::Watch](https://metacpan.org/pod/Net::Etcd::Watch)

$etcd->watch({ key =>'foo', range_end => 'fop' })

## role

Returns a [Net::Etcd::Auth::Role](https://metacpan.org/pod/Net::Etcd::Auth::Role) object.
See [Net::Etcd::Auth::Role](https://metacpan.org/pod/Net::Etcd::Auth::Role)

$etcd->role({ role => 'foo' });

## user\_role

Returns a [Net::Etcd::User::Role](https://metacpan.org/pod/Net::Etcd::User::Role) object.
See [Net::Etcd::User::Role](https://metacpan.org/pod/Net::Etcd::User::Role)

$etcd->user_role({ name => 'samba', role => 'foo' });

## auth

Returns a [Net::Etcd::Auth](https://metacpan.org/pod/Net::Etcd::Auth) object.
See [Net::Etcd::Auth](https://metacpan.org/pod/Net::Etcd::Auth)

$etcd->auth({ name => 'samba', password => 'foo' })->authenticate;
$etcd->auth()->enable;
$etcd->auth()->disable

## lease

Returns a [Net::Etcd::Lease](https://metacpan.org/pod/Net::Etcd::Lease) object.
See [Net::Etcd::Lease](https://metacpan.org/pod/Net::Etcd::Lease)

$etcd->lease( { ID => 7587821338341002662, TTL => 20 } )->grant;

## maintenance

Returns a [Net::Etcd::Maintenance](https://metacpan.org/pod/Net::Etcd::Maintenance) object.
See [Net::Etcd::Maintenance](https://metacpan.org/pod/Net::Etcd::Maintenance)

$etcd->maintenance()->snapshot

## user

Returns a [Net::Etcd::User](https://metacpan.org/pod/Net::Etcd::User) object.
See [Net::Etcd::User](https://metacpan.org/pod/Net::Etcd::User)

$etcd->user( { name => 'samba', password => 'foo' } )->add;

## put

Returns a [Net::Etcd::KV::Put](https://metacpan.org/pod/Net::Etcd::KV::Put) object.
See [Net::Etcd::KV::Put](https://metacpan.org/pod/Net::Etcd::KV::Put)

$etcd->put({ key =>'foo1', value => 'bar' });

## range

Returns a [Net::Etcd::KV::Range](https://metacpan.org/pod/Net::Etcd::KV::Range) object.
See [Net::Etcd::KV::Range](https://metacpan.org/pod/Net::Etcd::KV::Range)

$etcd->range({ key =>'test0', range_end => 'test100' });

## txn

Returns a [Net::Etcd::KV::Txn](https://metacpan.org/pod/Net::Etcd::KV::Txn) object.
See [Net::Etcd::KV::Txn](https://metacpan.org/pod/Net::Etcd::KV::Txn)

$etcd->txn({ compare => \@compare, success => \@op });

## op

See [Net::Etcd::KV::Op](https://metacpan.org/pod/Net::Etcd::KV::Op)

$etcd->op({ request_put => $put });
$etcd->op({ request_delete_range => $range });

## compare

See [Net::Etcd::KV::Compare](https://metacpan.org/pod/Net::Etcd::KV::Compare)

$etcd->compare( { key => 'foo', result => 'EQUAL', target => 'VALUE', value => 'baz' });
$etcd->compare( { key => 'foo', target => 'CREATE', result => 'NOT_EQUAL', create_revision => '2' });

## configuration

Expand All @@ -127,8 +179,12 @@ The [etcd](https://github.com/coreos/etcd) developers and community.

# CAVEATS

Authentication will not be available until etcd release 3.2.1. For testing puposes you can use my pre-release.

[v3.2.0_plus_git](https://github.com/hexfusion/etcd/releases/tag/v3.2.0_plus_git)

The [etcd](https://github.com/coreos/etcd) v3 API is in heavy development and can change at anytime please see
https://github.com/coreos/etcd/blob/master/Documentation/dev-guide/api\_reference\_v3.md
[api\_reference\_v3](https://github.com/coreos/etcd/blob/master/Documentation/dev-guide/api_reference_v3.md)
for latest details.

# LICENSE AND COPYRIGHT
Expand Down
2 changes: 1 addition & 1 deletion lib/Net/Etcd.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Net::Etcd - etcd v3 REST API.
=cut

our $VERSION = '0.011';
our $VERSION = '0.012';

=head1 SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion lib/Net/Etcd/Auth.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Net::Etcd::Auth
=cut

our $VERSION = '0.011';
our $VERSION = '0.012';

=head1 DESCRIPTION
Expand Down
2 changes: 1 addition & 1 deletion lib/Net/Etcd/Auth/Role.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Net::Etcd::Auth::Role
=cut

our $VERSION = '0.011';
our $VERSION = '0.012';

=head1 DESCRIPTION
Expand Down
2 changes: 1 addition & 1 deletion lib/Net/Etcd/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Net::Etcd::Config
=cut

our $VERSION = '0.011';
our $VERSION = '0.012';

=head1 ACCESSORS
Expand Down
2 changes: 1 addition & 1 deletion lib/Net/Etcd/KV.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Net::Etcd::KV
=cut

our $VERSION = '0.011';
our $VERSION = '0.012';

=head1 DESCRIPTION
Expand Down
Loading

0 comments on commit 9963a74

Please sign in to comment.