hcl

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeResourceData added in v0.0.7

func DecodeResourceData[T any](d *schema.ResourceData) (T, error)

DecodeResourceData decodes TF resource data (HCL+schema filters/etc) into the given struct, using the `tf` tag. If a field doesn't have a `tf` tag, it won't be populated.

func EncodeResourceData added in v0.0.7

func EncodeResourceData(in any, d *schema.ResourceData) error

EncodeResourceData sets the values on the given ResourceData according to the struct's tf tags.

Types

type AccessRule added in v1.0.0

type AccessRule struct {
	AppID      string           `tf:"app"`
	Action     string           `tf:"action"`
	Name       string           `tf:"name"`
	Exceptions []AccessRuleItem `tf:"exception"`
	Includes   []AccessRuleItem `tf:"include"`
	Requires   []AccessRuleItem `tf:"require"`
}

func (*AccessRule) ResourceURL added in v1.0.0

func (h *AccessRule) ResourceURL(ID string) string

func (*AccessRule) ToTG added in v1.0.0

func (h *AccessRule) ToTG() tg.AppAccessRule

func (*AccessRule) URL added in v1.0.0

func (h *AccessRule) URL() string

func (*AccessRule) UpdateFromTG added in v1.0.0

func (h *AccessRule) UpdateFromTG(r tg.AppAccessRule)

type AccessRuleItem added in v1.0.0

type AccessRuleItem struct {
	Emails         []string `tf:"emails"`
	Everyone       bool     `tf:"everyone"`
	IPRanges       []string `tf:"ip_ranges"`
	Countries      []string `tf:"countries"`
	EmailsEndingIn []string `tf:"emails_ending_in"`
	IDPGroups      []string `tf:"idp_groups"`
	AccessGroups   []string `tf:"access_groups"`
}

func (*AccessRuleItem) ToTG added in v1.0.0

func (h *AccessRuleItem) ToTG() *tg.AppAccessRuleItem

func (*AccessRuleItem) UpdateFromTG added in v1.0.0

func (h *AccessRuleItem) UpdateFromTG(item tg.AppAccessRuleItem)

type Alarm added in v1.9.0

type Alarm struct {
	UID         string    `tf:"uid"`
	Name        string    `tf:"name"`
	Channels    []string  `tf:"channels"`
	Description string    `tf:"description"`
	Expr        string    `tf:"expr"`
	FreeText    string    `tf:"freetext"`
	Nodes       []string  `tf:"nodes"`
	Operator    string    `tf:"operator"`
	TagOperator string    `tf:"tag_operator"`
	Tags        []tagging `tf:"tag"`
	Enabled     bool      `tf:"enabled"`
	Threshold   string    `tf:"threshold"`
	Types       []string  `tf:"types"`
}

func (*Alarm) ResourceURL added in v1.9.0

func (h *Alarm) ResourceURL(ID string) string

func (Alarm) ToTG added in v1.9.0

func (h Alarm) ToTG() tg.Alarm

func (*Alarm) URL added in v1.9.0

func (h *Alarm) URL() string

func (Alarm) UpdateFromTG added in v1.9.0

func (h Alarm) UpdateFromTG(a tg.Alarm) HCL[tg.Alarm]

type AlarmChannel added in v1.9.0

type AlarmChannel struct {
	UID            string         `tf:"uid"`
	Name           string         `tf:"name"`
	Emails         []string       `tf:"emails"`
	GenericWebhook string         `tf:"generic_webhook"`
	MSTeams        string         `tf:"ms_teams"`
	OpsGenie       string         `tf:"ops_genie"`
	Pagerduty      string         `tf:"pagerduty"`
	Slack          []slackChannel `tf:"slack"`
}

func (*AlarmChannel) ResourceURL added in v1.9.0

func (h *AlarmChannel) ResourceURL(ID string) string

func (AlarmChannel) ToTG added in v1.9.0

func (h AlarmChannel) ToTG() tg.AlarmChannel

func (*AlarmChannel) URL added in v1.9.0

func (h *AlarmChannel) URL() string

func (AlarmChannel) UpdateFromTG added in v1.9.0

func (h AlarmChannel) UpdateFromTG(a tg.AlarmChannel) HCL[tg.AlarmChannel]

type App added in v1.0.0

type App struct {
	AppType             string   `tf:"type"`
	Name                string   `tf:"name"`
	UID                 string   `tf:"uid"`
	Description         string   `tf:"description"`
	EdgeNodeID          string   `tf:"edge_node"`
	GatewayNodeID       string   `tf:"gateway_node"`
	IDPID               string   `tf:"idp"`
	IP                  string   `tf:"ip"`
	Port                int      `tf:"port"`
	Protocol            string   `tf:"protocol"`
	Hostname            string   `tf:"hostname"`
	SessionDuration     int      `tf:"session_duration"`
	TLSVerificationMode string   `tf:"tls_verification_mode"`
	TrustMode           string   `tf:"trust_mode"`
	GroupIDs            []string `tf:"visibility_groups"`
	WireGuardTemplate   string   `tf:"wireguard_template"`
	VRF                 string   `tf:"vrf"`
	VirtualNetwork      string   `tf:"virtual_network"`
	VirtualSourceIP     string   `tf:"virtual_source_ip"`
}

func (*App) ResourceURL added in v1.0.0

func (h *App) ResourceURL(ID string) string

func (*App) ToTG added in v1.0.0

func (h *App) ToTG() tg.App

func (*App) URL added in v1.0.0

func (h *App) URL() string

func (*App) UpdateFromTG added in v1.0.0

func (h *App) UpdateFromTG(a tg.App)

type AppACL added in v1.0.0

type AppACL struct {
	AppID       string   `tf:"app"`
	Description string   `tf:"description"`
	IPs         []string `tf:"ips"`
	PortRange   string   `tf:"port_range"`
	Protocol    string   `tf:"protocol"`
}

func (*AppACL) ResourceURL added in v1.0.0

func (h *AppACL) ResourceURL(ID string) string

func (*AppACL) ToTG added in v1.0.0

func (h *AppACL) ToTG() *tg.AppACL

func (*AppACL) URL added in v1.0.0

func (h *AppACL) URL() string

func (*AppACL) UpdateFromTG added in v1.0.0

func (h *AppACL) UpdateFromTG(r tg.AppACL)

type Cert added in v1.12.0

type Cert struct {
	FQDN string `tf:"fqdn"`

	Body       string `tf:"body"`
	Chain      string `tf:"chain"`
	PrivateKey string `tf:"private_key"`
}

func (Cert) ToTG added in v1.12.0

func (c Cert) ToTG() tg.Cert

func (Cert) UpdateFromTG added in v1.12.0

func (c Cert) UpdateFromTG(t tg.Cert) HCL[tg.Cert]

type Cluster added in v1.12.1

type Cluster struct {
	FQDN string `tf:"fqdn"`
	Name string `tf:"name"`
}

func (Cluster) ToTG added in v1.12.1

func (c Cluster) ToTG() tg.Cluster

func (Cluster) UpdateFromTG added in v1.12.1

func (c Cluster) UpdateFromTG(a tg.Cluster) HCL[tg.Cluster]

type Connector added in v1.6.0

type Connector struct {
	NodeID      string `tf:"node_id"`
	ClusterFQDN string `tf:"cluster_fqdn"`
	Node        string `tf:"node"`
	Port        int    `tf:"port"`
	Protocol    string `tf:"protocol"`
	Service     string `tf:"service"`
	Description string `tf:"description"`
	RateLimit   int    `tf:"rate_limit,omitempty"`
}

func (*Connector) ToTG added in v1.6.0

func (c *Connector) ToTG(id string) tg.Connector

func (*Connector) UpdateFromTG added in v1.6.0

func (c *Connector) UpdateFromTG(conn tg.Connector)

type Container added in v1.12.0

type Container struct {
	NodeID              string           `tf:"node_id"`
	ClusterFQDN         string           `tf:"cluster_fqdn"`
	ID                  string           `tf:"id"`
	Command             string           `tf:"command"`
	Description         string           `tf:"description"`
	Enabled             bool             `tf:"enabled"`
	ExecType            string           `tf:"exec_type"`
	Hostname            string           `tf:"hostname"`
	Image               []ContainerImage `tf:"image"`
	Name                string           `tf:"name"`
	Privileged          bool             `tf:"privileged"`
	RequireConnectivity bool             `tf:"require_connectivity"`
	StopTime            int              `tf:"stop_time"`
	UseInit             bool             `tf:"use_init"`
	User                string           `tf:"user"`
	VRF                 string           `tf:"vrf"`

	AddCaps      []string               `tf:"add_caps"`
	DropCaps     []string               `tf:"drop_caps"`
	Variables    map[string]string      `tf:"variables"`
	Healthchecks []ContainerHealthCheck `tf:"healthcheck"`

	LogMaxFileSize int `tf:"log_max_file_size"`
	LogMaxNumFiles int `tf:"log_max_num_files"`

	Limits          []ContainerLimit          `tf:"limits"`
	Mounts          []ContainerMount          `tf:"mount"`
	PortMappings    []ContainerPortMapping    `tf:"port_mapping"`
	VirtualNetworks []ContainerVirtualNetwork `tf:"virtual_network"`
	Interfaces      []ContainerInterface      `tf:"interface"`
}

func (*Container) ToTG added in v1.12.0

func (tfc *Container) ToTG() tg.Container

func (*Container) UpdateFromTG added in v1.12.0

func (tfc *Container) UpdateFromTG(c tg.Container)

type ContainerHealthCheck added in v1.12.0

type ContainerHealthCheck struct {
	Command     string `tf:"command"`
	Interval    int    `tf:"interval"`
	Timeout     int    `tf:"timeout"`
	StartPeriod int    `tf:"start_period"`
	Retries     int    `tf:"retries"`
}

type ContainerImage added in v1.12.0

type ContainerImage struct {
	Repository string `tf:"repository"`
	Tag        string `tf:"tag"`
}

type ContainerInterface added in v1.12.0

type ContainerInterface struct {
	UID  string `tf:"uid"`
	Name string `tf:"name"`
	Dest string `tf:"dest"`
}

type ContainerLimit added in v1.12.0

type ContainerLimit struct {
	CPUMax  int `tf:"cpu_max"`
	IORBPS  int `tf:"io_rbps"`
	IOWBPS  int `tf:"io_wbps"`
	IORIOPS int `tf:"io_riops"`
	IOWIOPS int `tf:"io_wiops"`
	MemMax  int `tf:"mem_max"`
	MemHigh int `tf:"mem_high"`

	Limits []ContainerULimit `tf:"limits"`
}

type ContainerMount added in v1.12.0

type ContainerMount struct {
	UID    string `tf:"uid"`
	Type   string `tf:"type"`
	Source string `tf:"source"`
	Dest   string `tf:"dest"`
}

type ContainerPortMapping added in v1.12.0

type ContainerPortMapping struct {
	UID           string `tf:"uid"`
	Protocol      string `tf:"protocol"`
	IFace         string `tf:"iface"`
	HostPort      int    `tf:"host_port"`
	ContainerPort int    `tf:"container_port"`
}

type ContainerULimit added in v1.12.0

type ContainerULimit struct {
	Type string `tf:"type"`
	Hard int    `tf:"hard"`
	Soft int    `tf:"soft"`
}

type ContainerVirtualNetwork added in v1.12.0

type ContainerVirtualNetwork struct {
	UID           string `tf:"uid"`
	Network       string `tf:"network"`
	IP            string `tf:"ip"`
	AllowOutbound bool   `tf:"allow_outbound"`
}

type Device added in v1.11.0

type Device struct {
	LANs   []nicName `tf:"lans,omitempty"`
	WAN    nicName   `tf:"wan,omitempty"`
	Model  string    `tf:"model,omitempty"`
	Vendor string    `tf:"vendor,omitempty"`
}

func (*Device) UpdateFromTG added in v1.11.0

func (d *Device) UpdateFromTG(device tg.Device)

UpdateFromTG sets this device's fields based on the given tg.Device. If the LAN and WAN interfaces are provided from the API, those are used, otherwise we rely on this super long switch statement to set them based on the device model and vendor.

type GatewayClient added in v1.12.0

type GatewayClient struct {
	Name    string `tf:"name"`
	Enabled bool   `tf:"enabled"`
}

type GatewayConfig added in v1.12.0

type GatewayConfig struct {
	NodeID   string `tf:"node_id"`
	Domain   string `tf:"-"`
	Cluster  string `tf:"-"`
	NodeName string `tf:"-"`

	Enabled            bool   `tf:"enabled"`
	Host               string `tf:"host"`
	Port               int    `tf:"port"`
	MaxMBPS            int    `tf:"maxmbps"`
	ConnectToPublic    bool   `tf:"connect_to_public"`
	Type               string `tf:"type"`
	MonitorHops        bool   `tf:"monitor_hops"`
	MaxClientWriteMBPS int    `tf:"max_client_write_mbps"`

	UDPEnabled bool `tf:"udp_enabled"`
	UDPPort    int  `tf:"udp_port"`

	Cert string `tf:"cert"`

	Clients []GatewayClient `tf:"client"`

	Paths []GatewayPath `tf:"path"`

	Routes []GatewayRoute `tf:"route"`
}

func (GatewayConfig) ToTG added in v1.12.0

func (gc GatewayConfig) ToTG() tg.GatewayConfig

func (GatewayConfig) UpdateFromTG added in v1.12.0

func (gc GatewayConfig) UpdateFromTG(a tg.GatewayConfig) HCL[tg.GatewayConfig]

type GatewayPath added in v1.12.0

type GatewayPath struct {
	ID   string `tf:"id"`
	Host string `tf:"host"`
	Port int    `tf:"port"`
	Node string `tf:"node"`
}

type GatewayRoute added in v1.12.0

type GatewayRoute struct {
	Route  string `tf:"route"`
	Dest   string `tf:"dest"`
	Metric int    `tf:"metric"`
}

type Group added in v1.3.7

type Group struct {
	Name        string `tf:"name"`
	UID         string `tf:"uid"`
	IDPID       string `tf:"idp_id"`
	Description string `tf:"description"`
}

Group holds the HCL representation of a group

func (*Group) ResourceURL added in v1.3.7

func (g *Group) ResourceURL(ID string) string

ResourceURL returns the URL for a specific group on the TG API side

func (*Group) ToTG added in v1.3.7

func (g *Group) ToTG() tg.Group

ToTG returns the TG API representation of a group from the HCL representation

func (*Group) URL added in v1.3.7

func (g *Group) URL() string

URL returns the URL for the group resource on the TG API side

func (*Group) UpdateFromTG added in v1.3.7

func (g *Group) UpdateFromTG(o tg.Group)

UpdateFromTG updates the HCL representation of a group from the TG API representation

type GroupMember added in v1.3.7

type GroupMember struct {
	GroupID string `tf:"group_id"`
	Email   string `tf:"email"`
}

GroupMember holds the HCL representation of a group member

type HCL added in v1.12.0

type HCL[T any] interface {
	ToTG() T
	UpdateFromTG(T) HCL[T]
}

type IDP added in v1.0.0

type IDP struct {
	UID         string `tf:"uid"`
	Type        string `tf:"type"`
	Description string `tf:"description"`
	Name        string `tf:"name"`
}

IDP holds HCL-marshaled TF state for an IDP

func (*IDP) ResourceURL added in v1.0.0

func (h *IDP) ResourceURL() string

ResourceURL sends back the IDP's specific URL for the TG API

func (*IDP) ToTG added in v1.0.0

func (h *IDP) ToTG() *tg.IDP

ToTG returns the IDP converted to a TG API consumable IDP

func (*IDP) URL added in v1.0.0

func (h *IDP) URL() string

URL sends back the generic IDP management URL for the TG API

func (*IDP) UpdateFromTG added in v1.0.0

func (h *IDP) UpdateFromTG(r tg.IDP)

UpdateFromTG updates the IDP with the IDP from the TG API

type IDPOpenIDConfig added in v1.3.7

type IDPOpenIDConfig struct {
	UID              string `tf:"idp_id"`
	Issuer           string `tf:"issuer"`
	ClientID         string `tf:"client_id"`
	Secret           string `tf:"secret"`
	AuthEndpoint     string `tf:"auth_endpoint"`
	TokenEndpoint    string `tf:"token_endpoint"`
	UserInfoEndpoint string `tf:"user_info_endpoint"`
}

IDPOpenIDConfig holds HCL-marshaled TF state for an IDP OpenID config

func (*IDPOpenIDConfig) ResourceURL added in v1.3.7

func (idp *IDPOpenIDConfig) ResourceURL(ID string) string

ResourceURL sends back the IDP OpenID config's specific URL for the TG API

func (*IDPOpenIDConfig) ToTG added in v1.3.7

func (idp *IDPOpenIDConfig) ToTG() tg.IDPOpenIDConfig

ToTG returns the IDP OpenID config converted to a TG API consumable IDP OpenID config

func (*IDPOpenIDConfig) UpdateFromTG added in v1.3.7

func (idp *IDPOpenIDConfig) UpdateFromTG(o tg.IDPOpenIDConfig)

UpdateFromTG updates the IDP OpenID config with the IDP OpenID config from the TG API

type IDPSAMLConfig added in v1.3.7

type IDPSAMLConfig struct {
	UID      string `tf:"idp_id"`
	LoginURL string `tf:"login_url"`
	Issuer   string `tf:"issuer"`
	Cert     string `tf:"cert"`
}

IDPSAMLConfig holds HCL-marshaled TF state for an IDP SAML config

func (*IDPSAMLConfig) ResourceURL added in v1.3.7

func (idp *IDPSAMLConfig) ResourceURL(ID string) string

ResourceURL sends back the IDP SAML config's specific URL for the TG API

func (*IDPSAMLConfig) ToTG added in v1.3.7

func (idp *IDPSAMLConfig) ToTG() tg.IDPSAMLConfig

ToTG returns the IDP SAML config converted to a TG API consumable IDP SAML config

func (*IDPSAMLConfig) UpdateFromTG added in v1.3.7

func (idp *IDPSAMLConfig) UpdateFromTG(o tg.IDPSAMLConfig)

UpdateFromTG updates the IDP SAML config with the IDP SAML config from the TG API

type KVMImage added in v1.0.0

type KVMImage struct {
	NodeID string `tf:"node_id"`
	UID    string `tf:"uid"`

	Description string `tf:"description"`
	DisplayName string `tf:"display_name"`
	Location    string `tf:"location"`
	OS          string `tf:"os"`
}

func (*KVMImage) ResourceURL added in v1.0.0

func (h *KVMImage) ResourceURL(ID string) string

func (*KVMImage) ToTG added in v1.0.0

func (h *KVMImage) ToTG() *tg.KVMImage

func (*KVMImage) URL added in v1.0.0

func (h *KVMImage) URL() string

func (*KVMImage) UpdateFromTG added in v1.0.0

func (h *KVMImage) UpdateFromTG(r tg.KVMImage)

type KVMVolume added in v1.0.0

type KVMVolume struct {
	NodeID string `tf:"node_id"`

	Name          string `tf:"name"`
	DeviceType    string `tf:"device_type"`
	DeviseBus     string `tf:"device_bus"`
	Size          int    `tf:"size"`
	ProvisionType string `tf:"provision_type"`
	Encrypted     bool   `tf:"encrypted"`
	Path          string `tf:"path"`
}

func (*KVMVolume) ResourceURL added in v1.0.0

func (h *KVMVolume) ResourceURL() string

func (*KVMVolume) ToTG added in v1.0.0

func (h *KVMVolume) ToTG() *tg.KVMVolume

func (*KVMVolume) URL added in v1.0.0

func (h *KVMVolume) URL() string

func (*KVMVolume) UpdateFromTG added in v1.0.0

func (h *KVMVolume) UpdateFromTG(r tg.KVMVolume)

type NetworkConfig added in v1.0.0

type NetworkConfig struct {
	DarkMode   *bool `tf:"dark_mode"`
	Forwarding *bool `tf:"forwarding"`

	Tunnels []NetworkTunnel `tf:"tunnel"`

	Interfaces []NetworkInterface `tf:"interface"`

	VRFs []VRF `tf:"vrf"`
}

