Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing the resource schemas for ROS 7.15 #499

Merged
merged 4 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions examples/resources/routeros_snmp_community/resource.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
resource "routeros_snmp_community" "test" {
authentication_password = "authpasswd"
authentication_protocol = "MD5"
comment = "Comment"
disabled = true
encryption_password = "encpassword"
encryption_protocol = "DES"
name = "private"
read_access = true
security = "private"
write_access = true
authentication_password = "authpasswd"
authentication_protocol = "MD5"
comment = "Comment"
disabled = true
encryption_password = "encpassword"
encryption_protocol = "DES"
name = "private"
read_access = true
security = "private"
write_access = true
}

resource "routeros_snmp_community" "mything" {
addresses = ["10.0.1.12", "10.10.0.129"]
name = "mything"
}
8 changes: 8 additions & 0 deletions routeros/provider_schema_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ func PropName(description string) *schema.Schema {
Description: description,
}
}
func PropNameOptional(description string) *schema.Schema {
return &schema.Schema{
Type: schema.TypeString,
Optional: true,
Description: description,
DiffSuppressFunc: AlwaysPresentNotUserProvided,
}
}

// PropEnabled
func PropEnabled(description string) *schema.Schema {
Expand Down
1 change: 1 addition & 0 deletions routeros/resource_interface_wireguard_peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func ResourceInterfaceWireguardPeer() *schema.Resource {
Computed: true,
Description: "Time in seconds after the last successful handshake.",
},
KeyName: PropNameOptional("Name of the tunnel."),
"persistent_keepalive": {
Type: schema.TypeString,
Optional: true,
Expand Down
1 change: 1 addition & 0 deletions routeros/resource_ip_dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ func ResourceDns() *schema.Resource {
Optional: true,
Description: "List of DNS server IPv4/IPv6 addresses.",
},
KeyVrf: PropVrfRw,
"use_doh_server": {
Type: schema.TypeString,
Optional: true,
Expand Down
25 changes: 24 additions & 1 deletion routeros/resource_ip_neighbor_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
}
*/

// https://help.mikrotik.com/docs/display/ROS/MAC+server
// https://help.mikrotik.com/docs/display/ROS/Neighbor+discovery
func ResourceIpNeighborDiscoverySettings() *schema.Resource {
resSchema := map[string]*schema.Schema{
MetaResourcePath: PropResourcePath("/ip/neighbor/discovery-settings"),
Expand All @@ -26,6 +26,22 @@ func ResourceIpNeighborDiscoverySettings() *schema.Resource {
Description: "Interface list on which members the discovery protocol will run on.",
DiffSuppressFunc: AlwaysPresentNotUserProvided,
},
"lldp_mac_phy_config": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether to send MAC/PHY Configuration/Status TLV in LLDP, which indicates the interface " +
"capabilities, current setting of the duplex status, bit rate, and auto-negotiation. Only applies " +
"to the Ethernet interfaces. While TLV is optional in LLDP, it is mandatory when sending LLDP-MED, " +
"meaning this TLV will be included when necessary even though the property is configured as disabled.",
DiffSuppressFunc: AlwaysPresentNotUserProvided,
},
"lldp_max_frame_size": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether to send Maximum Frame Size TLV in LLDP, which indicates the maximum frame size capability" +
" of the interface in bytes (`l2mtu + 18`). Only applies to the Ethernet interfaces.",
DiffSuppressFunc: AlwaysPresentNotUserProvided,
},
"lldp_med_net_policy_vlan": {
Type: schema.TypeString,
Optional: true,
Expand All @@ -44,6 +60,13 @@ func ResourceIpNeighborDiscoverySettings() *schema.Resource {
avoid LLDP-MED misconfiguration.`,
DiffSuppressFunc: AlwaysPresentNotUserProvided,
},
"lldp_poe_power": {
Type: schema.TypeBool,
Optional: true,
Description: "Two specific TLVs facilitate Power over Ethernet (PoE) management between Power Sourcing " +
"Equipment (PSE) and Powered Devices (PD).",
DiffSuppressFunc: AlwaysPresentNotUserProvided,
},
"mode": {
Type: schema.TypeString,
Optional: true,
Expand Down