ns1 / ns1-go

Golang API client for NS1
Apache License 2.0
34 stars 59 forks source link

"Zone Exists" error detection is broken #163

Closed costasd closed 1 year ago

costasd commented 2 years ago

Hello!

I'm using ns1-go and it seems that at some recent point zone exists error handling broke - which broke our ZoneExists error handling as well :)

Digging a bit into this, it looks like NS1 API returns a different string nowadays, which breaks error matching under rest/zone.go's Create function.

I was able to verify with a simple curl invocation on an existing zone as well:

$ curl -X PUT -H "X-NSONE-Key: $NSONE_API_KEY" -d ' { "zone":"example.com", "networks": [0], "ttl": 3600, "refresh": 43200, "retry": 7200, "expiry": 1209600, "nx_ttl": 3600 } ' https://api.nsone.net/v1/zones/example.com
{"message":"invalid: FQDN already exists in the view"}

Seems that the fix in #162 fixes that in all test cases I was able to test.

Best, Costas

eravin-ns1 commented 2 years ago

Thanks for the report. This is fixed in the v2 branch, and we're planning a new release soon.

eravin-ns1 commented 2 years ago

Fixed in #167 in release v2.7.0