func (*NetworkConfig) ToTG added in v1.0.0

func (h *NetworkConfig) ToTG() tg.NetworkConfig

func (*NetworkConfig) UpdateFromTG added in v1.0.0

func (h *NetworkConfig) UpdateFromTG(c tg.NetworkConfig)

type NetworkInterface added in v1.0.0

type NetworkInterface struct {
	NIC                string         `tf:"nic"`
	Routes             []NetworkRoute `tf:"route,omitempty"`
	SubInterfaces      []SubInterface `tf:"subinterface,omitempty"`
	CloudRoutes        []NetworkRoute `tf:"cloud_route,omitempty"`
	ClusterRouteTables []string       `tf:"cluster_route_tables,omitempty"`
	ClusterIP          string         `tf:"cluster_ip,omitempty"`
	DHCP               bool           `tf:"dhcp"`
	Gateway            string         `tf:"gateway"`
	IP                 string         `tf:"ip"`
	Mode               string         `tf:"mode,omitempty"`
	DNS                []string       `tf:"dns,omitempty"`
	Duplex             string         `tf:"duplex,omitempty"`
	Speed              int            `tf:"speed,omitempty"`
}

func (NetworkInterface) ToTG added in v1.11.0

type NetworkRoute added in v1.7.0

type NetworkRoute struct {
	Route       string `tf:"route"`
	Description string `tf:"description"`
}

type NetworkTunnel added in v1.0.0

type NetworkTunnel struct {
	Enabled       bool   `tf:"enabled"`
	Name          string `tf:"name"`
	IKE           int    `tf:"ike,omitempty"`
	IKECipher     string `tf:"ike_cipher,omitempty"`
	IKEGroup      int    `tf:"ike_group,omitempty"`
	RekeyInterval int    `tf:"rekey_interval,omitempty"`
	IP            string `tf:"ip,omitempty"`
	Destination   string `tf:"destination,omitempty"`
	IPSecCipher   string `tf:"ipsec_cipher,omitempty"`
	PSK           string `tf:"psk,omitempty"`
	VRF           string `tf:"vrf,omitempty"`
	Type          string `tf:"type"`
	MTU           int    `tf:"mtu"`
	NetworkID     int    `tf:"network_id"`
	LocalID       string `tf:"local_id,omitempty"`
	RemoteID      string `tf:"remote_id,omitempty"`
	DPDRetries    int    `tf:"dpd_retries,omitempty"`
	DPDInterval   int    `tf:"dpd_interval,omitempty"`
	IFace         string `tf:"iface,omitempty"`
	PFS           int    `tf:"pfs"`
	ReplayWindow  int    `tf:"replay_window,omitempty"`
	RemoteSubnet  string `tf:"remote_subnet,omitempty"`
	LocalSubnet   string `tf:"local_subnet,omitempty"`
	Description   string `tf:"description,omitempty"`
}

func (NetworkTunnel) ToTG added in v1.11.0

func (t NetworkTunnel) ToTG() tg.NetworkTunnel

type Node added in v1.3.0

type Node struct {
	UID     string `tf:"node_id"`
	Enabled bool   `tf:"enabled"`
}

func (Node) ToTG added in v1.3.0

func (h Node) ToTG() tg.NodeState

func (Node) UpdateFromTG added in v1.3.0

func (h Node) UpdateFromTG(a tg.NodeState) HCL[tg.NodeState]

type PortalAuth added in v1.4.0

type PortalAuth struct {
	IDPID  string `tf:"idp_id"`
	Domain string `tf:"domain"`
}

func (*PortalAuth) ToTG added in v1.4.0

func (p *PortalAuth) ToTG() *tg.PortalAuth

ToTG returns the auth info converted to a TG API consumable

func (*PortalAuth) UpdateFromTG added in v1.4.0

func (p *PortalAuth) UpdateFromTG(r tg.PortalAuth)

UpdateFromTG updates the HCL struct with data from the TG API

type Service added in v1.6.0

type Service struct {
	NodeID      string `tf:"node_id"`
	ClusterFQDN string `tf:"cluster_fqdn"`
	Name        string `tf:"name"`
	Host        string `tf:"host"`
	Port        int    `tf:"port"`
	Protocol    string `tf:"protocol"`
	Description string `tf:"description"`
}

