From 029f46df86ce050d4355c1fad1765411de2bc243 Mon Sep 17 00:00:00 2001 From: arches Date: Wed, 22 Jun 2016 04:34:26 -0400 Subject: [PATCH] Removed mkdir --- etcd/Client.hpp | 9 --------- src/Client.cpp | 13 ------------- 2 files changed, 22 deletions(-) diff --git a/etcd/Client.hpp b/etcd/Client.hpp index 72552a3..e4b846f 100644 --- a/etcd/Client.hpp +++ b/etcd/Client.hpp @@ -102,11 +102,6 @@ namespace etcd */ pplx::task ls(std::string const & key); - /** - * Creates a new directory node. Fails if the parent directory dos not exists or not a directory. - * @param key is the directory to be created to be listed - */ - pplx::task mkdir(std::string const & key); /** * Removes a directory node. Fails if the parent directory dos not exists or not a directory. @@ -135,10 +130,6 @@ namespace etcd protected: - pplx::task send_put_request(web::http::uri_builder & uri, std::string const & key, std::string const & value); - - web::http::client::http_client client; - std::unique_ptr stub_; std::unique_ptr watchServiceStub; diff --git a/src/Client.cpp b/src/Client.cpp index 7f31e05..66dbbfa 100644 --- a/src/Client.cpp +++ b/src/Client.cpp @@ -20,7 +20,6 @@ using etcdserverpb::WatchResponse; using etcdserverpb::WatchCreateRequest; etcd::Client::Client(std::string const & address) - : client(address) { std::string stripped_address(address); std::string substr("http://"); @@ -34,12 +33,6 @@ etcd::Client::Client(std::string const & address) watchServiceStub= Watch::NewStub(channel); } -pplx::task etcd::Client::send_put_request(web::http::uri_builder & uri, std::string const & key, std::string const & value) -{ - std::string data = key + "=" + value; - std::string content_type = "application/x-www-form-urlencoded; param=" + key; - return Response::create(client.request(web::http::methods::PUT, uri.to_string(), data.c_str(), content_type.c_str())); -} pplx::task etcd::Client::get(std::string const & key) { @@ -93,12 +86,6 @@ pplx::task etcd::Client::rm_if(std::string const & key, int old_ } -pplx::task etcd::Client::mkdir(std::string const & key) -{ - web::http::uri_builder uri("/v2/keys" + key); - return send_put_request(uri, "dir", "true"); -} - pplx::task etcd::Client::rmdir(std::string const & key, bool recursive) {