-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Authored By: Duke Nguyen <[email protected]> Co-Authored By: Caspian Baska <[email protected]>
- Loading branch information
1 parent
ed7b097
commit b43427e
Showing
15 changed files
with
377 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ name: etcd | |
version: 1.2.5 | ||
crystal: ">= 0.35" | ||
license: MIT | ||
|
||
authors: | ||
- Caspian Baska <[email protected]> | ||
- Duke Nguyen <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,36 @@ | ||
module Etcd::Cluster | ||
private getter client : Etcd::Client | ||
|
||
def initialize(@client = Etcd::Client.new) | ||
end | ||
|
||
# POST cluster/member/add | ||
def member_add | ||
raise "unimplemented" | ||
def member_add(is_learner : Bool, peer_urls : Array(String)) | ||
response = client.api.post("/cluster/member/add", {is_learner: is_learner, peerURLs: peer_urls}).body | ||
Model::Cluster::MemberAdd.from_json(response) | ||
end | ||
|
||
# POST cluster/member/list | ||
def member_list | ||
raise "unimplemented" | ||
response = client.api.post("/cluster/member/list").body | ||
Model::Cluster::Members.from_json(response).members | ||
end | ||
|
||
# POST cluster/member/promote | ||
def member_promote | ||
raise "unimplemented" | ||
def member_promote(id : UInt64) | ||
response = client.api.post("/cluster/member/promote", {ID: id}).body | ||
Model::Cluster::Members.from_json(response).members | ||
end | ||
|
||
# POST cluster/member/remove | ||
def member_remove | ||
raise "unimplemented" | ||
def member_remove(id : UInt64) | ||
response = client.api.post("/cluster/member/remove", {ID: id}).body | ||
Model::Cluster::Members.from_json(response).members | ||
end | ||
|
||
# POST cluster/member/update | ||
def member_update | ||
raise "unimplemented" | ||
def member_update(id : UInt64, peer_urls : Array(String)) | ||
response = client.api.post("/cluster/member/update", {ID: id, peerURLs: peer_urls}).body | ||
Model::Cluster::Members.from_json(response).members | ||
end | ||
end |
Oops, something went wrong.