Gradle plugin for interacting with Etcd's REST API.
buildscript() {
repositories {
jcenter()
}
dependencies {
classpath group: 'com.cdancy', name: 'gradle-etcd-rest-plugin', version: '0.0.3', changing: true
}
}
apply plugin: 'gradle-etcd-rest-plugin'
groovydocs can be found via github pages here
Name | Description |
---|---|
Version | Get the version of etcd |
Health | Get the health of the cluster |
Metrics | Get the metrics of the cluster |
Leader | Get the current leader of cluster |
Self | Get the self instance of cluster |
Store | Get the store (statistics) for cluster |
List | List of members in cluster |
SetKey | Set key in cluster |
GetKey | Get key in cluster |
DeleteKey | Delete key in cluster |
The etcdRest
extension is provided to define the url
and credentials
for connecting to an Etcd instance.
Using the extension, and subsequently exposing this potentially private information, is required only if one does NOT want to use the various means of setting the aforementioned properties noted in the Credentials
section below.
etcdRest {
url { "http://127.0.0.1:2379" } // Optional and defaults to http://127.0.0.1:2379
credentials { "admin:password" } // Optional and defaults to null
}
Because this plugin builds on top of etcd-rest library one can supply
the url and credentials in any form this library accepts. Furthermore,
etcd-rest allows the url
and credentials
to be optionally supplied through properties or environment variables. This gives great flexibility in the way the user
wants to define and/or hide their url or credentials assuming one does not want to use the etcdRest
extension.
The functional tests provide many examples that you can use in your own code.
- etcd-rest - java library used to interact with etcd program
Running functional tests against an existing etcd program can be done like so:
./gradlew functionalTest -PetcdUrl=http://127.0.0.1:2379
Running functional tests with docker can be done like so:
./gradlew functionalTest -PbootstrapDocker=true
If you're looking for a new feature, or are interested in contributing, we'd love to review your PR. If you don't have a new feature in mind, and are more interested in just hacking on the project, feel free to reach out for suggestions.