https://github.com/cdancy/gradle-etcd-rest-plugin
Gradle plugin for interacting with Etcd's REST API
https://github.com/cdancy/gradle-etcd-rest-plugin
Last synced: 2 months ago
JSON representation
Gradle plugin for interacting with Etcd's REST API
- Host: GitHub
- URL: https://github.com/cdancy/gradle-etcd-rest-plugin
- Owner: cdancy
- License: apache-2.0
- Created: 2016-02-25T12:29:40.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-12-07T17:29:30.000Z (about 9 years ago)
- Last Synced: 2025-01-20T15:19:22.585Z (about 1 year ago)
- Language: Groovy
- Homepage:
- Size: 145 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://travis-ci.org/cdancy/gradle-etcd-rest-plugin)
# gradle-etcd-rest-plugin

Gradle plugin for interacting with Etcd's REST API.
## Setup
```
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'
```
## Documentation
groovydocs can be found via [github pages here](http://cdancy.github.io/gradle-etcd-rest-plugin/docs/groovydoc/)
## Tasks
| Name | Description |
| --- | --- |
| [Version](https://github.com/cdancy/gradle-etcd-rest-plugin/blob/master/src/main/groovy/com/cdancy/gradle/etcd/rest/tasks/miscellaneous/Version.groovy) | Get the version of etcd |
| [Health](https://github.com/cdancy/gradle-etcd-rest-plugin/blob/master/src/main/groovy/com/cdancy/gradle/etcd/rest/tasks/miscellaneous/Health.groovy) | Get the health of the cluster |
| [Metrics](https://github.com/cdancy/gradle-etcd-rest-plugin/blob/master/src/main/groovy/com/cdancy/gradle/etcd/rest/tasks/miscellaneous/Metrics.groovy) | Get the metrics of the cluster |
| [Leader](https://github.com/cdancy/gradle-etcd-rest-plugin/blob/master/src/main/groovy/com/cdancy/gradle/etcd/rest/tasks/statistics/Leader.groovy) | Get the current leader of cluster |
| [Self](https://github.com/cdancy/gradle-etcd-rest-plugin/blob/master/src/main/groovy/com/cdancy/gradle/etcd/rest/tasks/statistics/Self.groovy) | Get the self instance of cluster |
| [Store](https://github.com/cdancy/gradle-etcd-rest-plugin/blob/master/src/main/groovy/com/cdancy/gradle/etcd/rest/tasks/statistics/Store.groovy) | Get the store (statistics) for cluster |
| [List](https://github.com/cdancy/gradle-etcd-rest-plugin/blob/master/src/main/groovy/com/cdancy/gradle/etcd/rest/tasks/members/List.groovy) | List of members in cluster |
| [SetKey](https://github.com/cdancy/gradle-etcd-rest-plugin/blob/master/src/main/groovy/com/cdancy/gradle/etcd/rest/tasks/keys/SetKey.groovy) | Set key in cluster |
| [GetKey](https://github.com/cdancy/gradle-etcd-rest-plugin/blob/master/src/main/groovy/com/cdancy/gradle/etcd/rest/tasks/keys/GetKey.groovy) | Get key in cluster |
| [DeleteKey](https://github.com/cdancy/gradle-etcd-rest-plugin/blob/master/src/main/groovy/com/cdancy/gradle/etcd/rest/tasks/keys/DeleteKey.groovy) | Delete key in cluster |
## Extension
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
}
```
## On Url and Credentials
Because this plugin builds on top of [etcd-rest](https://github.com/cdancy/etcd-rest) library one can supply
the [url and credentials](https://github.com/cdancy/etcd-rest#credentials) in any form this library accepts. Furthermore,
[etcd-rest](https://github.com/cdancy/etcd-rest#property-based-setup) 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.
## Examples
The [functional](https://github.com/cdancy/gradle-etcd-rest-plugin/tree/master/src/functTest/groovy/com/cdancy/gradle/etcd/rest) tests provide many examples that you can use in your own code.
## Components
- etcd-rest \- java library used to interact with etcd program
## Testing
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
## Contributing
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.
## Additional Resources
* [Etcd REST API](https://github.com/coreos/etcd/blob/master/Documentation/v2/api.md)
* [etcd-rest](https://github.com/cdancy/etcd-rest)