-
Notifications
You must be signed in to change notification settings - Fork 639
Open
Labels
size: stype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
A screenshot that you have tested with "Try this API".
Currently, the replaceRecords method in the DNS Zone class only accepts a recordType parameter (string or string[]) for filtering records to delete before adding new ones. This is overly restrictive as it deletes ALL records of the specified type(s).
Current signature:
replaceRecords(recordType: string | string[], records: Record | Record[]): Promise<Change>Current behavior:
await zone.replaceRecords("A", recordObject)
// This deletes ALL "A" records in the zone, which is often not desiredWhat would you like to see in the library?
Allow the first parameter to accept a GetRecordsRequest-like object for more granular filtering, enabling users to specify additional criteria like record name.
replaceRecords(
filter: string | string[] | GetRecordsRequest,
records: Record | Record[]
): Promise<Change>Desired usage:
await zone.replaceRecords({ type: "A", name: "oldRecordName" }, recordObject)
// This would only delete "A" records with the specific name "oldRecordName"Describe alternatives you've considered
Currently, users must manually:
- Query existing records with specific filters
- Create the DNS change manually
Additional context/notes
No response
Metadata
Metadata
Assignees
Labels
size: stype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.