Skip to content

New client proposition #532

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

Closed
lperdereau opened this issue Oct 29, 2021 · 2 comments
Closed

New client proposition #532

lperdereau opened this issue Oct 29, 2021 · 2 comments
Labels
✨ enhancement New feature or improvement
Milestone

Comments

@lperdereau
Copy link

lperdereau commented Oct 29, 2021

In my case I want to generate a client to interact with cloud-hypervisor.
This means, the generated OA Client has to query a socket and not a common HTTP server. I saw your project is using httpx, with whom it is possible to query a socket when specifying a special transport type doc, but it is currently not possible to specify a specific transport type when generating a client.

We could make a new client generation allowing us to take adventage of httpx's features.
As an example, it could be interesting to generate something like this :

from cloud_hypervisor_api_client import Client as CloudHypervisorClient
transport = httpx.HTTPTransport(uds="/var/run/docker.sock")

client = CloudHypervisorClient(transport=transport, base_url="https://api.example.com")
client.vm.get()
client.vm.list()
client.vm.create(VMObject)
client.vm.delete(VMObject)
@lperdereau lperdereau added the ✨ enhancement New feature or improvement label Oct 29, 2021
@dbanty
Copy link
Collaborator

dbanty commented Oct 29, 2021

Is the transport something you can set on the httpx Client? Meaning would #202 potentially solve this?

@lperdereau
Copy link
Author

Actually yes I could set it on the httpx Client, this issue will solved transport methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or improvement
Projects
None yet
Development

No branches or pull requests

2 participants