You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.
I want to write some code to automate operations with DNS records and plan to reuse gandi.cli as the base layer for interacting with the API. I have two questions:
Could you please provide an example of how to initialize Gandi API client without relying on any configuration files (and preferably disabling them completely to avoid potential clashes)? The code is full of @classmethods, and this approach is foreign for me. For now, I only need v5 API, but it would be nice if you have examples for both XML-RPC and REST APIs.
Is the code thread-safe? I want to run multiple threads with different API keys, and to me the way you configure the classes seems to be global.
The text was updated successfully, but these errors were encountered:
From what I recall there's quite a number of tight couplings in there - if you're planning on using the new LiveDNS API, you'd probably be better off using requests directly (I assume you already checked out https://doc.livedns.gandi.net/)
As you mention there is quite a bit of global and automatic initialization happening, and no config that can be passed around - but instead the slightly annoying GandiModule(GandiConfig), thanks for pointing that out :)
So I'm afraid there's no easy/positive answer for both 1/ and 2/ - of course if someone has another idea I hope they will comment here too, but I'd vote for a slight refactor of this part on our end, and not to use the CLI codebase as a library in the meantime.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I want to write some code to automate operations with DNS records and plan to reuse
gandi.cli
as the base layer for interacting with the API. I have two questions:Could you please provide an example of how to initialize Gandi API client without relying on any configuration files (and preferably disabling them completely to avoid potential clashes)? The code is full of
@classmethod
s, and this approach is foreign for me. For now, I only need v5 API, but it would be nice if you have examples for both XML-RPC and REST APIs.Is the code thread-safe? I want to run multiple threads with different API keys, and to me the way you configure the classes seems to be global.
The text was updated successfully, but these errors were encountered: