gandi.cli icon indicating copy to clipboard operation
gandi.cli copied to clipboard

Unable to manage domains migrated to Gandi-V5

Open srgvg opened this issue 5 years ago • 7 comments

The v4 gandi domain list still produces the list of my domains, however when I want to look at a domain, gandi record list xyz.abc I get No zone records found, domain xyz.abc doesn't seems to be managed at Gandi.

I looked at the code, and the problem is with what happens in the backend of gandi dns domain.list - the corresponding API backend call returns an empty list.

curl -H "X-Api-Key: $APIKEY" https://dns.api.gandi.net/api/v5/domains 
[]

The same check is performed when editing/creating/listing records, and as the domain is not found, it fails with the former error.

If there is a solution within the gandi.cli client, I'd love to see it implemented. I might have a shot at it myself perhaps.

Can the right way to go forward with this issue be confirmed? Is it something to be solved with the backend API, or the client?

srgvg avatar Jan 15 '19 12:01 srgvg

I wrote a small patch that works around this issue, for me, ee 3b7a62a32bc575b3cb23e56d22dc31baf750cf5d It involves looking up the "sharing_id" of the organisation that 'owns' the domains you want to work on, and adding it in the config file. The sharing id should be saved in ~/.config/gandi/config.yaml as apirest.sharing_id subkey

I won't make a PR of this, as I expect this to just be a temp workaround. AFAICS, we'd need an api to retrieve the different origanization id's available to the user, but that doesn't seem to exist, yet?

srgvg avatar Mar 05 '19 08:03 srgvg

Hello @srgvg , yes this API doesn't exists now, but will be available in near future.

grigouze avatar Mar 06 '19 22:03 grigouze

Hello,

The API now exist, doc: https://api.gandi.net/docs/domains. How soon can we have an update to gandi.cli ? I'm eager to order new domain names via the cli. #288

Thanks.

tristanbes avatar May 14 '19 15:05 tristanbes

Looks like the problem is still present, any idea on a timeline for a fix ?

enys avatar Apr 02 '20 13:04 enys

I found a new workaround, that also solves #291: I implemented it here: https://github.com/srgvg/gandi.cli/commit/15004e3e724e5e79c0fbcc495e5bc2057ad9ff92

Strangely, it seems gandi.cli is using a different API than what is described at https://api.gandi.net/docs/domains - it uses https://dns.api.gandi.net/api/v5

User valere|G told me on the IRC channel, that this is an old API

there will be no future developments on this API
it has been merged into our new REST api endpoint

So it seems gandi.cli needs quite some work to be updated to the real new api, as it for now uses the old one for everything related to dns.

srgvg avatar May 08 '20 15:05 srgvg

@srgvg Thanks for your fix it's working

Did you by any chance create a PR so that Gandi can merge your fix?

This bug has been going around for two years now and I'm very disappointed Gandi was not able to fix it themselves...

wassafr avatar Oct 23 '20 12:10 wassafr

@wassafr no PR, this fix is a bit hacky, where it uses the newer API, and I don't expect this to be acceptable.

AFAIK, the whole client should be rewritten to use the newest API. Perhaps @grigouze could confirm this?

srgvg avatar Oct 23 '20 13:10 srgvg