From b3db34654d79805c8c069d641b9c8c0ea74c4637 Mon Sep 17 00:00:00 2001 From: ngarratt Date: Thu, 16 May 2024 00:09:47 -0400 Subject: [PATCH] Add func GetZoneDelegatedByRef (#172) --- object_manager.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/object_manager.go b/object_manager.go index 9bfba360..746dc5df 100644 --- a/object_manager.go +++ b/object_manager.go @@ -74,6 +74,7 @@ type IBObjectManager interface { GetTXTRecordByRef(ref string) (*RecordTXT, error) GetZoneAuthByRef(ref string) (*ZoneAuth, error) GetZoneDelegated(fqdn string) (*ZoneDelegated, error) + GetZoneDelegatedByRef(ref string) (*ZoneDelegated, error) GetCapacityReport(name string) ([]CapacityReport, error) GetUpgradeStatus(statusType string) ([]UpgradeStatus, error) GetAllMembers() ([]Member, error) @@ -503,6 +504,17 @@ func (objMgr *ObjectManager) GetZoneAuth() ([]ZoneAuth, error) { return res, err } +// GetZoneDelegatedByRef returns the delegated zone by ref +func (objMgr *ObjectManager) GetZoneDelegatedByRef(ref string) (*ZoneDelegated, error) { + zoneDelegated := NewZoneDelegated(ZoneDelegated{}) + err := objMgr.connector.GetObject( + zoneDelegated, ref, NewQueryParams(false, nil), &zoneDelegated) + if err != nil { + return nil, err + } + return zoneDelegated, nil +} + // GetZoneDelegated returns the delegated zone func (objMgr *ObjectManager) GetZoneDelegated(fqdn string) (*ZoneDelegated, error) { if len(fqdn) == 0 {