functions

package
v0.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TenantUrlTemplate = "https://api-%s.app.prod.netmaker.io"
)

Variables

This section is empty.

Functions

func AddHostToNetwork

func AddHostToNetwork(hostID, network string) *hostNetworksUpdatePayload

AddHostToNetwork - add a network to host

func CreateDNS

func CreateDNS(networkName string, payload *models.DNSEntry) *models.DNSEntry

CreateDNS - create a DNS entry

func CreateEgress

func CreateEgress(networkName, nodeID string, payload *models.EgressGatewayRequest) *models.ApiNode

CreateEgress - turn a node into an egress

func CreateEnrollmentKey

func CreateEnrollmentKey(key *models.APIEnrollmentKey) *models.EnrollmentKey

CreateEnrollmentKey - create an enrollment key

func CreateExtClient

func CreateExtClient(networkName, nodeID string, extClient models.CustomExtClient)

CreateExtClient - create an external client

func CreateIngress

func CreateIngress(networkName, nodeID string, failover bool) *models.ApiNode

CreateIngress - turn a node into an ingress

func CreateNetwork

func CreateNetwork(payload *models.Network) *models.Network

CreateNetwork - creates a network

func CreateRelay

func CreateRelay(netID, nodeID string, relayedNodes []string) *models.ApiNode

CreateRelay - add relay to a node

func CreateUser

func CreateUser(payload *models.User) *models.User

CreateUser - create a user

func DeleteDNS

func DeleteDNS(networkName, domainName string) *string

DeleteDNS - delete a DNS entry

func DeleteEgress

func DeleteEgress(networkName, nodeID string) *models.ApiNode

DeleteEgress - remove egress role from a node

func DeleteEnrollmentKey

func DeleteEnrollmentKey(keyID string)

DeleteEnrollmentKey - delete an enrollment key

func DeleteExtClient

func DeleteExtClient(networkName, clientID string) *models.SuccessResponse

DeleteExtClient - delete an external client

func DeleteHost

func DeleteHost(hostID string, force bool) *models.ApiHost

DeleteHost - delete a host

func DeleteHostFromNetwork

func DeleteHostFromNetwork(hostID, network string) *hostNetworksUpdatePayload

DeleteHostFromNetwork - deletes a network from host

func DeleteIngress

func DeleteIngress(networkName, nodeID string) *models.ApiNode

DeleteIngress - remove ingress role from a node

func DeleteNetwork

func DeleteNetwork(name string) *string

DeleteNetwork - delete a network

func DeleteNode

func DeleteNode(networkName, nodeID string, force bool) *models.SuccessResponse

DeleteNode - delete a node

func DeleteRelay

func DeleteRelay(netID, nodeID string) *models.ApiNode

DeleteRelay - remove relay from a node

func DeleteUser

func DeleteUser(username string) *string

DeleteUser - delete a user

func DisableNodeFailover added in v0.24.0

func DisableNodeFailover(nodeID string) *models.SuccessResponse

DisableNodeFailover - Disable failover for a given Node

func EnableNodeFailover added in v0.24.0

func EnableNodeFailover(nodeID string) *models.SuccessResponse

EnableNodeFailover - Enable failover for a given Node

func GetACL

func GetACL(networkName string) *acls.ACLContainer

GetACL - fetch all ACLs associated with a network

func GetAllExtClients

func GetAllExtClients() *[]models.ExtClient

GetAllExtClients - fetch all external clients

func GetAllMetrics

func GetAllMetrics() *models.NetworkMetrics

GetAllMetrics - fetch all metrics

func GetCustomDNS

func GetCustomDNS(networkName string) *[]models.DNSEntry

GetCustomDNS - fetch user defined DNS entriees

func GetDNS

func GetDNS() *[]models.DNSEntry

GetDNS - fetch all DNS entries

func GetEnrollmentKeys

func GetEnrollmentKeys() *[]models.EnrollmentKey

GetEnrollmentKeys - gets all enrollment keys

func GetExtClient

func GetExtClient(networkName, clientID string) *models.ExtClient

GetExtClient - fetch a single external client

func GetExtClientConfig

func GetExtClientConfig(networkName, clientID string) string

GetExtClientConfig - fetch a wireguard config of an external client

func GetHosts

func GetHosts() *[]models.ApiHost

GetHosts - fetch all host entries

func GetLogs

func GetLogs() string

GetLogs - fetch Netmaker server logs

func GetNetwork

func GetNetwork(name string) *models.Network

GetNetwork - fetch a single network

func GetNetworkDNS

func GetNetworkDNS(networkName string) *[]models.DNSEntry

GetNetworkDNS - fetch DNS entries associated with a network

func GetNetworkExtClients

func GetNetworkExtClients(networkName string) *[]models.ExtClient

GetNetworkExtClients - fetch external clients associated with a network

func GetNetworkExtMetrics

func GetNetworkExtMetrics(networkName string) *map[string]models.Metric

GetNetworkExtMetrics - fetch external client metrics belonging to a network

func GetNetworkNodeMetrics

func GetNetworkNodeMetrics(networkName string) *models.NetworkMetrics

GetNetworkNodeMetrics - fetch an entire network's metrics

func GetNetworks

func GetNetworks() *[]models.Network

GetNetworks - fetch all networks

func GetNodeByID

func GetNodeByID(networkName, nodeID string) *models.NodeGet

GetNodeByID - fetch a single node by ID

func GetNodeDNS

func GetNodeDNS(networkName string) *[]models.DNSEntry

GetNodeDNS - fetch all Node DNS entires

func GetNodeMetrics

func GetNodeMetrics(networkName, nodeID string) *models.Metrics

GetNodeMetrics - fetch a single node's metrics

func GetNodes

func GetNodes(networkName ...string) *[]models.ApiNode

GetNodes - fetch all nodes

func GetServerConfig

func GetServerConfig() *cfg.ServerConfig

GetServerConfig - fetch entire server config including secrets

func GetServerHealth

func GetServerHealth() string

GetServerHealth - fetch server current health status

func GetServerInfo

func GetServerInfo() *models.ServerConfig

GetServerInfo - fetch minimal server info

func GetUser

func GetUser(username string) *models.User

GetUser - fetch a single user

func HasAdmin

func HasAdmin() *bool

HasAdmin - check if server has an admin user

func ListUsers

func ListUsers() *[]models.ReturnUser

ListUsers - fetch all users

func PrettyPrint

func PrettyPrint(data any)

PrettyPrint - print JSON with indentation

func PushDNS

func PushDNS() *string

PushDNS - push a DNS entry to CoreDNS

func RefreshKeys

func RefreshKeys(hostID string) any

RefreshKeys - refresh wireguard keys

func UpdateACL

func UpdateACL(networkName string, payload *acls.ACLContainer) *acls.ACLContainer

UpdateACL - update an ACL

func UpdateExtClient

func UpdateExtClient(networkName, clientID string, payload *models.CustomExtClient) *models.ExtClient

UpdateExtClient - update an external client

func UpdateHost

func UpdateHost(hostID string, body *models.ApiHost) *models.ApiHost

UpdateHost - update a host

func UpdateNetwork

func UpdateNetwork(name string, payload *models.Network) *models.Network

UpdateNetwork - updates a network

func UpdateNetworkNodeLimit

func UpdateNetworkNodeLimit(name string, nodeLimit int32) *models.Network

UpdateNetworkNodeLimit - updates a network

func UpdateNode

func UpdateNode(networkName, nodeID string, node *models.ApiNode) *models.ApiNode

UpdateNode - update a single node

func UpdateUser

func UpdateUser(payload *models.User) *models.User

UpdateUser - update a user

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL