Documentation
¶
Index ¶
- func DecodeResourceData[T any](d *schema.ResourceData) (T, error)
- func EncodeResourceData(in any, d *schema.ResourceData) error
- type AccessRule
- type AccessRuleItem
- type Alarm
- type AlarmChannel
- type App
- type AppACL
- type Cert
- type Cluster
- type Connector
- type Container
- type ContainerHealthCheck
- type ContainerImage
- type ContainerInterface
- type ContainerLimit
- type ContainerMount
- type ContainerPortMapping
- type ContainerULimit
- type ContainerVirtualNetwork
- type Device
- type GatewayClient
- type GatewayConfig
- type GatewayPath
- type GatewayRoute
- type Group
- type GroupMember
- type HCL
- type IDP
- type IDPOpenIDConfig
- type IDPSAMLConfig
- type KVMImage
- type KVMVolume
- type NetworkConfig
- type NetworkInterface
- type NetworkRoute
- type NetworkTunnel
- type Node
- type PortalAuth
- type Service
- type Shadow
- type SubInterface
- type Tagging
- type VLANRoute
- type VRF
- type VRFACL
- type VRFNAT
- type VRFRoute
- type VRFRule
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
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 (*App) UpdateFromTG ¶ added in v1.0.0
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 (*AppACL) UpdateFromTG ¶ added in v1.0.0
type Cert ¶ added in v1.12.0
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) UpdateFromTG ¶ added in v1.6.0
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) UpdateFromTG ¶ added in v1.12.0
type ContainerHealthCheck ¶ added in v1.12.0
type ContainerImage ¶ added in v1.12.0
type ContainerInterface ¶ added in v1.12.0
type ContainerLimit ¶ added in v1.12.0
type ContainerMount ¶ added in v1.12.0
type ContainerPortMapping ¶ added in v1.12.0
type ContainerULimit ¶ added in v1.12.0
type ContainerVirtualNetwork ¶ added in v1.12.0
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
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 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 GatewayRoute ¶ added in v1.12.0
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
ResourceURL returns the URL for a specific group on the TG API side
func (*Group) ToTG ¶ added in v1.3.7
ToTG returns the TG API representation of a group from the HCL representation
func (*Group) UpdateFromTG ¶ added in v1.3.7
UpdateFromTG updates the HCL representation of a group from the TG API representation
type GroupMember ¶ added in v1.3.7
GroupMember holds the HCL representation of a group member
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
ResourceURL sends back the IDP's specific URL for the TG API
func (*IDP) UpdateFromTG ¶ added in v1.0.0
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 (*KVMImage) UpdateFromTG ¶ added in v1.0.0
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 (*KVMVolume) UpdateFromTG ¶ added in v1.0.0
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
func (ni NetworkInterface) ToTG() tg.NetworkInterface
type NetworkRoute ¶ added in v1.7.0
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 PortalAuth ¶ added in v1.4.0
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) UpdateFromTG ¶ added in v1.6.0
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
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