Node SDK support for REST APIs in Managing Records

18 views
Skip to first unread message

daniel

unread,
Sep 10, 2021, 9:18:16 AM9/10/21
to cloud-dns-discuss
I need to programmatically add / update / delete CNAME records.

There are 2 SDKs available for Cloud DNS.
Option A. @google-cloud/dns (https://github.com/googleapis/nodejs-dns)

According to the docs, Option B is in "maintenance mode" and recommends to use Option A for new applications.

However, I am observing that Option B (@googleapis/dns) is limited in the methods that it exposes. There doesn't seem to be any way to update an existing record. Only 2 methods are exposed - create and delete.
Screen Shot 2021-09-09 at 8.47.12 PM.png

Option A (which is considered legacy), provides full-fledged CRUD methods, including patch/update.
Screen Shot 2021-09-09 at 8.49.30 PM.png

The only way to programmatically manage the record seems to be:
1) Use the legacy sdk @googleapis/dns or,
2) Make direct HTTP requests to REST endpoints (https://cloud.google.com/dns/docs/reference/v1/resourceRecordSets)

Is there any way in which I can manage records via the @google-cloud/dns client library? I want to also make updates to the record. It doesn't seem sensible to DELETE and ADD new records when you can easily PATCH.

Many thanks.
Reply all
Reply to author
Forward
0 new messages