diff --git a/models/api_host.go b/models/api_host.go index dfdebfba..4a407802 100644 --- a/models/api_host.go +++ b/models/api_host.go @@ -25,6 +25,7 @@ type ApiHost struct { InternetGateway string `json:"internetgateway"` Nodes []string `json:"nodes"` ProxyEnabled bool `json:"proxy_enabled" yaml:"proxy_enabled"` + IsDefault bool `json:"isdefault" yaml:"isdefault"` } // Host.ConvertNMHostToAPI - converts a Netmaker host to an API editable host @@ -60,6 +61,7 @@ func (h *Host) ConvertNMHostToAPI() *ApiHost { a.PublicKey = h.PublicKey.String() a.Verbosity = h.Verbosity a.Version = h.Version + a.IsDefault = h.IsDefault return &a } @@ -109,6 +111,7 @@ func (a *ApiHost) ConvertAPIHostToNMHost(currentHost *Host) *Host { h.LocalRange = currentHost.LocalRange } h.ProxyEnabled = a.ProxyEnabled + h.IsDefault = a.IsDefault return &h } diff --git a/models/host.go b/models/host.go index 1f515640..861c57e3 100644 --- a/models/host.go +++ b/models/host.go @@ -40,6 +40,7 @@ type Host struct { IsDocker bool `json:"isdocker" yaml:"isdocker"` IsK8S bool `json:"isk8s" yaml:"isk8s"` IsStatic bool `json:"isstatic" yaml:"isstatic"` + IsDefault bool `json:"isdefault" yaml:"isdefault"` } // FormatBool converts a boolean to a [yes|no] string