netmaker/cli/functions/acl.go
Aceix b8c1dde152
fix(NET-1044): use new update acls endpoint (#2842)
allow for updating both node and client acls
2024-03-05 18:02:27 +07:00

18 lines
538 B
Go

package functions
import (
"fmt"
"net/http"
"github.com/gravitl/netmaker/logic/acls"
)
// GetACL - fetch all ACLs associated with a network
func GetACL(networkName string) *acls.ACLContainer {
return request[acls.ACLContainer](http.MethodGet, fmt.Sprintf("/api/networks/%s/acls", networkName), nil)
}
// UpdateACL - update an ACL
func UpdateACL(networkName string, payload *acls.ACLContainer) *acls.ACLContainer {
return request[acls.ACLContainer](http.MethodPut, fmt.Sprintf("/api/networks/%s/acls/v2", networkName), payload)
}