Documentation ¶
Index ¶
- Constants
- Variables
- func BoolFromMikrotikJSON(s string) bool
- func BoolFromMikrotikJSONStr(s string) string
- func BoolToMikrotikJSON(b bool) string
- func BoolToMikrotikJSONStr(s string) string
- func ColorizedDebug(ctx context.Context, msg string, args ...map[string]interface{})
- func ColorizedMessage(ctx context.Context, level logLevel, msg string, ...)
- func DatasourceFiles() *schema.Resource
- func DatasourceIPAddresses() *schema.Resource
- func DatasourceIPFirewall() *schema.Resource
- func DatasourceIPRoutes() *schema.Resource
- func DatasourceIPServices() *schema.Resource
- func DatasourceIPv6Addresses() *schema.Resource
- func DatasourceIPv6Firewall() *schema.Resource
- func DatasourceInterfaceBridgeFilter() *schema.Resource
- func DatasourceInterfaces() *schema.Resource
- func DatasourceIpArp() *schema.Resource
- func DatasourceIpDhcpServerLeases() *schema.Resource
- func DatasourceSystemResource() *schema.Resource
- func DatasourceSystemRouterboard() *schema.Resource
- func DatasourceWiFiEasyConnect() *schema.Resource
- func DatasourceX509() *schema.Resource
- func DefaultCreate(s map[string]*schema.Schema) schema.CreateContextFunc
- func DefaultCreateUpdate(s map[string]*schema.Schema) func(context.Context, *schema.ResourceData, interface{}) diag.Diagnostics
- func DefaultCreateWithTimeout(s map[string]*schema.Schema, t time.Duration) schema.CreateContextFunc
- func DefaultDelete(s map[string]*schema.Schema) schema.DeleteContextFunc
- func DefaultRead(s map[string]*schema.Schema) schema.ReadContextFunc
- func DefaultSystemCreate(s map[string]*schema.Schema) schema.CreateContextFunc
- func DefaultSystemDatasourceRead(s map[string]*schema.Schema) schema.ReadContextFunc
- func DefaultSystemDelete(s map[string]*schema.Schema) schema.DeleteContextFunc
- func DefaultSystemRead(s map[string]*schema.Schema) schema.ReadContextFunc
- func DefaultSystemUpdate(s map[string]*schema.Schema) schema.UpdateContextFunc
- func DefaultUpdate(s map[string]*schema.Schema) schema.UpdateContextFunc
- func DefaultValidateCreate(s map[string]*schema.Schema, f DataValidateFunc) schema.CreateContextFunc
- func DefaultValidateUpdate(s map[string]*schema.Schema, f DataValidateFunc) schema.UpdateContextFunc
- func DeleteItem(id *ItemId, resourcePath string, c Client) error
- func EscapeChars(data []byte) []byte
- func ImportStateCustomContext(s map[string]*schema.Schema) schema.StateContextFunc
- func IpRangeToCIDR(ip1, ip2 string) (string, error)
- func KebabToSnake(name string) string
- func ListToString(v any) (res string)
- func MikrotikResourceDataToTerraform(item MikrotikItem, s map[string]*schema.Schema, d *schema.ResourceData) diag.Diagnostics
- func MikrotikResourceDataToTerraformDatasource(items *[]MikrotikItem, resourceDataKeyName string, s map[string]*schema.Schema, ...) diag.Diagnostics
- func NewClient(ctx context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics)
- func NewProvider() *schema.Provider
- func ParseDuration(s string) (time.Duration, error)
- func PrefixedUniqueId(prefix string) string
- func PropDefaultNameRo(description string) *schema.Schema
- func PropDropByValue(s ...string) *schema.Schema
- func PropEnabled(description string) *schema.Schema
- func PropId(t IdType) *schema.Schema
- func PropMacAddressRw(description string, required bool) *schema.Schema
- func PropMtuRw() *schema.Schema
- func PropName(description string) *schema.Schema
- func PropNameOptional(description string) *schema.Schema
- func PropResourcePath(p string) *schema.Schema
- func PropSetUnsetFields(s ...string) *schema.Schema
- func PropSkipFields(s ...string) *schema.Schema
- func PropTransformSet(s ...string) *schema.Schema
- func Provider() *schema.Provider
- func ReadItems(id *ItemId, resourcePath string, c Client) (*[]MikrotikItem, error)
- func ReadItemsFiltered(filter []string, resourcePath string, c Client) (*[]MikrotikItem, error)
- func ResourceCapsManAaa() *schema.Resource
- func ResourceCapsManAccessList() *schema.Resource
- func ResourceCapsManChannel() *schema.Resource
- func ResourceCapsManChannelV0() *schema.Resource
- func ResourceCapsManChannelV1() *schema.Resource
- func ResourceCapsManConfiguration() *schema.Resource
- func ResourceCapsManConfigurationV0() *schema.Resource
- func ResourceCapsManDatapath() *schema.Resource
- func ResourceCapsManDatapathV0() *schema.Resource
- func ResourceCapsManInterface() *schema.Resource
- func ResourceCapsManManager() *schema.Resource
- func ResourceCapsManManagerInterface() *schema.Resource
- func ResourceCapsManProvisioning() *schema.Resource
- func ResourceCapsManProvisioningV0() *schema.Resource
- func ResourceCapsManRates() *schema.Resource
- func ResourceCapsManRatesV0() *schema.Resource
- func ResourceCapsManSecurity() *schema.Resource
- func ResourceCapsManSecurityV0() *schema.Resource
- func ResourceCertificateScepServer() *schema.Resource
- func ResourceContainer() *schema.Resource
- func ResourceContainerConfig() *schema.Resource
- func ResourceContainerEnvs() *schema.Resource
- func ResourceContainerMounts() *schema.Resource
- func ResourceCreate(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, ...) diag.Diagnostics
- func ResourceCreateAndWait(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, ...) diag.Diagnostics
- func ResourceDelete(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, ...) diag.Diagnostics
- func ResourceDhcpClient() *schema.Resource
- func ResourceDhcpClientOption() *schema.Resource
- func ResourceDhcpRelay() *schema.Resource
- func ResourceDhcpServer() *schema.Resource
- func ResourceDhcpServerConfig() *schema.Resource
- func ResourceDhcpServerLease() *schema.Resource
- func ResourceDhcpServerNetwork() *schema.Resource
- func ResourceDhcpServerNetworkV0() *schema.Resource
- func ResourceDhcpServerOption() *schema.Resource
- func ResourceDhcpServerOptionSet() *schema.Resource
- func ResourceDhcpServerV0() *schema.Resource
- func ResourceDns() *schema.Resource
- func ResourceDnsAdlist() *schema.Resource
- func ResourceDnsRecord() *schema.Resource
- func ResourceDnsV0() *schema.Resource
- func ResourceFile() *schema.Resource
- func ResourceIPAddress() *schema.Resource
- func ResourceIPConnectionTracking() *schema.Resource
- func ResourceIPFirewallAddrList() *schema.Resource
- func ResourceIPFirewallFilter() *schema.Resource
- func ResourceIPFirewallMangle() *schema.Resource
- func ResourceIPFirewallNat() *schema.Resource
- func ResourceIPFirewallRaw() *schema.Resource
- func ResourceIPPool() *schema.Resource
- func ResourceIPPoolV0() *schema.Resource
- func ResourceIPRoute() *schema.Resource
- func ResourceIPVrf() *schema.Resource
- func ResourceIPv6Address() *schema.Resource
- func ResourceIPv6DhcpClient() *schema.Resource
- func ResourceIPv6DhcpClientOption() *schema.Resource
- func ResourceIPv6FirewallAddrList() *schema.Resource
- func ResourceIPv6FirewallFilter() *schema.Resource
- func ResourceIPv6FirewallMangle() *schema.Resource
- func ResourceIPv6FirewallNat() *schema.Resource
- func ResourceIPv6NeighborDiscovery() *schema.Resource
- func ResourceIPv6Route() *schema.Resource
- func ResourceInterface6to4() *schema.Resource
- func ResourceInterfaceBonding() *schema.Resource
- func ResourceInterfaceBridge() *schema.Resource
- func ResourceInterfaceBridgeFilter() *schema.Resource
- func ResourceInterfaceBridgeMlag() *schema.Resource
- func ResourceInterfaceBridgePort() *schema.Resource
- func ResourceInterfaceBridgeSettings() *schema.Resource
- func ResourceInterfaceBridgeV0() *schema.Resource
- func ResourceInterfaceBridgeVlan() *schema.Resource
- func ResourceInterfaceBridgeVlanV0() *schema.Resource
- func ResourceInterfaceDot1xClient() *schema.Resource
- func ResourceInterfaceDot1xClientV0() *schema.Resource
- func ResourceInterfaceDot1xServer() *schema.Resource
- func ResourceInterfaceDot1xServerV0() *schema.Resource
- func ResourceInterfaceEoip() *schema.Resource
- func ResourceInterfaceEoipV0() *schema.Resource
- func ResourceInterfaceEthernet() *schema.Resource
- func ResourceInterfaceEthernetSwitch() *schema.Resource
- func ResourceInterfaceEthernetSwitchHost() *schema.Resource
- func ResourceInterfaceEthernetSwitchPort() *schema.Resource
- func ResourceInterfaceEthernetSwitchPortIsolation() *schema.Resource
- func ResourceInterfaceEthernetSwitchRule() *schema.Resource
- func ResourceInterfaceEthernetSwitchVlan() *schema.Resource
- func ResourceInterfaceGre() *schema.Resource
- func ResourceInterfaceGreV0() *schema.Resource
- func ResourceInterfaceIPIP() *schema.Resource
- func ResourceInterfaceL2tpClient() *schema.Resource
- func ResourceInterfaceList() *schema.Resource
- func ResourceInterfaceListMember() *schema.Resource
- func ResourceInterfaceListV0() *schema.Resource
- func ResourceInterfaceLte() *schema.Resource
- func ResourceInterfaceLteApn() *schema.Resource
- func ResourceInterfaceMacVlan() *schema.Resource
- func ResourceInterfaceOpenVPNServer() *schema.Resource
- func ResourceInterfacePPPoEClient() *schema.Resource
- func ResourceInterfacePppoeServer() *schema.Resource
- func ResourceInterfaceVeth() *schema.Resource
- func ResourceInterfaceVlan() *schema.Resource
- func ResourceInterfaceVlanV0() *schema.Resource
- func ResourceInterfaceVrrp() *schema.Resource
- func ResourceInterfaceVrrpV0() *schema.Resource
- func ResourceInterfaceVxlan() *schema.Resource
- func ResourceInterfaceVxlanVteps() *schema.Resource
- func ResourceInterfaceW60g() *schema.Resource
- func ResourceInterfaceW60gStation() *schema.Resource
- func ResourceInterfaceWireguard() *schema.Resource
- func ResourceInterfaceWireguardPeer() *schema.Resource
- func ResourceInterfaceWireguardV0() *schema.Resource
- func ResourceInterfaceWireless() *schema.Resource
- func ResourceInterfaceWirelessAccessList() *schema.Resource
- func ResourceInterfaceWirelessCap() *schema.Resource
- func ResourceInterfaceWirelessConnectList() *schema.Resource
- func ResourceInterfaceWirelessSecurityProfiles() *schema.Resource
- func ResourceIpCloud() *schema.Resource
- func ResourceIpCloudAdvanced() *schema.Resource
- func ResourceIpHotspot() *schema.Resource
- func ResourceIpHotspotIpBinding() *schema.Resource
- func ResourceIpHotspotProfile() *schema.Resource
- func ResourceIpHotspotServicePort() *schema.Resource
- func ResourceIpHotspotUser() *schema.Resource
- func ResourceIpHotspotUserProfile() *schema.Resource
- func ResourceIpHotspotWalledGarden() *schema.Resource
- func ResourceIpHotspotWalledGardenIp() *schema.Resource
- func ResourceIpIpsecIdentity() *schema.Resource
- func ResourceIpIpsecKey() *schema.Resource
- func ResourceIpIpsecModeConfig() *schema.Resource
- func ResourceIpIpsecPeer() *schema.Resource
- func ResourceIpIpsecPolicy() *schema.Resource
- func ResourceIpIpsecPolicyGroup() *schema.Resource
- func ResourceIpIpsecProfile() *schema.Resource
- func ResourceIpIpsecProposal() *schema.Resource
- func ResourceIpIpsecSettings() *schema.Resource
- func ResourceIpNeighborDiscoverySettings() *schema.Resource
- func ResourceIpSSHServer() *schema.Resource
- func ResourceIpService() *schema.Resource
- func ResourceIpv6DhcpServer() *schema.Resource
- func ResourceIpv6DhcpServerOption() *schema.Resource
- func ResourceIpv6DhcpServerOptionSets() *schema.Resource
- func ResourceIpv6Pool() *schema.Resource
- func ResourceIpv6Settings() *schema.Resource
- func ResourceMoveItems() *schema.Resource
- func ResourceOpenVPNClient() *schema.Resource
- func ResourceOpenVPNServer() *schema.Resource
- func ResourceOpenVPNServerV0() *schema.Resource
- func ResourcePPPProfile() *schema.Resource
- func ResourcePPPSecret() *schema.Resource
- func ResourcePppAaa() *schema.Resource
- func ResourceRadius() *schema.Resource
- func ResourceRadiusIncoming() *schema.Resource
- func ResourceRadiusV0() *schema.Resource
- func ResourceRead(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, ...) diag.Diagnostics
- func ResourceRoutingBGPConnection() *schema.Resource
- func ResourceRoutingBGPTemplate() *schema.Resource
- func ResourceRoutingFilterRule() *schema.Resource
- func ResourceRoutingOspfArea() *schema.Resource
- func ResourceRoutingOspfInstance() *schema.Resource
- func ResourceRoutingOspfInterfaceTemplate() *schema.Resource
- func ResourceRoutingOspfInterfaceTemplateV0() *schema.Resource
- func ResourceRoutingRule() *schema.Resource
- func ResourceRoutingTable() *schema.Resource
- func ResourceSNMP() *schema.Resource
- func ResourceSNMPCommunity() *schema.Resource
- func ResourceSNMPCommunityV0() *schema.Resource
- func ResourceSystemCertificate() *schema.Resource
- func ResourceSystemClock() *schema.Resource
- func ResourceSystemIdentity() *schema.Resource
- func ResourceSystemLed() *schema.Resource
- func ResourceSystemLedSettings() *schema.Resource
- func ResourceSystemLogging() *schema.Resource
- func ResourceSystemLoggingAction() *schema.Resource
- func ResourceSystemNtpClient() *schema.Resource
- func ResourceSystemNtpServer() *schema.Resource
- func ResourceSystemRouterboardButtonMode() *schema.Resource
- func ResourceSystemRouterboardButtonReset() *schema.Resource
- func ResourceSystemRouterboardButtonWps() *schema.Resource
- func ResourceSystemRouterboardSettings() *schema.Resource
- func ResourceSystemRouterboardUsb() *schema.Resource
- func ResourceSystemScheduler() *schema.Resource
- func ResourceSystemSchedulerV0() *schema.Resource
- func ResourceSystemScript() *schema.Resource
- func ResourceSystemUserSettings() *schema.Resource
- func ResourceToolBandwidthServer() *schema.Resource
- func ResourceToolEmail() *schema.Resource
- func ResourceToolMacServer() *schema.Resource
- func ResourceToolMacServerWinBox() *schema.Resource
- func ResourceToolNetwatch() *schema.Resource
- func ResourceToolSniffer() *schema.Resource
- func ResourceUPNPInterfaces() *schema.Resource
- func ResourceUPNPSettings() *schema.Resource
- func ResourceUpdate(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, ...) diag.Diagnostics
- func ResourceUser() *schema.Resource
- func ResourceUserAaa() *schema.Resource
- func ResourceUserGroup() *schema.Resource
- func ResourceUserManagerAdvanced() *schema.Resource
- func ResourceUserManagerAttribute() *schema.Resource
- func ResourceUserManagerDatabase() *schema.Resource
- func ResourceUserManagerLimitation() *schema.Resource
- func ResourceUserManagerProfile() *schema.Resource
- func ResourceUserManagerProfileLimitation() *schema.Resource
- func ResourceUserManagerRouter() *schema.Resource
- func ResourceUserManagerSettings() *schema.Resource
- func ResourceUserManagerUser() *schema.Resource
- func ResourceUserManagerUserGroup() *schema.Resource
- func ResourceUserManagerUserProfile() *schema.Resource
- func ResourceWifi() *schema.Resource
- func ResourceWifiAaa() *schema.Resource
- func ResourceWifiAccessList() *schema.Resource
- func ResourceWifiCap() *schema.Resource
- func ResourceWifiCapsman() *schema.Resource
- func ResourceWifiChannel() *schema.Resource
- func ResourceWifiConfiguration() *schema.Resource
- func ResourceWifiDatapath() *schema.Resource
- func ResourceWifiInterworking() *schema.Resource
- func ResourceWifiProvisioning() *schema.Resource
- func ResourceWifiSecurity() *schema.Resource
- func ResourceWifiSecurityMultiPassphrase() *schema.Resource
- func ResourceWifiSteering() *schema.Resource
- func ResourceWireguardKeys() *schema.Resource
- func ResourceZerotier() *schema.Resource
- func ResourceZerotierController() *schema.Resource
- func ResourceZerotierInterface() *schema.Resource
- func SnakeToKebab(name string) string
- func SystemResourceCreateUpdate(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, ...) diag.Diagnostics
- func SystemResourceDelete(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, ...) diag.Diagnostics
- func SystemResourceRead(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, ...) diag.Diagnostics
- func TerraformResourceDataToMikrotik(s map[string]*schema.Schema, d *schema.ResourceData) (MikrotikItem, *MikrotikItemMetadata)
- func UniqueId() string
- type ApiClient
- type Client
- type DataValidateFunc
- type ExtraParams
- type IdType
- type ItemId
- type Key
- type MikrotikItem
- type MikrotikItemMetadata
- type RestClient
- type TransportType
- type URL
Constants ¶
const ( TRACE logLevel = 1 + iota DEBUG INFO WARN ERROR )
const ( MetaId = "___id___" MetaResourcePath = "___path___" MetaTransformSet = "___ts___" MetaSkipFields = "___skip___" MetaSetUnsetFields = "___unset___" MetaDropByValue = "___drop_val___" )
All metadata fields must be present in each resource schema, and the field type must be string.
const ( KeyActualMtu = "actual_mtu" KeyAllowFastPath = "allow_fast_path" KeyArp = "arp" KeyArpTimeout = "arp_timeout" KeyClampTcpMss = "clamp_tcp_mss" KeyComment = "comment" KeyDefault = "default" KeyDynamic = "dynamic" KeyDefaultName = "default_name" KeyDisabled = "disabled" KeyDontFragment = "dont_fragment" KeyDscp = "dscp" KeyEnabled = "enabled" KeyFilter = "filter" KeyInactive = "inactive" KeyInterface = "interface" KeyInvalid = "invalid" KeyIpsecSecret = "ipsec_secret" KeyKeepalive = "keepalive" KeyL2Mtu = "l2mtu" KeyLocalAddress = "local_address" KeyLoopProtect = "loop_protect" KeyLoopProtectDisableTime = "loop_protect_disable_time" KeyLoopProtectSendInterval = "loop_protect_send_interval" KeyLoopProtectStatus = "loop_protect_status" KeyMacAddress = "mac_address" KeyMtu = "mtu" KeyName = "name" KeyPlaceBefore = "place_before" KeyRemoteAddress = "remote_address" KeyRunning = "running" KeyVrf = "vrf" )
const KeyLen = 32 // wgh.KeyLen
https://github.com/WireGuard/wgctrl-go/blob/master/wgtypes/types.go KeyLen is the expected key length for a WireGuard key.
const UniqueIdPrefix = `terraform-`
Copied from terraform-plugin-testing@v1.2.0/helper/resource/id.go Because this functionality is marked deprecated.
Variables ¶
var ( ErrorMsgPut = "An error was encountered while sending a PUT request to the API: %v" ErrorMsgGet = "An error was encountered while sending a GET request to the API: %v" ErrorMsgPatch = "An error was encountered while sending a PATCH request to the API: %v" ErrorMsgDelete = "An error was encountered while sending a DELETE request to the API: %v" )
var ( PropActualMtuRo = &schema.Schema{ Type: schema.TypeInt, Computed: true, } PropAllowFastPathRw = &schema.Schema{ Type: schema.TypeBool, Optional: true, Description: "Whether to allow FastPath processing. Must be disabled if IPsec tunneling is used.", DiffSuppressFunc: AlwaysPresentNotUserProvided, } PropArpRw = &schema.Schema{ Type: schema.TypeString, Optional: true, Description: "Address Resolution Protocol mode:\n * disabled - the interface will not use ARP\n * enabled - " + "the interface will use ARP\n * local-proxy-arp - the router performs proxy ARP on the interface and sends " + "replies to the same interface\n * proxy-arp - the router performs proxy ARP on the interface and sends " + "replies to other interfaces\n * reply-only - the interface will only reply to requests originated from " + "matching IP address/MAC address combinations which are entered as static entries in the ARP table. No " + "dynamic entries will be automatically stored in the ARP table. Therefore for communications to be " + "successful, a valid static entry must already exist.", ValidateFunc: validation.StringInSlice([]string{"disabled", "enabled", "local-proxy-arp", "proxy-arp", "reply-only"}, false), DiffSuppressFunc: AlwaysPresentNotUserProvided, } PropArpTimeoutRw = &schema.Schema{ Type: schema.TypeString, Optional: true, Description: "ARP timeout is time how long ARP record is kept in ARP table after no packets are received " + "from IP. Value auto equals to the value of arp-timeout in IP/Settings, default is 30s. Can use postfix " + "`ms`, `s`, `M`, `h`, `d` for milliseconds, seconds, minutes, hours or days. If no postfix is set then seconds (s) is used.", ValidateFunc: validation.StringMatch(regexp.MustCompile(`^$|auto$|(\d+(ms|s|M|h|d)?)+$`), "expected arp_timout value to be 'auto' string or time value"), DiffSuppressFunc: AlwaysPresentNotUserProvided, } PropClampTcpMssRw = &schema.Schema{ Type: schema.TypeBool, Optional: true, Description: "Controls whether to change MSS size for received TCP SYN packets. When enabled, a " + "router will change the MSS size for received TCP SYN packets if the current MSS size exceeds the " + "tunnel interface MTU (taking into account the TCP/IP overhead). The received encapsulated packet " + "will still contain the original MSS, and only after decapsulation the MSS is changed.", DiffSuppressFunc: AlwaysPresentNotUserProvided, } PropCommentRw = &schema.Schema{ Type: schema.TypeString, Optional: true, } PropDisabledRw = &schema.Schema{ Type: schema.TypeBool, Optional: true, DiffSuppressFunc: AlwaysPresentNotUserProvided, } PropDefaultRo = &schema.Schema{ Type: schema.TypeBool, Computed: true, Description: "It's the default item.", } PropDontFragmentRw = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateFunc: validation.StringInSlice([]string{"inherit", "no"}, false), DiffSuppressFunc: AlwaysPresentNotUserProvided, } PropDscpRw = &schema.Schema{ Type: schema.TypeString, Optional: true, Default: "inherit", ValidateDiagFunc: func(v interface{}, p cty.Path) (diags diag.Diagnostics) { value := v.(string) if value == "" || value == "inherit" { return } i, err := strconv.Atoi(value) if err != nil { diags = diag.Errorf( "expected dscp value (%s) to be empty string or 'inherit' or integer 0..63", value) return } if i < 0 || i > 63 { diags = diag.Errorf( "expected %s to be in the range 0 - 63, got %d", value, i) return } return }, Description: "Set dscp value in GRE header to a fixed value '0..63' or 'inherit' from dscp value taken " + "from tunnelled traffic.", } PropDynamicRo = &schema.Schema{ Type: schema.TypeBool, Computed: true, Description: "Configuration item created by software, not by management interface. It is not exported, " + "and cannot be directly modified.", } PropFilterRw = &schema.Schema{ Type: schema.TypeMap, Optional: true, Elem: schema.TypeString, Description: "Additional request filtering options.", ValidateDiagFunc: ValidationMapKeyNames, } PropInactiveRo = &schema.Schema{ Type: schema.TypeBool, Computed: true, } PropInterfaceRw = &schema.Schema{ Type: schema.TypeString, Required: true, Description: "Name of the interface.", } PropInvalidRo = &schema.Schema{ Type: schema.TypeBool, Computed: true, } PropIpsecSecretRw = &schema.Schema{ Type: schema.TypeString, Optional: true, Sensitive: true, Description: "When secret is specified, router adds dynamic IPsec peer to remote-address with " + "pre-shared key and policy (by default phase2 uses sha1/aes128cbc).", DiffSuppressFunc: AlwaysPresentNotUserProvided, } PropKeepaliveRw = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateFunc: validation.StringMatch(regexp.MustCompile(`^(\d+[smhdw]?)+(,\d+)?$`), "value must be integer[/time],integer 0..4294967295 (https://help.mikrotik.com/docs/display/ROS/GRE)"), Description: "Tunnel keepalive parameter sets the time interval in which the tunnel running flag will " + "remain even if the remote end of tunnel goes down. If configured time,retries fail, interface " + "running flag is removed. Parameters are written in following format: " + "`KeepaliveInterval,KeepaliveRetries` where `KeepaliveInterval` is time interval and " + "`KeepaliveRetries` - number of retry attempts. `KeepaliveInterval` is integer 0..4294967295", DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { if old == new { return true } if AlwaysPresentNotUserProvided(k, old, new, d) { return true } if old == "" || new == "" { return false } o := strings.Split(old, ",") n := strings.Split(new, ",") if len(o) != 2 || len(n) != 2 { panic(fmt.Sprintf("[Keepalive] wrong keepalive format, old: '%v', new: '%v'", old, new)) } if o[1] != n[1] { return false } oDuration, err := ParseDuration(o[0]) if err != nil { panic("[Keepalive] parse 'old' duration error: " + err.Error()) } nDuration, err := ParseDuration(n[0]) if err != nil { panic("[Keepalive] parse 'new' duration error: " + err.Error()) } return oDuration.Seconds() == nDuration.Seconds() }, } PropL2MtuRo = &schema.Schema{ Type: schema.TypeInt, Computed: true, Description: "Layer2 Maximum transmission unit. " + "[See](https://wiki.mikrotik.com/wiki/Maximum_Transmission_Unit_on_RouterBoards).", } PropL2MtuRw = &schema.Schema{ Type: schema.TypeInt, Optional: true, Description: "Layer2 Maximum transmission unit. " + "[See](https://wiki.mikrotik.com/wiki/Maximum_Transmission_Unit_on_RouterBoards).", ValidateFunc: validation.IntBetween(1, 65535), DiffSuppressFunc: AlwaysPresentNotUserProvided, } PropLocalAddressRw = &schema.Schema{ Type: schema.TypeString, Optional: true, Description: "Source address of the tunnel packets, local on the router.", ValidateFunc: validation.IsIPv4Address, DiffSuppressFunc: AlwaysPresentNotUserProvided, } PropLoopProtectRw = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateFunc: validation.StringInSlice([]string{"default", "on", "off"}, false), DiffSuppressFunc: AlwaysPresentNotUserProvided, } PropLoopProtectDisableTimeRw = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateFunc: ValidationTime, DiffSuppressFunc: TimeEquall, } PropLoopProtectSendIntervalRw = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateFunc: ValidationTime, DiffSuppressFunc: TimeEquall, } PropLoopProtectStatusRo = &schema.Schema{ Type: schema.TypeString, Computed: true, } PropMacAddressRo = &schema.Schema{ Type: schema.TypeString, Computed: true, Description: "Current mac address.", } // TODO: Replace in all possible resources with a property without 'ForceNew'. // https://github.com/orgs/terraform-routeros/discussions/192#discussioncomment-5929999 PropNameForceNewRw = &schema.Schema{ Type: schema.TypeString, Required: true, ForceNew: true, Description: `Changing the name of this resource will force it to be recreated. > The links of other configuration properties to this resource may be lost! > Changing the name of the resource outside of a Terraform will result in a loss of control integrity for that resource! `, } PropPlaceBefore = &schema.Schema{ Type: schema.TypeString, Optional: true, ForceNew: true, Description: `Before which position the rule will be inserted. > Please check the effect of this option, as it does not work as you think! > Best way to use in conjunction with a data source. See [example](../data-sources/ip_firewall.md#example-usage). `, } PropRemoteAddressRw = &schema.Schema{ Type: schema.TypeString, Optional: true, Description: "IP address of the remote end of the tunnel.", ValidateFunc: validation.IsIPv4Address, DiffSuppressFunc: AlwaysPresentNotUserProvided, } PropRunningRo = &schema.Schema{ Type: schema.TypeBool, Computed: true, } PropVrfRw = &schema.Schema{ Type: schema.TypeString, Optional: true, Description: "The VRF table this resource operates on.", DiffSuppressFunc: AlwaysPresentNotUserProvided, } )
Schema properties.
var ( Validation64k = validation.IntBetween(0, 65535) ValidationTime = validation.StringMatch(regexp.MustCompile(`^(\d+([smhdw]|ms)?)+$`), "value should be an integer or a time interval: 0..4294967295 (seconds) or 500ms, 2d, 1w") // ValidationDurationAtLeast returns a SchemaValidateDiagFunc which tests if the provided value // is a valid duration expected by RouterOS and is at least minDuration long (inclusive) ValidationDurationAtLeast = func(minDuration time.Duration) schema.SchemaValidateDiagFunc { return func(i interface{}, p cty.Path) diag.Diagnostics { value, ok := i.(string) if !ok { return diag.Errorf("expected type to be string") } duration, err := ParseDuration(value) if err != nil { return diag.FromErr(err) } if duration < minDuration { return diag.Errorf("duration must be greater than %v", minDuration) } return diag.Diagnostics{} } } ValidationAutoYesNo = validation.StringInSlice([]string{"auto", "yes", "no"}, false) ValidationIpAddress = validation.StringMatch( regexp.MustCompile(`^$|^!?(\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(/([0-9]|[0-9]|[1-2][0-9]|3[0-2]))?)$`), "Allowed addresses should be a CIDR IP address or an empty string", ) ValidationMacAddress = validation.StringMatch( regexp.MustCompile(`^!?\b(?:[0-9A-F]{2}\:){5}(?:[0-9A-F]{2})$`), "Allowed MAC addresses should be [!]AA:BB:CC:DD:EE:FF", ) ValidationMacAddressWithMask = validation.StringMatch( regexp.MustCompile(`^!?\b(?:[0-9A-F]{2}\:){5}(?:[0-9A-F]{2})\/\b(?:[0-9A-F]{2}\:){5}(?:[0-9A-F]{2})$`), "Allowed MAC addresses should be [!]AA:BB:CC:DD:EE:FF/FF:FF:FF:FF:FF:FF", ) // ValidationMultiValInSlice returns a SchemaValidateDiagFunc which works like the StringInSlice function, // but the provided value can be a single value or a comma-separated list of values. // The negative indication of the parameter is also supported by adding "!" before value if mikrotikNegative is true. ValidationMultiValInSlice = func(valid []string, ignoreCase, mikrotikNegative bool) schema.SchemaValidateDiagFunc { return func(i interface{}, path cty.Path) (diags diag.Diagnostics) { v, ok := i.(string) if !ok { diags = append(diags, diag.Diagnostic{ Severity: diag.Error, Summary: "Bad value type", Detail: fmt.Sprintf("Value should be a string: %v (type = %T)", v, v), }) return } var negative []string if mikrotikNegative { for _, str := range valid { negative = append(negative, "!"+str) } } for _, sValue := range strings.Split(v, ",") { ok := false sValue = strings.TrimSpace(sValue) for _, sValid := range append(negative, valid...) { if sValue == sValid || (ignoreCase && strings.EqualFold(sValue, sValid)) { ok = true break } } if !ok { diags = append(diags, diag.Diagnostic{ Severity: diag.Error, Summary: "Bad value", Detail: fmt.Sprintf("Unexpected value: %v", sValue), }) } } return } } ValidationValInSlice = func(valid []string, ignoreCase, mikrotikNegative bool) schema.SchemaValidateDiagFunc { return func(i interface{}, path cty.Path) (diags diag.Diagnostics) { v, ok := i.(string) if !ok { diags = append(diags, diag.Diagnostic{ Severity: diag.Error, Summary: "Bad value type", Detail: fmt.Sprintf("Value should be a string: %v (type = %T)", v, v), }) return } var negative []string if mikrotikNegative { for _, str := range valid { negative = append(negative, "!"+str) } } v = strings.TrimSpace(v) for _, str := range append(negative, valid...) { if v == str || (ignoreCase && strings.EqualFold(v, str)) { return } } diags = append(diags, diag.Diagnostic{ Severity: diag.Error, Summary: "Bad value", Detail: fmt.Sprintf("Unexpected value: %v", v), }) return } } // ValidationMapKeyNames, A function to check map names for compliance with the TF standard. // When copying keys from a real configuration it is easy to make a mistake and transfer a key // containing dashes instead of underscores. This validator is added to prevent such errors. ValidationMapKeyNames = func(v interface{}, path cty.Path) diag.Diagnostics { var diags diag.Diagnostics for key := range v.(map[string]interface{}) { if reTerraformField.MatchString(key) { continue } diags = append(diags, diag.Diagnostic{ Severity: diag.Error, Summary: "Invalid attribute name", Detail: fmt.Sprintf("%s: Attribute name may only contain lowercase alphanumeric characters & "+ "underscores.", key), AttributePath: append(path, cty.IndexStep{Key: cty.StringVal(key)}), }) } return diags } )
Properties validation.
var ( TimeEquall = func(k, old, new string, d *schema.ResourceData) bool { if old == "" { return false } if AlwaysPresentNotUserProvided(k, old, new, d) { return true } if old == "immediately" || new == "immediately" { return old == new } oDuration, err := ParseDuration(old) if err != nil { panic("[TimeEquall] parse 'old' duration error: " + err.Error()) } nDuration, err := ParseDuration(new) if err != nil { panic("[TimeEquall] parse 'new' duration error: " + err.Error()) } return oDuration.Seconds() == nDuration.Seconds() } HexEqual = func(k, old, new string, d *schema.ResourceData) bool { if old == "" { return false } if AlwaysPresentNotUserProvided(k, old, new, d) { return true } // Compare numbers: var iOld, iNew int64 var err error iOld, err = strconv.ParseInt(old, 0, 64) if err != nil { panic("[HexEqual] 'old' number parse error: " + err.Error()) } iNew, err = strconv.ParseInt(new, 0, 64) if err != nil { panic("[HexEqual] 'new' number parse error: " + err.Error()) } return iOld == iNew } // AlwaysPresentNotUserProvided is a SupressDiff function that prevents values not provided by users to get updated. // This is necessary in some system-wide fields that are present regardless if the users provides any values. // Prevents the need of hardcode values for default values, as those are harder to track over time/versions of // routeros AlwaysPresentNotUserProvided = func(k, old, new string, d *schema.ResourceData) bool { value := d.GetRawConfig() loop: for _, key := range strings.Split(k, ".") { if key == "#" || key == "%" { break } switch { case value.Type().IsObjectType(): value = value.GetAttr(key) case value.Type().IsMapType(): value = value.Index(cty.StringVal(key)) default: break loop } if value.IsNull() { return true } } return false } MacAddressEqual = func(k, old, new string, d *schema.ResourceData) bool { return strings.EqualFold(old, new) } )
Properties DiffSuppressFunc.
var DeleteSystemObject = []diag.Diagnostic{{ Severity: diag.Warning, Summary: "Delete operation on a system object.", Detail: "This resource contains system settings and cannot be deleted or reset. " + "This action will remove the object from the Terraform state. " + "See also: 'terraform state rm' https://developer.hashicorp.com/terraform/cli/commands/state/rm", }}
Diagnostics
Functions ¶
func BoolFromMikrotikJSON ¶
func BoolFromMikrotikJSONStr ¶ added in v1.7.0
func BoolToMikrotikJSON ¶
func BoolToMikrotikJSONStr ¶ added in v1.7.0
func ColorizedDebug ¶
ColorizedDebug Used to display provider log color messages. Please set the environment variable
func ColorizedMessage ¶ added in v1.21.0
func DatasourceFiles ¶ added in v1.45.0
func DatasourceIPAddresses ¶
func DatasourceIPFirewall ¶ added in v1.54.3
func DatasourceIPRoutes ¶
func DatasourceIPServices ¶ added in v1.39.0
func DatasourceIPv6Firewall ¶ added in v1.54.3
func DatasourceInterfaceBridgeFilter ¶ added in v1.71.0
func DatasourceInterfaces ¶
func DatasourceIpArp ¶ added in v1.24.0
func DatasourceIpDhcpServerLeases ¶ added in v1.28.0
func DatasourceSystemResource ¶ added in v1.24.0
func DatasourceSystemRouterboard ¶ added in v1.67.0
func DatasourceWiFiEasyConnect ¶ added in v1.63.1
func DatasourceX509 ¶ added in v1.51.0
func DefaultCreate ¶
func DefaultCreate(s map[string]*schema.Schema) schema.CreateContextFunc
func DefaultCreateUpdate ¶ added in v1.63.0
func DefaultCreateUpdate(s map[string]*schema.Schema) func(context.Context, *schema.ResourceData, interface{}) diag.Diagnostics
Function to update resources that are present in the system by default out of the box. The distinctive feature of such resources is that they cannot be deleted, but they can be modified. For example, enabling/disabling the resource.
FIXME Replace fucntions in resources: ResourceInterfaceEthernetSwitchPortIsolation, ResourceInterfaceEthernetSwitchPort ResourceInterfaceEthernetSwitch, ResourceInterfaceLte, ResourceIpService
func DefaultCreateWithTimeout ¶ added in v1.65.0
func DefaultDelete ¶
func DefaultDelete(s map[string]*schema.Schema) schema.DeleteContextFunc
func DefaultRead ¶
func DefaultRead(s map[string]*schema.Schema) schema.ReadContextFunc
func DefaultSystemCreate ¶
func DefaultSystemCreate(s map[string]*schema.Schema) schema.CreateContextFunc
func DefaultSystemDatasourceRead ¶ added in v1.24.0
func DefaultSystemDatasourceRead(s map[string]*schema.Schema) schema.ReadContextFunc
func DefaultSystemDelete ¶
func DefaultSystemDelete(s map[string]*schema.Schema) schema.DeleteContextFunc
func DefaultSystemRead ¶
func DefaultSystemRead(s map[string]*schema.Schema) schema.ReadContextFunc
func DefaultSystemUpdate ¶
func DefaultSystemUpdate(s map[string]*schema.Schema) schema.UpdateContextFunc
func DefaultUpdate ¶
func DefaultUpdate(s map[string]*schema.Schema) schema.UpdateContextFunc
func DefaultValidateCreate ¶
func DefaultValidateCreate(s map[string]*schema.Schema, f DataValidateFunc) schema.CreateContextFunc
func DefaultValidateUpdate ¶
func DefaultValidateUpdate(s map[string]*schema.Schema, f DataValidateFunc) schema.UpdateContextFunc
func EscapeChars ¶
EscapeChars peterGo https://groups.google.com/g/golang-nuts/c/NiQiAahnl5E/m/U60Sm1of-_YJ
func ImportStateCustomContext ¶ added in v1.44.3
func ImportStateCustomContext(s map[string]*schema.Schema) schema.StateContextFunc
ImportStateCustomContext is an implementation of StateContextFunc that can be used to import resources with the ability to explicitly or implicitly specify a key field. `terraform [global options] import [options] ADDR ID`. During import the content of the `ID` is checked and depending on the specified string it is possible to automatically search for the internal Mikrotik identifier. Logic of `ID` processing - The first character of the string contains an asterisk (standard Mikrotik identifier `*3E`): import without additional search. - String containing no "=" character (`wifi-01`): the "name" field is used for searching. - String containing only one "=" character (`"comment=hAP-ac3"`): the "word left" and "word right" pair is used for searching.
func IpRangeToCIDR ¶
func KebabToSnake ¶
KebabToSnake Convert Mikrotik JSON names to TF schema names: some-filed to some_field.
func ListToString ¶
ListToString Convert List and Set to a delimited string.
func MikrotikResourceDataToTerraform ¶
func MikrotikResourceDataToTerraform(item MikrotikItem, s map[string]*schema.Schema, d *schema.ResourceData) diag.Diagnostics
MikrotikResourceDataToTerraform Unmarshal Mikrotik resource (incoming data: JSON, etc.) to TF resource schema.
func MikrotikResourceDataToTerraformDatasource ¶
func MikrotikResourceDataToTerraformDatasource(items *[]MikrotikItem, resourceDataKeyName string, s map[string]*schema.Schema, d *schema.ResourceData) diag.Diagnostics
func NewClient ¶
func NewClient(ctx context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics)
func NewProvider ¶
func PrefixedUniqueId ¶
func PropDefaultNameRo ¶ added in v1.58.0
func PropDropByValue ¶ added in v1.35.0
func PropEnabled ¶ added in v1.54.0
PropEnabled
func PropMacAddressRw ¶ added in v1.32.0
PropMacAddress
func PropNameOptional ¶ added in v1.54.3
func PropResourcePath ¶
PropResourcePath Resource path property.
func PropSetUnsetFields ¶ added in v1.20.1
PropSetUnsetFields
func PropSkipFields ¶ added in v1.3.0
PropSkipFields SnakeName notation
func PropTransformSet ¶
PropTransformSet List of []string{"TF : MT", "TF : MT", ...} string pairs.
func ReadItems ¶
func ReadItems(id *ItemId, resourcePath string, c Client) (*[]MikrotikItem, error)
func ReadItemsFiltered ¶
func ReadItemsFiltered(filter []string, resourcePath string, c Client) (*[]MikrotikItem, error)
func ResourceCapsManAaa ¶
func ResourceCapsManAccessList ¶ added in v1.19.0
func ResourceCapsManChannel ¶
func ResourceCapsManChannelV0 ¶ added in v1.21.0
func ResourceCapsManChannelV1 ¶ added in v1.55.0
func ResourceCapsManConfigurationV0 ¶ added in v1.21.0
func ResourceCapsManDatapathV0 ¶ added in v1.21.0
func ResourceCapsManInterface ¶ added in v1.44.0
func ResourceCapsManManager ¶
func ResourceCapsManProvisioningV0 ¶ added in v1.61.2
func ResourceCapsManRates ¶
func ResourceCapsManRatesV0 ¶ added in v1.21.0
func ResourceCapsManSecurityV0 ¶ added in v1.21.0
func ResourceCertificateScepServer ¶ added in v1.46.0
func ResourceContainer ¶ added in v1.33.1
https://help.mikrotik.com/docs/display/ROS/Container#Container-Properties
func ResourceContainerConfig ¶ added in v1.33.1
https://help.mikrotik.com/docs/display/ROS/Container#Container-Containerconfiguration
func ResourceContainerEnvs ¶ added in v1.33.1
func ResourceContainerMounts ¶ added in v1.33.1
func ResourceCreate ¶
func ResourceCreate(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, m interface{}) diag.Diagnostics
ResourceCreate - Creation of a resource in accordance with the TF Schema. It is possible to transparently pass the request type (CRUD Method) within an existing context.
CreateContext: func(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { return ResourceCreate(ctxSetCrudMethod(ctx, crudGenerateKey), resSchema, d, m) },
func ResourceCreateAndWait ¶ added in v1.65.0
func ResourceDelete ¶
func ResourceDelete(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, m interface{}) diag.Diagnostics
ResourceDelete Deleting the resource.
func ResourceDhcpClient ¶
ResourceDhcpClient https://help.mikrotik.com/docs/display/ROS/DHCP#DHCP-DHCPClient
func ResourceDhcpClientOption ¶ added in v1.33.0
ResourceDhcpClient https://help.mikrotik.com/docs/display/ROS/DHCP#DHCP-DHCPClient
func ResourceDhcpRelay ¶ added in v1.45.0
ResourceDhcpRelay https://wiki.mikrotik.com/wiki/Manual:IP/DHCP_Relay
func ResourceDhcpServer ¶
ResourceDhcpServer https://help.mikrotik.com/docs/display/ROS/DHCP#DHCP-Leases
func ResourceDhcpServerConfig ¶ added in v1.22.0
ResourceDhcpServerConfig https://help.mikrotik.com/docs/display/ROS/DHCP#DHCP-StoreConfiguration
func ResourceDhcpServerLease ¶
ResourceDhcpServerLease https://wiki.mikrotik.com/wiki/Manual:IP/DHCP_Server
func ResourceDhcpServerNetwork ¶
ResourceDhcpServerNetwork https://wiki.mikrotik.com/wiki/Manual:IP/DHCP_Server#Networks
func ResourceDhcpServerNetworkV0 ¶ added in v1.55.0
ResourceDhcpServerNetwork https://wiki.mikrotik.com/wiki/Manual:IP/DHCP_Server#Networks
func ResourceDhcpServerOption ¶ added in v1.15.0
ResourceDhcpServerOption https://help.mikrotik.com/docs/display/ROS/DHCP#DHCP-DHCPServer
func ResourceDhcpServerOptionSet ¶ added in v1.15.0
ResourceDhcpServerOption https://wiki.mikrotik.com/wiki/Manual:IP/DHCP_Server
func ResourceDhcpServerV0 ¶ added in v1.21.0
func ResourceDns ¶
ResourceDns https://wiki.mikrotik.com/wiki/Manual:IP/DNS
func ResourceDnsAdlist ¶ added in v1.62.0
ResourceDnsAdlist https://help.mikrotik.com/docs/display/ROS/DNS#DNS-Adlist
func ResourceDnsRecord ¶
ResourceDnsRecord https://wiki.mikrotik.com/wiki/Manual:IP/DNS https://help.mikrotik.com/docs/display/ROS/DNS
func ResourceDnsV0 ¶ added in v1.55.0
ResourceDns https://wiki.mikrotik.com/wiki/Manual:IP/DNS
func ResourceFile ¶ added in v1.33.0
https://help.mikrotik.com/docs/pages/viewpage.action?pageId=2555971
func ResourceIPAddress ¶
ResourceIPAddress https://wiki.mikrotik.com/wiki/Manual:IP/Address
func ResourceIPConnectionTracking ¶ added in v1.17.0
ResourceIPConnectionTracking https://help.mikrotik.com/docs/display/ROS/Connection+tracking
func ResourceIPFirewallAddrList ¶
ResourceIPFirewallAddrList https://wiki.mikrotik.com/wiki/Manual:IP/Firewall/Address_list
func ResourceIPFirewallFilter ¶
ResourceIPFirewallFilter https://wiki.mikrotik.com/wiki/Manual:IP/Firewall/Filter
func ResourceIPFirewallMangle ¶
ResourceIPFirewallMangle https://wiki.mikrotik.com/wiki/Manual:IP/Firewall/Mangle
func ResourceIPFirewallNat ¶
ResourceIPFirewallNat https://help.mikrotik.com/docs/display/ROS/NAT
func ResourceIPFirewallRaw ¶ added in v1.52.0
{ ".id": "*1", "action": "accept", "bytes": "53342", "chain": "prerouting", "comment": "1", "disabled": "false", "dynamic": "false", "invalid": "false", "log": "false", "log-prefix": "", "packets": "497" }
ResourceIPFirewallRaw https://wiki.mikrotik.com/wiki/Manual:IP/Firewall/Raw https://help.mikrotik.com/docs/display/ROS/Common+Firewall+Matchers+and+Actions
func ResourceIPPool ¶
ResourceIPPool https://help.mikrotik.com/docs/display/ROS/IP+Pools
func ResourceIPPoolV0 ¶ added in v1.21.0
func ResourceIPRoute ¶
ResourceIPRoute https://wiki.mikrotik.com/wiki/Manual:IP/Route
func ResourceIPVrf ¶ added in v1.48.0
ResourceIPRoute https://wiki.mikrotik.com/wiki/Manual:Virtual_Routing_and_Forwarding
func ResourceIPv6Address ¶
ResourceIPv6Address https://help.mikrotik.com/docs/display/ROS/IP+Addressing
func ResourceIPv6DhcpClient ¶ added in v1.33.0
ResourceIPv6DhcpClient https://help.mikrotik.com/docs/display/ROS/DHCP#DHCP-DHCPv6Client
func ResourceIPv6DhcpClientOption ¶ added in v1.34.0
ResourceDhcpClient https://help.mikrotik.com/docs/display/ROS/DHCP#DHCP-DHCPClient
func ResourceIPv6FirewallAddrList ¶ added in v1.9.0
ResourceIPv6FirewallAddrList https://help.mikrotik.com/docs/display/ROS/Address-lists They work more or less the same as IPv4 address lists, except no ranges
func ResourceIPv6FirewallFilter ¶
ResourceIPv6FirewallFilter https://help.mikrotik.com/docs/display/ROS/Filter#Filter-Properties.1
func ResourceIPv6FirewallMangle ¶ added in v1.72.0
ResourceIPv6FirewallMangle https://wiki.mikrotik.com/wiki/Manual:IP/Firewall/Mangle
func ResourceIPv6FirewallNat ¶ added in v1.72.0
ResourceIPv6FirewallNat https://help.mikrotik.com/docs/display/ROS/NAT
func ResourceIPv6NeighborDiscovery ¶ added in v1.35.0
ResourceIPv6NeighborDiscovery https://help.mikrotik.com/docs/display/ROS/IPv6+Neighbor+Discovery
func ResourceIPv6Route ¶
ResourceIPv6Route https://help.mikrotik.com/docs/display/ROS/IP+Routing
func ResourceInterface6to4 ¶ added in v1.68.0
https://help.mikrotik.com/docs/spaces/ROS/pages/135004174/6to4
func ResourceInterfaceBonding ¶ added in v1.7.0
https://help.mikrotik.com/docs/display/ROS/Bonding#Bonding-PropertyDescription
func ResourceInterfaceBridge ¶
ResourceInterfaceBridge https://wiki.mikrotik.com/wiki/Manual:Interface/Bridge
func ResourceInterfaceBridgeFilter ¶ added in v1.71.0
ResourceIPFirewallFilter https://help.mikrotik.com/docs/spaces/ROS/pages/328068/Bridging+and+Switching#BridgingandSwitching-BridgeFirewall
func ResourceInterfaceBridgeMlag ¶ added in v1.21.0
https://help.mikrotik.com/docs/display/ROS/Multi-chassis+Link+Aggregation+Group
func ResourceInterfaceBridgePort ¶
ResourceInterfaceBridgePort https://wiki.mikrotik.com/wiki/Manual:Interface/Bridge#Port_Settings
func ResourceInterfaceBridgeSettings ¶ added in v1.8.0
https://wiki.mikrotik.com/wiki/Manual:Interface/Bridge#Bridge_Settings
func ResourceInterfaceBridgeV0 ¶ added in v1.21.0
func ResourceInterfaceBridgeVlan ¶
ResourceInterfaceBridgeVlan https://wiki.mikrotik.com/wiki/Manual:Interface/Bridge#Bridge_VLAN_Filtering
func ResourceInterfaceBridgeVlanV0 ¶ added in v1.55.0
ResourceInterfaceBridgeVlan https://wiki.mikrotik.com/wiki/Manual:Interface/Bridge#Bridge_VLAN_Filtering
func ResourceInterfaceDot1xClient ¶ added in v1.23.0
https://help.mikrotik.com/docs/display/ROS/Dot1X#Dot1X-Client
func ResourceInterfaceDot1xClientV0 ¶ added in v1.55.0
https://help.mikrotik.com/docs/display/ROS/Dot1X#Dot1X-Client
func ResourceInterfaceDot1xServer ¶ added in v1.23.0
https://help.mikrotik.com/docs/display/ROS/Dot1X#Dot1X-Server
func ResourceInterfaceDot1xServerV0 ¶ added in v1.55.0
https://help.mikrotik.com/docs/display/ROS/Dot1X#Dot1X-Server
func ResourceInterfaceEoip ¶ added in v1.20.0
func ResourceInterfaceEoipV0 ¶ added in v1.21.0
func ResourceInterfaceEthernet ¶ added in v1.14.0
ResourceInterfaceEthernet is the schema for ethernet interfaces https://help.mikrotik.com/docs/display/ROS/Ethernet#Ethernet-Properties
func ResourceInterfaceEthernetSwitch ¶ added in v1.21.0
https://help.mikrotik.com/docs/display/ROS/Switch+Chip+Features#SwitchChipFeatures-CPUFlowControl https://help.mikrotik.com/docs/display/ROS/L3+Hardware+Offloading
func ResourceInterfaceEthernetSwitchHost ¶ added in v1.32.0
https://help.mikrotik.com/docs/display/ROS/Switch+Chip+Features#SwitchChipFeatures-HostTable
func ResourceInterfaceEthernetSwitchPort ¶ added in v1.32.0
https://help.mikrotik.com/docs/display/ROS/L3+Hardware+Offloading#L3HardwareOffloading-SwitchPortConfiguration https://help.mikrotik.com/docs/display/ROS/Switch+Chip+Features
func ResourceInterfaceEthernetSwitchPortIsolation ¶ added in v1.32.0
https://help.mikrotik.com/docs/display/ROS/Switch+Chip+Features#SwitchChipFeatures-Portisolation
func ResourceInterfaceEthernetSwitchRule ¶ added in v1.32.0
https://help.mikrotik.com/docs/display/ROS/Switch+Chip+Features#SwitchChipFeatures-RuleTable
func ResourceInterfaceEthernetSwitchVlan ¶ added in v1.32.0
https://help.mikrotik.com/docs/display/ROS/Switch+Chip+Features#SwitchChipFeatures-VLANTable
func ResourceInterfaceGre ¶
ResourceInterfaceGre https://wiki.mikrotik.com/wiki/Manual:Interface/Gre
func ResourceInterfaceGreV0 ¶ added in v1.21.0
func ResourceInterfaceIPIP ¶ added in v1.32.6
ResourceInterfaceIPIP https://wiki.mikrotik.com/wiki/Manual:Interface/IPIP
func ResourceInterfaceL2tpClient ¶ added in v1.74.0
https://help.mikrotik.com/docs/spaces/ROS/pages/2031631/L2TP#L2TP-L2TPClient
func ResourceInterfaceList ¶
func ResourceInterfaceListV0 ¶ added in v1.21.0
func ResourceInterfaceLte ¶ added in v1.58.0
func ResourceInterfaceLteApn ¶ added in v1.58.0
https://help.mikrotik.com/docs/display/ROS/LTE#LTE-APNprofiles
func ResourceInterfaceMacVlan ¶ added in v1.38.0
ResourceInterfaceMacVlan https://help.mikrotik.com/docs/display/ROS/MACVLAN
func ResourceInterfaceOpenVPNServer ¶ added in v1.5.0
func ResourceInterfacePPPoEClient ¶ added in v1.10.0
https://help.mikrotik.com/docs/display/ROS/PPPoE#PPPoE-PPPoEClient
func ResourceInterfacePppoeServer ¶ added in v1.72.0
https://help.mikrotik.com/docs/spaces/ROS/pages/2031625/PPPoE#PPPoE-PPPoEServer
func ResourceInterfaceVeth ¶ added in v1.7.0
func ResourceInterfaceVlan ¶
ResourceInterfaceVlan https://wiki.mikrotik.com/wiki/Manual:Interface/VLAN
func ResourceInterfaceVlanV0 ¶ added in v1.21.0
func ResourceInterfaceVrrp ¶
ResourceInterfaceVrrp https://help.mikrotik.com/docs/display/ROS/VRRP
func ResourceInterfaceVrrpV0 ¶ added in v1.21.0
func ResourceInterfaceVxlan ¶ added in v1.67.0
https://help.mikrotik.com/docs/spaces/ROS/pages/100007937/VXLAN
func ResourceInterfaceVxlanVteps ¶ added in v1.67.0
https://help.mikrotik.com/docs/spaces/ROS/pages/100007937/VXLAN#VXLAN-Forwardingtable
func ResourceInterfaceW60g ¶ added in v1.73.0
https://help.mikrotik.com/docs/spaces/ROS/pages/39059501/W60G#W60G-Generalinterfaceproperties
func ResourceInterfaceW60gStation ¶ added in v1.73.0
https://help.mikrotik.com/docs/spaces/ROS/pages/39059501/W60G
func ResourceInterfaceWireguard ¶
ResourceInterfaceWireguard https://help.mikrotik.com/docs/display/ROS/WireGuard
func ResourceInterfaceWireguardPeer ¶
ResourceInterfaceWireguardPeer https://help.mikrotik.com/docs/display/ROS/WireGuard#WireGuard-Peers
func ResourceInterfaceWireguardV0 ¶ added in v1.21.0
func ResourceInterfaceWireless ¶ added in v1.64.0
https://help.mikrotik.com/docs/display/ROS/Wireless+Interface#WirelessInterface-Overview
func ResourceInterfaceWirelessAccessList ¶ added in v1.64.0
func ResourceInterfaceWirelessCap ¶ added in v1.39.0
func ResourceInterfaceWirelessConnectList ¶ added in v1.70.0
iw-asra=any iw-esr=any iw-hessid=00:00:00:00:00:00 iw-hotspot20=any iw-hotspot20-dgaf=any iw-internet=any iw-ipv4-availability=any iw-ipv6-availability=any iw-network-type=wildcard iw-roaming-ois="" iw-venue=any iw-uesa=any
https://help.mikrotik.com/docs/spaces/ROS/pages/8978446/Wireless+Interface#WirelessInterface-ConnectList https://help.mikrotik.com/docs/spaces/ROS/pages/7962628/Interworking+Profiles
func ResourceInterfaceWirelessSecurityProfiles ¶ added in v1.64.0
https://help.mikrotik.com/docs/display/ROS/Wireless+Interface#WirelessInterface-SecurityProfiles
func ResourceIpCloud ¶ added in v1.12.0
https://wiki.mikrotik.com/wiki/Manual:IP/Cloud https://help.mikrotik.com/docs/display/ROS/Cloud
func ResourceIpCloudAdvanced ¶ added in v1.39.0
https://help.mikrotik.com/docs/display/ROS/Cloud#Cloud-Advanced
func ResourceIpHotspot ¶ added in v1.63.0
func ResourceIpHotspotIpBinding ¶ added in v1.63.0
func ResourceIpHotspotProfile ¶ added in v1.63.0
func ResourceIpHotspotServicePort ¶ added in v1.63.0
func ResourceIpHotspotUser ¶ added in v1.63.0
func ResourceIpHotspotUserProfile ¶ added in v1.63.0
https://wiki.mikrotik.com/wiki/Manual:IP/Hotspot/User#User_Profile
func ResourceIpHotspotWalledGarden ¶ added in v1.63.0
https://wiki.mikrotik.com/wiki/Manual:IP/Hotspot/Walled_Garden
func ResourceIpHotspotWalledGardenIp ¶ added in v1.63.0
https://wiki.mikrotik.com/wiki/Manual:IP/Hotspot/Walled_Garden#IP_Walled_Garden
func ResourceIpIpsecIdentity ¶ added in v1.65.0
https://help.mikrotik.com/docs/display/ROS/IPsec#IPsec-Identities
func ResourceIpIpsecKey ¶ added in v1.65.0
func ResourceIpIpsecModeConfig ¶ added in v1.65.0
https://help.mikrotik.com/docs/display/ROS/IPsec#IPsec-Modeconfigs
func ResourceIpIpsecPeer ¶ added in v1.65.0
https://help.mikrotik.com/docs/display/ROS/IPsec#IPsec-Peers
func ResourceIpIpsecPolicy ¶ added in v1.65.0
https://help.mikrotik.com/docs/display/ROS/IPsec#IPsec-Policies
func ResourceIpIpsecPolicyGroup ¶ added in v1.65.0
https://help.mikrotik.com/docs/display/ROS/IPsec#IPsec-Groups
func ResourceIpIpsecProfile ¶ added in v1.65.0
https://help.mikrotik.com/docs/display/ROS/IPsec#IPsec-Profiles
func ResourceIpIpsecProposal ¶ added in v1.65.0
https://help.mikrotik.com/docs/display/ROS/IPsec#IPsec-Proposals
func ResourceIpIpsecSettings ¶ added in v1.65.0
https://help.mikrotik.com/docs/display/ROS/IPsec#IPsec-Settings
func ResourceIpNeighborDiscoverySettings ¶ added in v1.43.0
https://help.mikrotik.com/docs/display/ROS/Neighbor+discovery
func ResourceIpSSHServer ¶ added in v1.43.0
https://help.mikrotik.com/docs/display/ROS/SSH#SSH-SSHServer
func ResourceIpService ¶ added in v1.4.0
func ResourceIpv6DhcpServer ¶ added in v1.66.0
https://help.mikrotik.com/docs/display/ROS/DHCP#DHCP-DHCPv6Server
func ResourceIpv6DhcpServerOption ¶ added in v1.66.0
https://help.mikrotik.com/docs/display/ROS/DHCP#DHCP-DHCPOptions.1 https://www.ipamworldwide.com/ipam/isc-dhcpv6-options.html https://jjjordan.github.io/dhcp119/
func ResourceIpv6DhcpServerOptionSets ¶ added in v1.66.0
func ResourceIpv6Pool ¶ added in v1.66.0
https://help.mikrotik.com/docs/display/ROS/IP+Pools#IPPools-IPv6Pool
func ResourceIpv6Settings ¶ added in v1.69.0
https://help.mikrotik.com/docs/spaces/ROS/pages/103841817/IP+Settings#IPSettings-IPv6Settings
func ResourceMoveItems ¶ added in v1.27.2
func ResourceOpenVPNClient ¶ added in v1.50.0
func ResourceOpenVPNServer ¶ added in v1.5.0
func ResourceOpenVPNServerV0 ¶ added in v1.57.0
func ResourcePPPProfile ¶ added in v1.5.0
https://help.mikrotik.com/docs/display/ROS/PPP+AAA#PPPAAA-UserProfiles
func ResourcePPPSecret ¶ added in v1.5.0
https://help.mikrotik.com/docs/display/ROS/PPP+AAA#PPPAAA-UserDatabase
func ResourcePppAaa ¶ added in v1.39.0
func ResourceRadius ¶ added in v1.25.0
https://help.mikrotik.com/docs/display/ROS/RADIUS#RADIUS-RADIUSClient
func ResourceRadiusIncoming ¶ added in v1.25.0
https://help.mikrotik.com/docs/display/ROS/RADIUS#RADIUS-ConnectionTerminatingfromRADIUS
func ResourceRadiusV0 ¶ added in v1.55.0
https://help.mikrotik.com/docs/display/ROS/RADIUS#RADIUS-RADIUSClient
func ResourceRead ¶
func ResourceRead(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, m interface{}) diag.Diagnostics
ResourceRead Reading some information about one specific resource.
func ResourceRoutingBGPConnection ¶ added in v1.7.1
https://help.mikrotik.com/docs/display/ROS/BGP#BGP-ConnectionMenu
func ResourceRoutingBGPTemplate ¶ added in v1.7.1
func ResourceRoutingFilterRule ¶ added in v1.30.0
https://help.mikrotik.com/docs/display/ROS/Route+Selection+and+Filters
func ResourceRoutingOspfArea ¶ added in v1.11.0
ResourceRoutingOspfArea https://help.mikrotik.com/docs/display/ROS/OSPF
func ResourceRoutingOspfInstance ¶ added in v1.11.0
ResourceRoutingOspfInstance https://help.mikrotik.com/docs/display/ROS/OSPF
func ResourceRoutingOspfInterfaceTemplate ¶ added in v1.11.0
ResourceRoutingOspfInterfaceTemplate https://help.mikrotik.com/docs/display/ROS/OSPF
func ResourceRoutingOspfInterfaceTemplateV0 ¶ added in v1.69.1
ResourceRoutingOspfInterfaceTemplate https://help.mikrotik.com/docs/display/ROS/OSPF
func ResourceRoutingRule ¶ added in v1.59.0
func ResourceRoutingTable ¶ added in v1.3.9
func ResourceSNMP ¶ added in v1.13.0
func ResourceSNMPCommunity ¶ added in v1.13.0
https://help.mikrotik.com/docs/display/ROS/SNMP#SNMP-CommunityProperties
func ResourceSNMPCommunityV0 ¶ added in v1.55.0
https://help.mikrotik.com/docs/display/ROS/SNMP#SNMP-CommunityProperties
func ResourceSystemCertificate ¶ added in v1.3.0
https://help.mikrotik.com/docs/display/ROS/Certificates https://wiki.mikrotik.com/wiki/Manual:System/Certificates
func ResourceSystemClock ¶ added in v1.49.0
func ResourceSystemIdentity ¶
func ResourceSystemLed ¶ added in v1.60.0
func ResourceSystemLedSettings ¶ added in v1.60.0
https://help.mikrotik.com/docs/display/ROS/LEDs#LEDs-LEDSettings
func ResourceSystemLogging ¶ added in v1.16.0
ResourceSystemLogging defines the resource for configuring logging rules https://help.mikrotik.com/docs/display/ROS/Log
func ResourceSystemLoggingAction ¶ added in v1.53.0
ResourceSystemLoggingActions https://help.mikrotik.com/docs/display/ROS/Log#Log-Actions
func ResourceSystemNtpClient ¶ added in v1.43.0
https://help.mikrotik.com/docs/display/ROS/NTP#NTP-NTPClientproperties:
func ResourceSystemNtpServer ¶ added in v1.26.0
https://help.mikrotik.com/docs/display/ROS/NTP#NTP-NTPServersettings:.1
func ResourceSystemRouterboardButtonMode ¶ added in v1.60.0
https://help.mikrotik.com/docs/display/ROS/RouterBOARD#RouterBOARD-ModeandResetbuttons
func ResourceSystemRouterboardButtonReset ¶ added in v1.60.0
https://help.mikrotik.com/docs/display/ROS/RouterBOARD#RouterBOARD-ModeandResetbuttons
func ResourceSystemRouterboardButtonWps ¶ added in v1.60.0
https://help.mikrotik.com/docs/display/ROS/RouterBOARD#RouterBOARD-ModeandResetbuttons
func ResourceSystemRouterboardSettings ¶ added in v1.60.0
https://help.mikrotik.com/docs/display/ROS/RouterBOARD#RouterBOARD-Settings
func ResourceSystemRouterboardUsb ¶ added in v1.60.0
func ResourceSystemScheduler ¶
ResourceSystemScheduler https://wiki.mikrotik.com/wiki/Manual:System/Scheduler https://wiki.mikrotik.com/wiki/Manual:Scripting#Variables https://help.mikrotik.com/docs/display/ROS/User#User-UserGroups
func ResourceSystemSchedulerV0 ¶ added in v1.21.0
func ResourceSystemScript ¶ added in v1.36.0
ResourceSystemScript https://help.mikrotik.com/docs/display/ROS/Scripting#Scripting-Scriptrepository
func ResourceSystemUserSettings ¶ added in v1.29.0
https://help.mikrotik.com/docs/display/ROS/User#User-UserSettings
func ResourceToolBandwidthServer ¶ added in v1.54.0
func ResourceToolEmail ¶ added in v1.74.0
func ResourceToolMacServer ¶ added in v1.43.0
func ResourceToolMacServerWinBox ¶ added in v1.43.0
func ResourceToolNetwatch ¶ added in v1.59.0
func ResourceToolSniffer ¶ added in v1.63.0
func ResourceUPNPInterfaces ¶ added in v1.45.0
ResourceUPNPInterfaces https://help.mikrotik.com/docs/display/ROS/UPnP
func ResourceUPNPSettings ¶ added in v1.45.0
ResourceUPNPSettings https://help.mikrotik.com/docs/display/ROS/UPnP
func ResourceUpdate ¶
func ResourceUpdate(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, m interface{}) diag.Diagnostics
ResourceUpdate Updating the resource in accordance with the TF Schema.
func ResourceUser ¶ added in v1.6.0
https://help.mikrotik.com/docs/display/ROS/User#User-RouterUsers
func ResourceUserAaa ¶ added in v1.29.0
https://help.mikrotik.com/docs/display/ROS/User#User-RemoteAAA
func ResourceUserGroup ¶ added in v1.29.0
https://help.mikrotik.com/docs/display/ROS/User#User-UserGroups
func ResourceUserManagerAdvanced ¶ added in v1.27.0
https://help.mikrotik.com/docs/display/ROS/User+Manager#UserManager-Advanced
func ResourceUserManagerAttribute ¶ added in v1.27.0
https://help.mikrotik.com/docs/display/ROS/User+Manager#UserManager-Attributes
func ResourceUserManagerDatabase ¶ added in v1.27.0
https://help.mikrotik.com/docs/display/ROS/User+Manager#UserManager-Database
func ResourceUserManagerLimitation ¶ added in v1.27.0
https://help.mikrotik.com/docs/display/ROS/User+Manager#UserManager-Limitations
func ResourceUserManagerProfile ¶ added in v1.27.0
https://help.mikrotik.com/docs/display/ROS/User+Manager#UserManager-Profiles
func ResourceUserManagerProfileLimitation ¶ added in v1.27.0
https://help.mikrotik.com/docs/display/ROS/User+Manager#UserManager-ProfileLimitations
func ResourceUserManagerRouter ¶ added in v1.27.0
https://help.mikrotik.com/docs/display/ROS/User+Manager#UserManager-Routers
func ResourceUserManagerSettings ¶ added in v1.27.0
https://help.mikrotik.com/docs/display/ROS/User+Manager#UserManager-Settings
func ResourceUserManagerUser ¶ added in v1.27.0
https://help.mikrotik.com/docs/display/ROS/User+Manager#UserManager-Users
func ResourceUserManagerUserGroup ¶ added in v1.27.0
https://help.mikrotik.com/docs/display/ROS/User+Manager#UserManager-UserGroups
func ResourceUserManagerUserProfile ¶ added in v1.27.0
https://help.mikrotik.com/docs/display/ROS/User+Manager#UserManager-UserProfiles
func ResourceWifi ¶ added in v1.37.0
https://help.mikrotik.com/docs/display/ROS/WiFi#WiFi-Miscellaneousproperties https://help.mikrotik.com/docs/display/ROS/WiFi#WiFi-Read-onlyproperties
func ResourceWifiAaa ¶ added in v1.31.0
https://help.mikrotik.com/docs/display/ROS/WiFi#WiFi-AAAproperties
func ResourceWifiAccessList ¶ added in v1.31.0
https://help.mikrotik.com/docs/display/ROS/WiFi#WiFi-AccessList.1
func ResourceWifiCap ¶ added in v1.31.0
https://help.mikrotik.com/docs/display/ROS/WiFi#WiFi-CAPconfiguration
func ResourceWifiCapsman ¶ added in v1.31.0
https://help.mikrotik.com/docs/display/ROS/WiFi#WiFi-CAPsMANGlobalConfiguration
func ResourceWifiChannel ¶ added in v1.31.0
https://help.mikrotik.com/docs/display/ROS/WiFi#WiFi-Channelproperties
func ResourceWifiConfiguration ¶ added in v1.31.0
https://help.mikrotik.com/docs/display/ROS/WiFi#WiFi-Configurationproperties
func ResourceWifiDatapath ¶ added in v1.31.0
https://help.mikrotik.com/docs/display/ROS/WiFi#WiFi-Datapathproperties
func ResourceWifiInterworking ¶ added in v1.31.0
https://help.mikrotik.com/docs/display/ROS/Interworking+Profiles
func ResourceWifiProvisioning ¶ added in v1.31.0
https://help.mikrotik.com/docs/display/ROS/WiFi#WiFi-CAPsMANProvisioning
func ResourceWifiSecurity ¶ added in v1.31.0
https://help.mikrotik.com/docs/display/ROS/WiFi#WiFi-SecurityProperties
func ResourceWifiSecurityMultiPassphrase ¶ added in v1.73.0
func ResourceWifiSteering ¶ added in v1.31.0
https://help.mikrotik.com/docs/display/ROS/WiFi#WiFi-Steeringproperties
func ResourceWireguardKeys ¶ added in v1.18.1
func ResourceZerotier ¶ added in v1.40.0
https://help.mikrotik.com/docs/display/ROS/ZeroTier#ZeroTier-Parameters
func ResourceZerotierController ¶ added in v1.40.0
https://help.mikrotik.com/docs/display/ROS/ZeroTier#ZeroTier-Parameters.1
func ResourceZerotierInterface ¶ added in v1.40.0
https://help.mikrotik.com/docs/display/ROS/ZeroTier#ZeroTier-Parameters
func SnakeToKebab ¶
SnakeToKebab Convert IF schema names to Mikrotik JSON names: some_filed to some-field.
func SystemResourceCreateUpdate ¶
func SystemResourceCreateUpdate(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, m interface{}) diag.Diagnostics
SystemResourceCreateUpdate A resource cannot be created, it can only be changed.
func SystemResourceDelete ¶
func SystemResourceDelete(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, m interface{}) diag.Diagnostics
SystemResourceDelete Delete function will remove the object from the Terraform state No delete functionality provided by API for System Resources.
func SystemResourceRead ¶
func SystemResourceRead(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, m interface{}) diag.Diagnostics
SystemResourceRead The difference from the normal reading is in the method of generation of Id.
func TerraformResourceDataToMikrotik ¶
func TerraformResourceDataToMikrotik(s map[string]*schema.Schema, d *schema.ResourceData) (MikrotikItem, *MikrotikItemMetadata)
TerraformResourceDataToMikrotik Marshal Mikrotik resource from TF resource schema.
Types ¶
type ApiClient ¶
type ApiClient struct { HostURL string Username string Password string Transport TransportType *routeros.Client // contains filtered or unexported fields }
func (*ApiClient) GetExtraParams ¶ added in v1.65.0
func (c *ApiClient) GetExtraParams() *ExtraParams
func (*ApiClient) GetTransport ¶
func (c *ApiClient) GetTransport() TransportType
func (*ApiClient) SendRequest ¶
func (c *ApiClient) SendRequest(method crudMethod, url *URL, item MikrotikItem, result interface{}) error
type Client ¶
type Client interface { GetExtraParams() *ExtraParams GetTransport() TransportType SendRequest(method crudMethod, url *URL, item MikrotikItem, result interface{}) error }
type DataValidateFunc ¶
type DataValidateFunc func(d *schema.ResourceData) diag.Diagnostics
type ExtraParams ¶ added in v1.65.0
type ExtraParams struct {
SuppressSysODelWarn bool
}
type Key ¶ added in v1.18.0
A Key is a public, private, or pre-shared secret key. The Key constructor functions in this package can be used to create Keys suitable for each of these applications.
func GenerateKey ¶ added in v1.18.0
GenerateKey generates a Key suitable for use as a pre-shared secret key from a cryptographically safe source.
The output Key should not be used as a private key; use GeneratePrivateKey instead.
func GeneratePrivateKey ¶ added in v1.18.0
GeneratePrivateKey generates a Key suitable for use as a private key from a cryptographically safe source.
func NewKey ¶ added in v1.18.0
NewKey creates a Key from an existing byte slice. The byte slice must be exactly 32 bytes in length.
type MikrotikItem ¶
MikrotikItem Contains only data.
func CreateItem ¶
func CreateItem(ctx context.Context, item MikrotikItem, resourcePath string, c Client) (MikrotikItem, error)
func UpdateItem ¶
func UpdateItem(id *ItemId, resourcePath string, item MikrotikItem, c Client) (MikrotikItem, error)
func (MikrotikItem) GetID ¶
func (m MikrotikItem) GetID(t IdType) string
type MikrotikItemMetadata ¶
type MikrotikItemMetadata struct { IdType IdType // The field contains ID. Path string // Resource URL. Meta map[string]string // Additional metadata that may be present in the schema. }
MikrotikItemMetadata This information must travel from the schema to the resource polling function.
func GetMetadata ¶
func GetMetadata(s map[string]*schema.Schema) *MikrotikItemMetadata
GetMetadata Get item metadata fields from resource schema.
type RestClient ¶
type RestClient struct { HostURL string Username string Password string Transport TransportType *http.Client // contains filtered or unexported fields }
func (*RestClient) GetExtraParams ¶ added in v1.65.0
func (c *RestClient) GetExtraParams() *ExtraParams
func (*RestClient) GetTransport ¶
func (c *RestClient) GetTransport() TransportType
func (*RestClient) SendRequest ¶
func (c *RestClient) SendRequest(method crudMethod, url *URL, item MikrotikItem, result interface{}) error
type TransportType ¶
type TransportType int
const ( TransportAPI TransportType = 1 + iota TransportREST )
Using numbering from 1 to control type values.
Source Files ¶
- datasource_files.go
- datasource_interface_bridge_filter.go
- datasource_interfaces.go
- datasource_ip_addresses.go
- datasource_ip_arp.go
- datasource_ip_dhcp_server_leases.go
- datasource_ip_firewall.go
- datasource_ip_firewall_addr_list.go
- datasource_ip_firewall_filter.go
- datasource_ip_firewall_mangle.go
- datasource_ip_firewall_nat.go
- datasource_ip_routes.go
- datasource_ip_services.go
- datasource_ipv6_addresses.go
- datasource_ipv6_firewall.go
- datasource_ipv6_firewall_filter.go
- datasource_ipv6_firewall_mangle.go
- datasource_ipv6_firewall_nat.go
- datasource_system_resource.go
- datasource_system_routerboard.go
- datasource_wifi_easy_connect.go
- datasource_x509.go
- log.go
- mikrotik.go
- mikrotik_client.go
- mikrotik_client_api.go
- mikrotik_client_rest.go
- mikrotik_crud.go
- mikrotik_serialize.go
- parse_duration.go
- parse_iprange.go
- provider.go
- provider_resource_state_migration.go
- provider_schema_helpers.go
- resource_actions.go
- resource_actions_default.go
- resource_actions_default_system.go
- resource_bgp_connection.go
- resource_bgp_template.go
- resource_capsman_access_list.go
- resource_capsman_channel.go
- resource_capsman_channel_v0.go
- resource_capsman_channel_v1.go
- resource_capsman_configuration.go
- resource_capsman_configuration_v0.go
- resource_capsman_datapath.go
- resource_capsman_datapath_v0.go
- resource_capsman_interface.go
- resource_capsman_manager.go
- resource_capsman_provisioning.go
- resource_capsman_provisioning_v0.go
- resource_capsman_rates.go
- resource_capsman_rates_v0.go
- resource_capsman_security.go
- resource_capsman_security_v0.go
- resource_container.go
- resource_container_config.go
- resource_container_envs.go
- resource_container_mounts.go
- resource_file.go
- resource_interface_6to4.go
- resource_interface_bonding.go
- resource_interface_bridge.go
- resource_interface_bridge_filter.go
- resource_interface_bridge_mlag.go
- resource_interface_bridge_port.go
- resource_interface_bridge_settings.go
- resource_interface_bridge_v0.go
- resource_interface_bridge_vlan.go
- resource_interface_bridge_vlan_v0.go
- resource_interface_dot1x.go
- resource_interface_dot1x_v0.go
- resource_interface_eoip.go
- resource_interface_eoip_v0.go
- resource_interface_ethernet.go
- resource_interface_ethernet_switch.go
- resource_interface_ethernet_switch_host.go
- resource_interface_ethernet_switch_port.go
- resource_interface_ethernet_switch_port_isolation.go
- resource_interface_ethernet_switch_rule.go
- resource_interface_ethernet_switch_vlan.go
- resource_interface_gre.go
- resource_interface_gre_v0.go
- resource_interface_ipip.go
- resource_interface_l2tp_client.go
- resource_interface_list.go
- resource_interface_list_member.go
- resource_interface_list_v0.go
- resource_interface_lte.go
- resource_interface_lte_apn.go
- resource_interface_macvlan.go
- resource_interface_ovpn_server.go
- resource_interface_pppoe_client.go
- resource_interface_pppoe_server.go
- resource_interface_veth.go
- resource_interface_vlan.go
- resource_interface_vlan_v0.go
- resource_interface_vrrp.go
- resource_interface_vrrp_v0.go
- resource_interface_vxlan.go
- resource_interface_vxlan_vteps.go
- resource_interface_w60g.go
- resource_interface_w60g_station.go
- resource_interface_wireguard.go
- resource_interface_wireguard_peer.go
- resource_interface_wireguard_v0.go
- resource_interface_wireless.go
- resource_interface_wireless_access_list.go
- resource_interface_wireless_cap.go
- resource_interface_wireless_connect_list.go
- resource_interface_wireless_security_profiles.go
- resource_ip_address.go
- resource_ip_cloud.go
- resource_ip_cloud_advanced.go
- resource_ip_dhcp_client.go
- resource_ip_dhcp_client_option.go
- resource_ip_dhcp_relay.go
- resource_ip_dhcp_server.go
- resource_ip_dhcp_server_config.go
- resource_ip_dhcp_server_lease.go
- resource_ip_dhcp_server_network.go
- resource_ip_dhcp_server_network_v0.go
- resource_ip_dhcp_server_option.go
- resource_ip_dhcp_server_option_sets.go
- resource_ip_dhcp_server_v0.go
- resource_ip_dns.go
- resource_ip_dns_adlist.go
- resource_ip_dns_record.go
- resource_ip_dns_v0.go
- resource_ip_firewall_addr_list.go
- resource_ip_firewall_connection_tracking.go
- resource_ip_firewall_filter.go
- resource_ip_firewall_mangle.go
- resource_ip_firewall_nat.go
- resource_ip_firewall_raw.go
- resource_ip_hotspot.go
- resource_ip_hotspot_ip_binding.go
- resource_ip_hotspot_profile.go
- resource_ip_hotspot_service_port.go
- resource_ip_hotspot_user.go
- resource_ip_hotspot_user_profile.go
- resource_ip_hotspot_walled_garden.go
- resource_ip_hotspot_walled_garden_ip.go
- resource_ip_ipsec_identity.go
- resource_ip_ipsec_key.go
- resource_ip_ipsec_mode_config.go
- resource_ip_ipsec_peer.go
- resource_ip_ipsec_policy.go
- resource_ip_ipsec_policy_group.go
- resource_ip_ipsec_profile.go
- resource_ip_ipsec_proposal.go
- resource_ip_ipsec_settings.go
- resource_ip_neighbor_discovery.go
- resource_ip_pool.go
- resource_ip_pool_v0.go
- resource_ip_route.go
- resource_ip_service.go
- resource_ip_ssh_server.go
- resource_ip_upnp.go
- resource_ip_upnp_interfaces.go
- resource_ip_vrf.go
- resource_ipv6_address.go
- resource_ipv6_dhcp_client.go
- resource_ipv6_dhcp_client_option.go
- resource_ipv6_dhcp_server.go
- resource_ipv6_dhcp_server_option.go
- resource_ipv6_dhcp_server_option_sets.go
- resource_ipv6_firewall_addr_list.go
- resource_ipv6_firewall_filter.go
- resource_ipv6_firewall_mangle.go
- resource_ipv6_firewall_nat.go
- resource_ipv6_neighbor_discovery.go
- resource_ipv6_pool.go
- resource_ipv6_route.go
- resource_ipv6_settings.go
- resource_move.go
- resource_ovpn_client.go
- resource_ovpn_server.go
- resource_ovpn_server_v0.go
- resource_ppp_aaa.go
- resource_ppp_profile.go
- resource_ppp_secret.go
- resource_radius.go
- resource_radius_v0.go
- resource_routing_filter_rule.go
- resource_routing_ospf_area.go
- resource_routing_ospf_instance.go
- resource_routing_ospf_interface_template.go
- resource_routing_ospf_interface_template_v0.go
- resource_routing_rule.go
- resource_routing_table.go
- resource_snmp.go
- resource_snmp_community.go
- resource_snmp_community_v0.go
- resource_system_certificate.go
- resource_system_certificate_scep_server.go
- resource_system_clock.go
- resource_system_identity.go
- resource_system_led.go
- resource_system_led_settings.go
- resource_system_logging.go
- resource_system_logging_actions.go
- resource_system_ntp_client.go
- resource_system_ntp_server.go
- resource_system_routerboard_button_mode.go
- resource_system_routerboard_button_reset.go
- resource_system_routerboard_button_wps.go
- resource_system_routerboard_settings.go
- resource_system_routerboard_usb.go
- resource_system_scheduler.go
- resource_system_scheduler_v0.go
- resource_system_script.go
- resource_system_user.go
- resource_system_user_aaa.go
- resource_system_user_group.go
- resource_system_user_settings.go
- resource_testing_helper.go
- resource_tool_bandwidth_server.go
- resource_tool_email.go
- resource_tool_mac_server.go
- resource_tool_netwatch.go
- resource_tool_sniffer.go
- resource_user_manager_advanced.go
- resource_user_manager_attribute.go
- resource_user_manager_database.go
- resource_user_manager_limitation.go
- resource_user_manager_profile.go
- resource_user_manager_profile_limitation.go
- resource_user_manager_router.go
- resource_user_manager_settings.go
- resource_user_manager_user.go
- resource_user_manager_user_group.go
- resource_user_manager_user_profile.go
- resource_wifi.go
- resource_wifi_aaa.go
- resource_wifi_access_list.go
- resource_wifi_cap.go
- resource_wifi_capsman.go
- resource_wifi_channel.go
- resource_wifi_configuration.go
- resource_wifi_datapath.go
- resource_wifi_interworking.go
- resource_wifi_provisioning.go
- resource_wifi_security.go
- resource_wifi_security_multi_passphrase.go
- resource_wifi_steering.go
- resource_wireguard_keys.go
- resource_zerotier.go
- resource_zerotier_controller.go
- resource_zerotier_interface.go