Fix stripping of extraneous fields since totalEntries now appears first in the JSON #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rackspace appear to have changed the order of fields in the JSON responses so totalEntries field now appears before record, e.g.
{"totalEntries":XX,"records":[{"id":"aaaaaaaaa-aaaaaaaaaa-aaaaaaaa","name":"example.com","type":"A","data":"10.1.1.1","ttl":3600,"updated":"2021-12-13T10:47:23.239Z","created":"2021-10-28T15:29:46.763Z"},...]}
The existing code scripts used in get_domains and get_records then fail to strip the field names properly when processing the data. In the case of get_records this causes the very first record to be mangled - the extra comma that remains confuses AWK column selection.
This is a quick fudge to make it work again. There is probably a more elegant way to fix it once and for all if field order changes again.