Documentation ¶
Index ¶
- Constants
- Variables
- func BoolFromMikrotikJSON(s string) bool
- func BoolToMikrotikJSON(b bool) string
- func ColorizedDebug(ctx context.Context, msg string, args ...map[string]interface{})
- func DatasourceFirewall() *schema.Resource
- func DatasourceIPAddresses() *schema.Resource
- func DatasourceIPRoutes() *schema.Resource
- func DatasourceIPv6Addresses() *schema.Resource
- func DatasourceInterfaces() *schema.Resource
- func DefaultCreate(s map[string]*schema.Schema) 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 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 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 PropId(t IdType) *schema.Schema
- func PropMtuRw() *schema.Schema
- func PropName(description string) *schema.Schema
- func PropResourcePath(p 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 ResourceCapsManChannel() *schema.Resource
- func ResourceCapsManConfiguration() *schema.Resource
- func ResourceCapsManDatapath() *schema.Resource
- func ResourceCapsManManager() *schema.Resource
- func ResourceCapsManManagerInterface() *schema.Resource
- func ResourceCapsManProvisioning() *schema.Resource
- func ResourceCapsManRates() *schema.Resource
- func ResourceCapsManSecurity() *schema.Resource
- func ResourceCreate(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 ResourceDhcpServer() *schema.Resource
- func ResourceDhcpServerLease() *schema.Resource
- func ResourceDhcpServerNetwork() *schema.Resource
- func ResourceDns() *schema.Resource
- func ResourceDnsRecord() *schema.Resource
- func ResourceIPAddress() *schema.Resource
- func ResourceIPFirewallAddrList() *schema.Resource
- func ResourceIPFirewallFilter() *schema.Resource
- func ResourceIPFirewallMangle() *schema.Resource
- func ResourceIPFirewallNat() *schema.Resource
- func ResourceIPPool() *schema.Resource
- func ResourceIPRoute() *schema.Resource
- func ResourceIPv6Address() *schema.Resource
- func ResourceIPv6FirewallFilter() *schema.Resource
- func ResourceIPv6Route() *schema.Resource
- func ResourceInterfaceBridge() *schema.Resource
- func ResourceInterfaceBridgePort() *schema.Resource
- func ResourceInterfaceBridgeVlan() *schema.Resource
- func ResourceInterfaceGre() *schema.Resource
- func ResourceInterfaceList() *schema.Resource
- func ResourceInterfaceListMember() *schema.Resource
- func ResourceInterfaceOpenVPNServer() *schema.Resource
- func ResourceInterfaceVlan() *schema.Resource
- func ResourceInterfaceVrrp() *schema.Resource
- func ResourceInterfaceWireguard() *schema.Resource
- func ResourceInterfaceWireguardPeer() *schema.Resource
- func ResourceIpService() *schema.Resource
- func ResourceOpenVPNServer() *schema.Resource
- func ResourcePPPProfile() *schema.Resource
- func ResourcePPPSecret() *schema.Resource
- func ResourceRead(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, ...) diag.Diagnostics
- func ResourceRoutingTable() *schema.Resource
- func ResourceSystemCertificate() *schema.Resource
- func ResourceSystemIdentity() *schema.Resource
- func ResourceSystemScheduler() *schema.Resource
- func ResourceUpdate(ctx context.Context, s map[string]*schema.Schema, d *schema.ResourceData, ...) diag.Diagnostics
- func ResourceUser() *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 IdType
- type ItemId
- type MikrotikItem
- type MikrotikItemMetadata
- type RestClient
- type TransportType
- type URL
Constants ¶
const ( MetaId = "id" MetaResourcePath = "path" MetaTransformSet = "ts" MetaSkipFields = "skip" )
All metadata fields must be present in each resource schema, and the field type must be string.
const ( KeyActualMtu = "actual_mtu" KeyArp = "arp" KeyArpTimeout = "arp_timeout" KeyComment = "comment" KeyDynamic = "dynamic" KeyDisabled = "disabled" KeyFilter = "filter" KeyInterface = "interface" KeyInvalid = "invalid" KeyL2Mtu = "l2mtu" KeyMtu = "mtu" KeyName = "name" KeyPlaceBefore = "place_before" KeyRunning = "running" )
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, } PropArpRw = &schema.Schema{ Type: schema.TypeString, Optional: true, Default: "enabled", Description: "ARP resolution protocol mode.", ValidateFunc: validation.StringInSlice([]string{"disabled", "enabled", "local-proxy-arp", "proxy-arp", "reply-only"}, false), } PropArpTimeoutRw = &schema.Schema{ Type: schema.TypeString, Optional: true, Default: "auto", 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"), } PropCommentRw = &schema.Schema{ Type: schema.TypeString, Optional: true, } PropDisabledRw = &schema.Schema{ Type: schema.TypeBool, Optional: true, } 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.", } PropInterfaceRw = &schema.Schema{ Type: schema.TypeString, Required: true, Description: "Name of the interface.", } PropInvalidRo = &schema.Schema{ Type: schema.TypeBool, Computed: true, } PropL2MtuRo = &schema.Schema{ Type: schema.TypeInt, Computed: true, Description: "Layer2 Maximum transmission unit.", } 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/firewall.md#example-usage). `, } PropRunningRo = &schema.Schema{ Type: schema.TypeBool, Computed: true, } )
Schema properties.
var ( ValidationTime = validation.StringMatch(regexp.MustCompile(`^(\d+([smhdw]|ms)?)+$`), "value should be an integer or a time interval: 0..4294967295 (seconds) or 500ms, 2d, 1w") 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", ) // 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(v interface{}, path cty.Path) (diags diag.Diagnostics) { val, ok := v.(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)", val, val), }) return } if mikrotikNegative { for _, v := range valid { valid = append(valid, "!"+v) } } for _, sValue := range strings.Split(val, ",") { ok := false sValue = strings.TrimSpace(sValue) for _, sValid := range 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 } } )
Properties validation.
var ( TimeEquall = func(k, old, new string, d *schema.ResourceData) bool { if old == new { return true } if old == "" || new == "" { return false } 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 == new { return true } if old == "" || new == "" { return false } // 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 } )
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 BoolToMikrotikJSON ¶
func ColorizedDebug ¶
ColorizedDebug Used to display provider log color messages. Please set the environment variable
func DatasourceFirewall ¶
func DatasourceIPAddresses ¶
func DatasourceIPRoutes ¶
func DatasourceIPv6Addresses ¶
func DatasourceInterfaces ¶
func DefaultCreate ¶
func DefaultCreate(s map[string]*schema.Schema) schema.CreateContextFunc
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 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 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 PropResourcePath ¶
PropResourcePath Resource path property.
func ReadItemsFiltered ¶
func ReadItemsFiltered(filter []string, resourcePath string, c Client) (*[]MikrotikItem, error)
func ResourceCapsManAaa ¶
func ResourceCapsManChannel ¶
func ResourceCapsManDatapath ¶
func ResourceCapsManManager ¶
func ResourceCapsManRates ¶
func ResourceCapsManSecurity ¶
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.
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 ResourceDhcpServer ¶
ResourceDhcpServer https://help.mikrotik.com/docs/display/ROS/DHCP#DHCP-Leases
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 ResourceDns ¶
ResourceDns https://wiki.mikrotik.com/wiki/Manual:IP/DNS
func ResourceDnsRecord ¶
ResourceDnsRecord https://wiki.mikrotik.com/wiki/Manual:IP/DNS https://help.mikrotik.com/docs/display/ROS/DNS
func ResourceIPAddress ¶
ResourceIPAddress https://wiki.mikrotik.com/wiki/Manual:IP/Address
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://wiki.mikrotik.com/wiki/Manual:IP/Firewall/NAT
func ResourceIPPool ¶
ResourceIPPool https://help.mikrotik.com/docs/display/ROS/IP+Pools
func ResourceIPRoute ¶
ResourceIPRoute https://wiki.mikrotik.com/wiki/Manual:IP/Route
func ResourceIPv6Address ¶
ResourceIPv6Address https://wiki.mikrotik.com/wiki/Manual:IPv6/Address
func ResourceIPv6FirewallFilter ¶
ResourceIPv6FirewallFilter https://help.mikrotik.com/docs/display/ROS/Filter#Filter-Properties.1
func ResourceIPv6Route ¶
ResourceIPv6Route https://help.mikrotik.com/docs/display/ROS/IP+Routing
func ResourceInterfaceBridge ¶
ResourceInterfaceBridge https://wiki.mikrotik.com/wiki/Manual:Interface/Bridge
func ResourceInterfaceBridgePort ¶
ResourceInterfaceBridgePort https://wiki.mikrotik.com/wiki/Manual:Interface/Bridge#Port_Settings
func ResourceInterfaceBridgeVlan ¶
ResourceInterfaceBridgeVlan https://wiki.mikrotik.com/wiki/Manual:Interface/Bridge#Bridge_VLAN_Filtering
func ResourceInterfaceGre ¶
ResourceInterfaceGre https://wiki.mikrotik.com/wiki/Manual:Interface/Gre
func ResourceInterfaceList ¶
func ResourceInterfaceVlan ¶
ResourceInterfaceVlan https://wiki.mikrotik.com/wiki/Manual:Interface/VLAN
func ResourceInterfaceVrrp ¶
ResourceInterfaceVrrp https://help.mikrotik.com/docs/display/ROS/VRRP
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 ResourceIpService ¶
func ResourceOpenVPNServer ¶
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 ResourceRoutingTable ¶
func ResourceSystemCertificate ¶
https://help.mikrotik.com/docs/display/ROS/ https://wiki.mikrotik.com/wiki/Manual:System/Certificates
func ResourceSystemIdentity ¶
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 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 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) 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 { GetTransport() TransportType SendRequest(method crudMethod, url *URL, item MikrotikItem, result interface{}) error }
type DataValidateFunc ¶
type DataValidateFunc func(d *schema.ResourceData) diag.Diagnostics
type MikrotikItem ¶
MikrotikItem Contains only data.
func CreateItem ¶
func CreateItem(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) 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_firewall.go
- datasource_firewall_addr_list.go
- datasource_firewall_filter.go
- datasource_firewall_mangle.go
- datasource_firewall_nat.go
- datasource_interfaces.go
- datasource_ip_addresses.go
- datasource_ip_routes.go
- datasource_ipv6_addresses.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_schema_helpers.go
- resource_capsman_channel.go
- resource_capsman_configuration.go
- resource_capsman_datapath.go
- resource_capsman_manager.go
- resource_capsman_provisioning.go
- resource_capsman_rates.go
- resource_capsman_security.go
- resource_default_actions.go
- resource_interface_bridge.go
- resource_interface_bridge_port.go
- resource_interface_bridge_vlan.go
- resource_interface_gre.go
- resource_interface_list.go
- resource_interface_list_member.go
- resource_interface_ovpn_server.go
- resource_interface_vlan.go
- resource_interface_vrrp.go
- resource_interface_wireguard.go
- resource_interface_wireguard_peer.go
- resource_ip_address.go
- resource_ip_dhcp_client.go
- resource_ip_dhcp_server.go
- resource_ip_dhcp_server_lease.go
- resource_ip_dhcp_server_network.go
- resource_ip_dns.go
- resource_ip_dns_record.go
- resource_ip_firewall_addr_list.go
- resource_ip_firewall_filter.go
- resource_ip_firewall_mangle.go
- resource_ip_firewall_nat.go
- resource_ip_pool.go
- resource_ip_route.go
- resource_ip_service.go
- resource_ipv6_address.go
- resource_ipv6_firewall_filter.go
- resource_ipv6_route.go
- resource_ovpn_server.go
- resource_ppp_profile.go
- resource_ppp_secret.go
- resource_routing_table.go
- resource_system_certificate.go
- resource_system_identity.go
- resource_system_scheduler.go
- resource_system_user.go