etcd3-py icon indicating copy to clipboard operation
etcd3-py copied to clipboard

Docs needed: return values

Open pjz opened this issue 5 years ago • 3 comments

The command documentation is really nice; if all else fails, I can read the code (which is well documented). What's less documented is the return values and the types of the return values... could someone take a swing at that?

pjz avatar Mar 19 '19 18:03 pjz

The return type of these api are dynamically generated class from the swagger specs.

So it's kinda hard to document. Cause when I doc a rtype like :rtype: etcdserverpbSnapshotResponse is not pointing to any code.

Maybe I can manage to hardcode those model classes in the future 😃 . Or make a live document use swagger UI.

For now, you can view these document using swagger HUB:

  • https://app.swaggerhub.com/apis-docs/Revol/etcd3-rpc.proto/3.3

  • https://app.swaggerhub.com/apis-docs/Revol/etcd3-v3lock.proto/3.3

  • https://app.swaggerhub.com/apis-docs/Revol/etcd3-v3election.proto/3.3

Revolution1 avatar Mar 20 '19 17:03 Revolution1

...can I ask why protobufs are even involved? They're not part of the etcd API, are they?

pjz avatar Mar 27 '19 19:03 pjz

https://github.com/etcd-io/etcd/blob/master/Documentation/dev-guide/api_grpc_gateway.md

etcd v3 uses gRPC for its messaging protocol. The etcd project includes a gRPC-based Go client and a command line utility, etcdctl, for communicating with an etcd cluster through gRPC. For languages with no gRPC support, etcd provides a JSON gRPC gateway. This gateway serves a RESTful proxy that translates HTTP/JSON requests into gRPC messages.

Revolution1 avatar Mar 28 '19 05:03 Revolution1