-
Notifications
You must be signed in to change notification settings - Fork 2
/
allowlist.go
27 lines (23 loc) · 1008 Bytes
/
allowlist.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 Allowlist interface {
AllowlistRead(clientID int) ([]IPRule, error)
AllowlistCreate(clientID int, params IPRuleCreationParams) error
AllowlistDelete(clientID int, ids []int) error
}
// AllowlistRead requests the current allowlist 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) AllowlistRead(clientID int) ([]IPRule, error) {
return api.IPListRead(AllowlistType, clientID)
}
// AllowlistCreate creates a allowlist in the Wallarm Cloud.
// API reference: https://apiconsole.eu1.wallarm.com
func (api *api) AllowlistCreate(clientID int, params IPRuleCreationParams) error {
params.List = AllowlistType
return api.IPListCreate(clientID, params)
}
// AllowlistDelete deletes a allowlist for the client.
// API reference: https://apiconsole.eu1.wallarm.com
func (api *api) AllowlistDelete(clientID int, ids []int) error {
return api.IPListDelete(AllowlistType, clientID, ids)
}