-
Notifications
You must be signed in to change notification settings - Fork 8
/
failover_interfaces.go
49 lines (36 loc) · 1.04 KB
/
failover_interfaces.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
package ciscoasa
import (
"fmt"
)
// ListFailoverInterfaces returns a collection of Failover Interfaces.
func (s *failoverService) ListFailoverInterfaces() (*FailoverInterfacesCollection, error) {
u := "/api/failover/interfaces"
req, err := s.newRequest("GET", u, nil)
if err != nil {
return nil, err
}
r := &FailoverInterfacesCollection{}
_, err = s.do(req, r)
return r, err
}
// UpdateFailoverInterface updates a Failover Interface.
func (s *failoverService) UpdateFailoverInterface(iface *FailoverInterface) error {
u := fmt.Sprintf("/api/failover/interfaces/%s", iface.ObjectId)
req, err := s.newRequest("PUT", u, iface)
if err != nil {
return err
}
_, err = s.do(req, nil)
return err
}
// GetFailoverInterface retrieves a Failover Interface.
func (s *failoverService) GetFailoverInterface(id string) (*FailoverInterface, error) {
u := fmt.Sprintf("/api/failover/interfaces/%s", id)
req, err := s.newRequest("GET", u, nil)
if err != nil {
return nil, err
}
r := &FailoverInterface{}
_, err = s.do(req, r)
return r, err
}