-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdenylist.go
27 lines (23 loc) · 992 Bytes
/
denylist.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
package wallarm
type Denylist interface {
DenylistRead(clientID int) ([]IPRule, error)
DenylistCreate(clientID int, params IPRuleCreationParams) error
DenylistDelete(clientID int, ids []int) error
}
// DenylistRead requests the current denylist for the future purposes.
// It is going to respond with the list of IP addresses.
// API reference: https://apiconsole.eu1.wallarm.com
func (api *api) DenylistRead(clientID int) ([]IPRule, error) {
return api.IPListRead(DenylistType, clientID)
}
// DenylistCreate creates a denylist in the Wallarm Cloud.
// API reference: https://apiconsole.eu1.wallarm.com
func (api *api) DenylistCreate(clientID int, params IPRuleCreationParams) error {
params.List = DenylistType
return api.IPListCreate(clientID, params)
}
// DenylistDelete deletes a denylist for the client.
// API reference: https://apiconsole.eu1.wallarm.com
func (api *api) DenylistDelete(clientID int, ids []int) error {
return api.IPListDelete(DenylistType, clientID, ids)
}