Skip to content

Commit

Permalink
Merge pull request scottdware#12 from f5devcentral/revert-11-revert-1…
Browse files Browse the repository at this point in the history
…0-datagroups

Revert "Revert "Add support for data group resource""
  • Loading branch information
scshitole authored Jul 10, 2018
2 parents 94b552d + c7511d7 commit cdf3083
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions ltm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cdf3083

Please sign in to comment.