func (*Service) ToTG added in v1.6.0

func (s *Service) ToTG(id string) tg.Service

func (*Service) UpdateFromTG added in v1.6.0

func (s *Service) UpdateFromTG(svc tg.Service)

type Shadow added in v1.11.0

type Shadow struct {
	PackageVersion string            `tf:"package_version,omitempty"`
	ClusterMaster  bool              `tf:"cluster_master,omitempty"`
	Nics           []string          `tf:"nics,omitempty"`
	Reported       map[string]string `tf:"reported,omitempty"`
}

func (*Shadow) UpdateFromTG added in v1.11.0

func (s *Shadow) UpdateFromTG(shadow map[string]any)

type SubInterface added in v1.11.0

type SubInterface struct {
	VLANID        int         `tf:"vlan_id"`
	IP            string      `tf:"ip"`
	VRF           string      `tf:"vrf,omitempty"`
	AdditionalIPs []string    `tf:"additional_ips,omitempty"`
	Routes        []VLANRoute `tf:"route,omitempty"`
	Description   string      `tf:"description,omitempty"`
}

func (SubInterface) ToTG added in v1.11.0

func (si SubInterface) ToTG() tg.SubInterface

type Tagging added in v1.9.0

type Tagging struct {
	NodeID      string            `tf:"node_id"`
	ClusterFQDN string            `tf:"cluster_fqdn"`
	Tags        map[string]string `tf:"tags"`
}

type VLANRoute added in v1.11.0

type VLANRoute struct {
	Route       string `tf:"route"`
	Next        string `tf:"next,omitempty"`
	Description string `tf:"description,omitempty"`
}

func (VLANRoute) ToTG added in v1.11.0

func (v VLANRoute) ToTG() tg.VLANRoute

type VRF added in v1.0.0

type VRF struct {
	Name       string     `tf:"name"`
	Forwarding bool       `tf:"forwarding"`
	ACLs       []VRFACL   `tf:"acl,omitempty"`
	Routes     []VRFRoute `tf:"route,omitempty"`
	NATs       []VRFNAT   `tf:"nat,omitempty"`
	Rules      []VRFRule  `tf:"rule,omitempty"`
}

func (VRF) ToTG added in v1.11.0

func (v VRF) ToTG() tg.VRF

type VRFACL added in v1.0.0

type VRFACL struct {
	Action      string `tf:"action"`
	Description string `tf:"description"`
	Protocol    string `tf:"protocol"`
	Source      string `tf:"source"`
	Dest        string `tf:"dest"`
	Line        int    `tf:"line"`
}

func (VRFACL) ToTG added in v1.11.0

func (a VRFACL) ToTG() tg.VRFACL

type VRFNAT added in v1.0.0

type VRFNAT struct {
	Source     string `tf:"source,omitempty"`
	Dest       string `tf:"dest,omitempty"`
	Masquerade bool   `tf:"masquerade"`
	ToSource   string `tf:"to_source,omitempty"`
	ToDest     string `tf:"to_dest,omitempty"`
}

func (VRFNAT) ToTG added in v1.11.0

func (n VRFNAT) ToTG() tg.VRFNAT

type VRFRoute added in v1.0.0

type VRFRoute struct {
	Dest        string `tf:"dest"`
	Dev         string `tf:"dev"`
	Description string `tf:"description"`
	Metric      int    `tf:"metric"`
}

func (VRFRoute) ToTG added in v1.11.0

func (r VRFRoute) ToTG() tg.VRFRoute

type VRFRule added in v1.0.0

type VRFRule struct {
	Protocol    string `tf:"protocol"`
	Line        int    `tf:"line"`
	Action      string `tf:"action"`
	Description string `tf:"description,omitempty"`
	Source      string `tf:"source,omitempty"`
	VRF         string `tf:"vrf,omitempty"`
	Dest        string `tf:"dest,omitempty"`
}

func (VRFRule) ToTG added in v1.11.0

func (r VRFRule) ToTG() tg.VRFRule

Jump to

Keyboard shortcuts

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