-
Notifications
You must be signed in to change notification settings - Fork 115
/
delete_arp_entries.go
50 lines (38 loc) · 1.03 KB
/
delete_arp_entries.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
package action
import (
"errors"
boshplatform "github.com/cloudfoundry/bosh-agent/platform"
)
type DeleteARPEntriesActionArgs struct {
Ips []string `json:"ips"`
}
type DeleteARPEntriesAction struct {
platform boshplatform.Platform
}
func NewDeleteARPEntries(platform boshplatform.Platform) DeleteARPEntriesAction {
return DeleteARPEntriesAction{
platform: platform,
}
}
func (a DeleteARPEntriesAction) IsAsynchronous(_ ProtocolVersion) bool {
return false
}
func (a DeleteARPEntriesAction) IsPersistent() bool {
return false
}
func (a DeleteARPEntriesAction) IsLoggable() bool {
return true
}
func (a DeleteARPEntriesAction) Run(args DeleteARPEntriesActionArgs) (interface{}, error) {
addresses := args.Ips
for _, address := range addresses {
_ = a.platform.DeleteARPEntryWithIP(address)
}
return map[string]interface{}{}, nil
}
func (a DeleteARPEntriesAction) Resume() (interface{}, error) {
return nil, errors.New("not supported")
}
func (a DeleteARPEntriesAction) Cancel() error {
return errors.New("not supported")
}