diff --git a/object_manager.go b/object_manager.go index 5f8e7b2d..395faab0 100644 --- a/object_manager.go +++ b/object_manager.go @@ -91,9 +91,9 @@ type IBObjectManager interface { UpdateTXTRecord(ref string, recordName string, text string, ttl uint32, useTtl bool, comment string, eas EA) (*RecordTXT, error) UpdateARecord(ref string, name string, ipAddr string, cidr string, netview string, ttl uint32, useTTL bool, comment string, eas EA) (*RecordA, error) UpdateZoneDelegated(ref string, delegate_to []NameServer) (*ZoneDelegated, error) - GetDnsMember(ref string) ([]Dns, error) + GetDnsMember(searchFields map[string]string, ref string) ([]Dns, error) UpdateDnsStatus(ref string, status bool) (Dns, error) - GetDhcpMember(ref string) ([]Dhcp, error) + GetDhcpMember(searchFields map[string]string, ref string) ([]Dhcp, error) UpdateDhcpStatus(ref string, status bool) (Dhcp, error) } diff --git a/object_manager_apps.go b/object_manager_apps.go index 9d0aa45a..46270e5d 100644 --- a/object_manager_apps.go +++ b/object_manager_apps.go @@ -2,9 +2,9 @@ package ibclient import "fmt" -func (objMgr *ObjectManager) GetDnsMember(ref string) ([]Dns, error) { +func (objMgr *ObjectManager) GetDnsMember(searchFields map[string]string, ref string) ([]Dns, error) { var res []Dns - queryParams := NewQueryParams(false, nil) + queryParams := NewQueryParams(false, searchFields) dns := NewDns(Dns{}) err := objMgr.connector.GetObject(dns, ref, queryParams, &res) if err != nil { @@ -17,9 +17,9 @@ func (objMgr *ObjectManager) GetDnsMember(ref string) ([]Dns, error) { return res, nil } -func (objMgr *ObjectManager) GetDhcpMember(ref string) ([]Dhcp, error) { +func (objMgr *ObjectManager) GetDhcpMember(searchFields map[string]string, ref string) ([]Dhcp, error) { var res []Dhcp - queryParams := NewQueryParams(false, nil) + queryParams := NewQueryParams(false, searchFields) dhcp := NewDhcp(Dhcp{}) err := objMgr.connector.GetObject(dhcp, ref, queryParams, &res) if err != nil { diff --git a/object_manager_apps_test.go b/object_manager_apps_test.go index fbf8733b..e1f3681e 100644 --- a/object_manager_apps_test.go +++ b/object_manager_apps_test.go @@ -6,7 +6,7 @@ import ( ) var _ = Describe("Object Manager: apps", func() { - + sf := map[string]string{"host_name": "infoblox.localdomain"} Describe("Get DNS member by reference", func() { cmpType := "Docker" tenantID := "01234567890abcdef01234567890abcdef" @@ -18,7 +18,7 @@ var _ = Describe("Object Manager: apps", func() { ncFakeConnector := &fakeConnector{ getObjectObj: NewDns(Dns{}), getObjectRef: fakeRefReturn, - getObjectQueryParams: NewQueryParams(false, nil), + getObjectQueryParams: NewQueryParams(false, sf), resultObject: resObj, } @@ -27,7 +27,7 @@ var _ = Describe("Object Manager: apps", func() { var actualDns []Dns var err error It("should pass expected Dns Object to GetObject", func() { - actualDns, err = objMgr.GetDnsMember(fakeRefReturn) + actualDns, err = objMgr.GetDnsMember(sf, fakeRefReturn) }) It("should return expected Dns Object", func() { Expect(err).To(BeNil()) @@ -46,7 +46,7 @@ var _ = Describe("Object Manager: apps", func() { ncFakeConnector := &fakeConnector{ getObjectObj: NewDns(Dns{}), getObjectRef: fakeRefReturn, - getObjectQueryParams: NewQueryParams(false, nil), + getObjectQueryParams: NewQueryParams(false, sf), resultObject: resObj, } @@ -55,7 +55,7 @@ var _ = Describe("Object Manager: apps", func() { var actualDns []Dns var err error It("should pass expected Dns Object to GetObject", func() { - actualDns, err = objMgr.GetDnsMember(fakeRefReturn) + actualDns, err = objMgr.GetDnsMember(sf, fakeRefReturn) }) It("should return expected Dns Object", func() { Expect(err).To(BeNil()) @@ -74,7 +74,7 @@ var _ = Describe("Object Manager: apps", func() { ncFakeConnector := &fakeConnector{ getObjectObj: NewDhcp(Dhcp{}), getObjectRef: fakeRefReturn, - getObjectQueryParams: NewQueryParams(false, nil), + getObjectQueryParams: NewQueryParams(false, sf), resultObject: resObj, } @@ -83,7 +83,7 @@ var _ = Describe("Object Manager: apps", func() { var actualDhcp []Dhcp var err error It("should pass expected Dhcp Object to GetObject", func() { - actualDhcp, err = objMgr.GetDhcpMember(fakeRefReturn) + actualDhcp, err = objMgr.GetDhcpMember(sf, fakeRefReturn) }) It("should return expected Dhcp Object", func() { Expect(err).To(BeNil())