mirror of
				https://github.com/gravitl/netmaker.git
				synced 2025-10-28 23:16:56 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			575 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			575 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package functions
 | |
| 
 | |
| import (
 | |
| 	"net/http"
 | |
| 
 | |
| 	"github.com/gravitl/netmaker/models/promodels"
 | |
| )
 | |
| 
 | |
| // GetUsergroups - fetch all usergroups
 | |
| func GetUsergroups() *promodels.UserGroups {
 | |
| 	return request[promodels.UserGroups](http.MethodGet, "/api/usergroups", nil)
 | |
| }
 | |
| 
 | |
| // CreateUsergroup - create a usergroup
 | |
| func CreateUsergroup(usergroupName string) {
 | |
| 	request[any](http.MethodPost, "/api/usergroups/"+usergroupName, nil)
 | |
| }
 | |
| 
 | |
| // DeleteUsergroup - delete a usergroup
 | |
| func DeleteUsergroup(usergroupName string) {
 | |
| 	request[any](http.MethodDelete, "/api/usergroups/"+usergroupName, nil)
 | |
| }
 |