diff --git a/ltm.go b/ltm.go index 716e78c..2ff6ca7 100644 --- a/ltm.go +++ b/ltm.go @@ -1983,13 +1983,27 @@ func (b *BigIP) DeleteInternalDataGroup(name string) error { } // Modify a named internal data group, REPLACING all the records -func (b *BigIP) ModifyInternalDataGroupRecords(name string, records *[]DataGroupRecord) error { +func (b *BigIP) ModifyInternalDataGroupRecords(name string, records []DataGroupRecord) error { config := &DataGroup{ - Records: *records, + Records: records, } return b.put(config, uriLtm, uriDatagroup, uriInternal, name) } +// Get an internal data group by name, returns nil if the data group does not exist +func (b *BigIP) GetInternalDataGroup(name string) (*DataGroup, error) { + var datagroup DataGroup + err, ok := b.getForEntity(&datagroup, uriLtm, uriDatagroup, uriInternal, name) + if err != nil { + return nil, err + } + if !ok { + return nil, nil + } + + return &datagroup, nil +} + // Get the internal data group records for a named internal data group func (b *BigIP) GetInternalDataGroupRecords(name string) (*[]DataGroupRecord, error) { var dataGroup DataGroup