{"id":21030699,"url":"https://github.com/cdancy/etcd-rest","last_synced_at":"2025-03-13T19:25:44.693Z","repository":{"id":148673778,"uuid":"52278858","full_name":"cdancy/etcd-rest","owner":"cdancy","description":"Java client for working with etcd's v2 REST API","archived":false,"fork":false,"pushed_at":"2016-12-21T14:09:10.000Z","size":564,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T15:19:22.244Z","etag":null,"topics":["client","etcd","etcd-rest","java","jclouds"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdancy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-22T14:25:26.000Z","updated_at":"2020-06-09T07:33:59.000Z","dependencies_parsed_at":"2023-05-28T15:30:30.151Z","dependency_job_id":null,"html_url":"https://github.com/cdancy/etcd-rest","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdancy%2Fetcd-rest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdancy%2Fetcd-rest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdancy%2Fetcd-rest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdancy%2Fetcd-rest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdancy","download_url":"https://codeload.github.com/cdancy/etcd-rest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243466987,"owners_count":20295310,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","etcd","etcd-rest","java","jclouds"],"created_at":"2024-11-19T12:19:51.354Z","updated_at":"2025-03-13T19:25:44.660Z","avatar_url":"https://github.com/cdancy.png","language":"Java","readme":"** As of 12/20/2016 this project is in legacy mode. Version `1.0.0` is intended to be the final release unless any bugs are reported. There are currently no plans in-flight to support the v3 api though I might pick up that work at sometime in the future, time permitting of course. If anyone wants to take on the work to support the v3 api I would be more than happy to help and mentor.\n\n[![Build Status](https://travis-ci.org/cdancy/etcd-rest.svg?branch=master)](https://travis-ci.org/cdancy/etcd-rest)\n[![Download](https://api.bintray.com/packages/cdancy/java-libraries/etcd-rest/images/download.svg) ](https://bintray.com/cdancy/java-libraries/etcd-rest/_latestVersion)\n# etcd-rest\n![alt tag](https://coreos.com/assets/images/svg/logos/etcd-horizontal-color.svg)\n\njava client, based on jclouds, to interact with Etcd's v2 REST API. \n\n## Setup and How to use\n\nClient's can be built like so:\n\n      EtcdClient client = EtcdClient.builder()\n      .endPoint(\"http://127.0.0.1:2379\") // Optional. Defaults to http://127.0.0.1:2379\n      .credentials(\"admin:password\") // Optional.\n      .build();\n\n      Key createdKey = client.api().keysApi().createKey(\"keyName\", \"keyValue\");\n      \n## Latest release\n\nCan be sourced from jcenter like so:\n\n\t\u003cdependency\u003e\n\t  \u003cgroupId\u003ecom.cdancy\u003c/groupId\u003e\n\t  \u003cartifactId\u003eetcd-rest\u003c/artifactId\u003e\n\t  \u003cversion\u003e1.0.0\u003c/version\u003e\n\t  \u003cclassifier\u003esources|javadoc|all\u003c/classifier\u003e (Optional)\n\t\u003c/dependency\u003e\n\t\n## Documentation\n\njavadocs can be found via [github pages here](http://cdancy.github.io/etcd-rest/docs/javadoc/)\n\n## Property based setup\n\nClient's do NOT need supply the endPoint or credentials as part of instantiating the EtcdClient object. \nInstead one can supply them through system properties, environment variables, or a combination \nof the 2. System properties will be searched first and if not found we will attempt to \nquery the environment.\n\nSetting the `endpoint` can be done with any of the following (searched in order):\n\n- `etcd.rest.endpoint`\n- `etcdRestEndpoint`\n- `ETCD_REST_ENDPOINT`\n- `ETCD_LISTEN_CLIENT_URLS` (first in list that is reachable will be used)\n- `ETCD_ADVERTISE_CLIENT_URLS` (first in list that is reachable will be used)\n\nSetting the `credentials` can be done with any of the following (searched in order):\n\n- `etcd.rest.credentials`\n- `etcdRestCredentials`\n- `ETCD_REST_CREDENTIALS`\n\n## Credentials\n\netcd-rest credentials can take 1 of 2 forms:\n\n- Colon delimited username and password: __admin:password__ \n- Base64 encoded username and password: __YWRtaW46cGFzc3dvcmQ=__ \n\n## Understanding ErrorMessage\n\nInstead of throwing an exception most objects will have an attached [ErrorMessage](https://github.com/cdancy/etcd-rest/blob/master/src/main/java/com/cdancy/etcd/rest/error/ErrorMessage.java). It is up to the user to check the handed back object to see if the `ErrorMessage` is non-null before proceeding. \n\nThe `message` attribute of `ErrorMessage` is what etcd hands back to us when something fails. In some cases the message may be expected (e.g. Key already exists) and in others not (e.g. User HelloWorld already exists). Using the example above one might proceed like this:\n\n      Key createdKey = client.api().keysApi().createKey(\"keyName\", \"keyValue\");\n      if (createdKey.errorMessage() != null) {\n      \n          // at this point we know something popped on the server-side.\n          // now decide whether we care or not.\n          if (createdKey.errorMessage().message().contains(\"Key already exists\")) {\n              // ignore \n          } else {\n              throw new Exception(\"Unexpected error: \" + createdKey.errorMessage().message());\n          }\n      }\n\n## Examples\n\nThe [mock](https://github.com/cdancy/etcd-rest/tree/master/src/test/java/com/cdancy/etcd/rest/features) and [live](https://github.com/cdancy/etcd-rest/tree/master/src/test/java/com/cdancy/etcd/rest/features) tests provide many examples\nthat you can use in your own code.\n\n## Components\n\n- [jclouds](https://github.com/jclouds/jclouds) \\- used as the backend for communicating with Etcd's REST API\n- [AutoValue](https://github.com/google/auto) \\- used to create immutable value types both to and from the etcd program\n    \n## Testing\n\nRunning mock tests can be done like so:\n\n\t./gradlew clean build mockTest\n\t\nRunning integration tests can be done like so (requires docker):\n\n\t./gradlew clean build integTest\n\t\nRunning integration tests without invoking docker can be done like so:\n\n\t./gradlew clean build integTest -PbootstrapDocker=false -PtestEtcdEndpoint=http://127.0.0.1:2379 \n\n## Projects leveraging this library\n\n* [gradle-etcd-rest-plugin](https://github.com/cdancy/gradle-etcd-rest-plugin)\n\n## Additional Resources\n\n* [Etcd REST API](https://github.com/coreos/etcd/blob/master/Documentation/v2/api.md)\n* [Etcd Auth API](https://github.com/coreos/etcd/blob/master/Documentation/v2/auth_api.md)\n* [Apache jclouds](https://jclouds.apache.org/start/)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdancy%2Fetcd-rest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdancy%2Fetcd-rest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdancy%2Fetcd-rest/lists"}