From a7a17001a8820e74b92b1d661a6b5820dad6121f Mon Sep 17 00:00:00 2001 From: Girish Kalele Date: Fri, 12 Apr 2019 11:10:04 -0700 Subject: [PATCH] Getter for the tmPartition entity --- partitions.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 partitions.go diff --git a/partitions.go b/partitions.go new file mode 100644 index 0000000..88e1896 --- /dev/null +++ b/partitions.go @@ -0,0 +1,23 @@ +package bigip + +// TMPartitions contains a list of all partitions on the BIG-IP system. +type TMPartitions struct { + TMPartitions []*TMPartition `json:"items"` +} + +type TMPartition struct { + Name string `json:"name,omitempty"` + Kind string `json:"kind,omitempty"` + DefaultRouteDomain int `json:"defaultRouteDomain,omitempty"` + FullPath string `json:"fullPath,omitempty"` + SelfLink string `json:"selfLink,omitempty"` +} + +// TMPartitions returns a list of partitions. +func (b *BigIP) TMPartitions() (*TMPartitions, error) { + var pList TMPartitions + if err, _ := b.getForEntity(&pList, "auth", "tmPartition"); err != nil { + return nil, err + } + return &pList, nil +}