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

fix: Fix properties validation and some missing properties #337

Merged
merged 5 commits into from
Jan 16, 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
4 changes: 4 additions & 0 deletions routeros/resource_bgp_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ func ResourceRoutingBGPTemplate() *schema.Resource {
ValidateFunc: validation.IsIPv4Address,
},
KeyComment: PropCommentRw,
"default": {
Type: schema.TypeBool,
Computed: true,
},
KeyDisabled: PropDisabledRw,
// hold-time ( time[3s..1h] | infinity ; Default: 3m )
"hold_time": {
Expand Down
12 changes: 12 additions & 0 deletions routeros/resource_capsman_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"ca-certificate": "none",
"certificate": "none",
"enabled": "false",
"generated-ca-certificate":"CAPsMAN-CA-000000000000",
"generated-certificate":"CAPsMAN-000000000000",
"package-path": "",
"require-peer-certificate": "false",
"upgrade-policy": "none"
Expand Down Expand Up @@ -40,6 +42,16 @@ func ResourceCapsManManager() *schema.Resource {
Optional: true,
Description: "Disable or enable CAPsMAN functionality.",
},
"generated_ca_certificate": {
Type: schema.TypeString,
Computed: true,
Description: "Generated CA certificate.",
},
"generated_certificate": {
Type: schema.TypeString,
Computed: true,
Description: "Generated CAPsMAN certificate.",
},
"package_path": {
Type: schema.TypeString,
Optional: true,
Expand Down
7 changes: 7 additions & 0 deletions routeros/resource_interface_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ func ResourceInterfaceBridge() *schema.Resource {
RequiredWith: []string{"igmp_snooping"},
},
KeyName: PropNameForceNewRw,
"port_cost_mode": {
Type: schema.TypeString,
Optional: true,
Description: "An option that changes the port path cost and internal path cost mode for bridged ports, utilizing automatic values based on interface speed.",
ValidateFunc: validation.StringInSlice([]string{"long", "short"}, false),
DiffSuppressFunc: AlwaysPresentNotUserProvided,
},
"priority": {
Type: schema.TypeString,
Optional: true,
Expand Down
5 changes: 2 additions & 3 deletions routeros/resource_interface_ethernet.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ func ResourceInterfaceEthernet() *schema.Resource {
Advertised speed and duplex modes for Ethernet interfaces over twisted pair,
only applies when auto-negotiation is enabled. Advertising higher speeds than
the actual interface supported speed will have no effect, multiple options are allowed.`,
ValidateFunc: validation.StringInSlice([]string{
"10M-full", "10M-half", "100M-full", "100M-half",
"1000M-full", "1000M-half", "2500M-full", "5000M-full", "10000M-full"}, false),
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[0-9\.]+(M|G)-(full|half|base\w+(-\w+)?)$`),
"Since RouterOS v7.12 the values of this property have changed. Please check the documentation."),
DiffSuppressFunc: AlwaysPresentNotUserProvided,
},
KeyArp: PropArpRw,
Expand Down
2 changes: 1 addition & 1 deletion routeros/resource_user_manager_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func ResourceUserManagerRouter() *schema.Resource {
Type: schema.TypeString,
Required: true,
Description: "IP address of the RADIUS client.",
ValidateFunc: validation.IsIPAddress,
ValidateFunc: ValidationIpAddress,
},
"coa_port": {
Type: schema.TypeInt,
Expand Down
Loading