Edit DNS records with gcloud by reading/piping from file -
Edit DNS records with gcloud by reading/piping from file -
i able edit dns records gcloud tool interactively editing json file vi/mate using command:
gcloud dns records --zone=myzone edit
however, able mass updates, this:
gcloud dns records --zone=myzone edit < my-additional-records.txt
...where my-additional-records.txt contain dns records want add.
i think not simple json file edit contains both add-on , deletion of dns records. so, tips appreciated.
i think seek using linux line editor 'ed' this:
editor=ed gcloud dns records --zone=myzone edit <<-eof 12i , { "kind": "dns#resourcerecordset", "name": "a.mydomain.org.", "rrdatas": [ "111.222.111.222" ], "ttl": 21600, "type": "a" } . ,wq eof
this assumes top of edit file looks (so append add-on 12th line)
{ "additions": [ { "kind": "dns#resourcerecordset", "name": "mydomain.org.", "rrdatas": [ "ns-cloud-c1.googledomains.com. dns-admin.google.com. 2 21600 3600 1209600 300" ], "ttl": 21600, "type": "soa" },
more details on how utilize ed here: http://www.gnu.org/software/ed/manual/ed_manual.html
dns gcloud google-cloud-dns
Comments
Post a Comment