-
Notifications
You must be signed in to change notification settings - Fork 1
/
wideip_mx.go
57 lines (48 loc) · 1.57 KB
/
wideip_mx.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright e-Xpert Solutions SA. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package gtm
import "github.com/hillmai/f5client/f5"
// WideipMxEndpoint represents the REST resource for managing WideipMx.
const WideipMxEndpoint = "/wideip/mx"
// WideipMxResource provides an API to manage WideipMx configurations.
type WideipMxResource struct {
c *f5.Client
}
// ListAll lists all the WideipMx configurations.
func (r *WideipMxResource) ListAll() (*WideipList, error) {
var list WideipList
if err := r.c.ReadQuery(BasePath+WideipMxEndpoint, &list); err != nil {
return nil, err
}
return &list, nil
}
// Get a single WideipMx configuration identified by id.
func (r *WideipMxResource) Get(id string) (*Wideip, error) {
var item Wideip
if err := r.c.ReadQuery(BasePath+WideipMxEndpoint, &item); err != nil {
return nil, err
}
return &item, nil
}
// Create a new WideipMx configuration.
func (r *WideipMxResource) Create(item Wideip) error {
if err := r.c.ModQuery("POST", BasePath+WideipMxEndpoint, item); err != nil {
return err
}
return nil
}
// Edit a WideipMx configuration identified by id.
func (r *WideipMxResource) Edit(id string, item Wideip) error {
if err := r.c.ModQuery("PUT", BasePath+WideipMxEndpoint+"/"+id, item); err != nil {
return err
}
return nil
}
// Delete a single WideipMx configuration identified by id.
func (r *WideipMxResource) Delete(id string) error {
if err := r.c.ModQuery("DELETE", BasePath+WideipMxEndpoint+"/"+id, nil); err != nil {
return err
}
return nil
}