Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client: add GetVersion method for retrieving of etcdserver and etcdcluster information #6422

Closed
wants to merge 1 commit into from

Conversation

shaunthium
Copy link
Contributor

@shaunthium shaunthium commented Sep 13, 2016

As far as I can tell, currently there are methods to get key and node information, but not for getting version information (as one would get in the form of a request to say, http://127.0.0.1:2379/version). This adds a simple GetVersion method into the Client interface to allow for this.

@@ -104,6 +104,9 @@ type KeysAPI interface {
// Get retrieves a set of Nodes from etcd
Get(ctx context.Context, key string, opts *GetOptions) (*Response, error)

// GetVersion retrieves the current etcdserver and etcdcluster version
GetVersion(ctx context.Context) ([]byte, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getversion should not be inside keys API. keys API is for key operations like put, get, delete.

@shaunthium
Copy link
Contributor Author

@xiang90 updated as per your comments

"golang.org/x/net/context"
)

type GenericClientAPI interface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add the Version method directly into Client interface?

@shaunthium
Copy link
Contributor Author

@xiang90 updated the Version method to be in Client interface

@@ -440,6 +444,29 @@ func (c *httpClusterClient) AutoSync(ctx context.Context, interval time.Duration
}
}

func (c *httpClusterClient) GetVersion(ctx context.Context) ([]byte, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we return a more structured result instead of raw bytes?

@shaunthium
Copy link
Contributor Author

@xiang90 Updated to return version information in a struct instead of a byte array

@gyuho
Copy link
Contributor

gyuho commented Sep 22, 2016

@etcd-bot test this please

@shaunthium Can you squash commits into one?

Thanks.

@shaunthium
Copy link
Contributor Author

@gyuho Have squashed the latest 2 commits into 1. Would you happen to know why my latest Semaphore build seems to fail?

@gyuho
Copy link
Contributor

gyuho commented Sep 22, 2016

@shaunthium They haven't got squashed. We need to squash all commits into one, to make it easy to backport or revert. Could you try again? Thanks!

…er version

this adds a GetVersion method to the Client interface for retrieving
information about the etcdserver and etcdcluster.
@shaunthium
Copy link
Contributor Author

@gyuho Sorry about that, I thought you were just referring to my latest 2 commits. Have squashed all commits

Copy link
Contributor

@gyuho gyuho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defer to @xiang90

Thanks

@gyuho
Copy link
Contributor

gyuho commented Sep 28, 2016

@xiang90 Think same feature could be useful for v3 as well.

Especially for upgrades.

What do you think?

@gyuho
Copy link
Contributor

gyuho commented Jan 24, 2017

@shaunthium Closing this via #7222. We cherry-picked your patch in a separate PR.

Thanks!

@gyuho gyuho closed this Jan 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants