Skip to content

Commit

Permalink
Merge pull request #2 from Ujstor/clean-nonstatic-ds
Browse files Browse the repository at this point in the history
PropSkipFields
  • Loading branch information
danielnachtrub authored Aug 12, 2024
2 parents 07dc03e + 5999414 commit 99d5f05
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion routeros/datasource_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func DatasourceFiles() *schema.Resource {
Computed: true,
},
"size": {
Type: schema.TypeFloat,
Type: schema.TypeInt,
Computed: true,
},
"type": {
Expand Down
6 changes: 5 additions & 1 deletion routeros/datasource_interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ func DatasourceInterfaces() *schema.Resource {
Schema: map[string]*schema.Schema{
MetaResourcePath: PropResourcePath("/interface"),
MetaId: PropId(Id),

MetaSkipFields: PropSkipFields(
"fp_rx_byte", "fp_rx_packet", "fp_tx_byte", "fp_tx_packet", "link_downs",
"rx_byte", "rx_drop", "rx_error", "rx_packet", "tx_byte",
"tx_drop", "tx_error", "tx_packet", "tx_queue_drop",
),
KeyFilter: PropFilterRw,
"interfaces": {
Type: schema.TypeList,
Expand Down
4 changes: 4 additions & 0 deletions routeros/datasource_ip_firewall.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ func DatasourceIPFirewall() *schema.Resource {
- rules (aka filter)
`,
Schema: map[string]*schema.Schema{
MetaSkipFields: PropSkipFields(
"ingress_priority", "packets", "random",
),

"address_list": getIPFirewallAddrListSchema(),
"mangle": getIPFirewallMangleSchema(),
"nat": getIPFirewallNatSchema(),
Expand Down
2 changes: 1 addition & 1 deletion routeros/datasource_ip_firewall_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func getIPFirewallFilterSchema() *schema.Schema {
Computed: true,
},
"bytes": {
Type: schema.TypeFloat,
Type: schema.TypeInt,
Computed: true,
},
"chain": {
Expand Down
2 changes: 1 addition & 1 deletion routeros/datasource_ip_firewall_mangle.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func getIPFirewallMangleSchema() *schema.Schema {
Computed: true,
},
"bytes": {
Type: schema.TypeFloat,
Type: schema.TypeInt,
Computed: true,
},
"chain": {
Expand Down
2 changes: 1 addition & 1 deletion routeros/datasource_ip_firewall_nat.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func getIPFirewallNatSchema() *schema.Schema {
Computed: true,
},
"bytes": {
Type: schema.TypeFloat,
Type: schema.TypeInt,
Computed: true,
},
"chain": {
Expand Down
2 changes: 1 addition & 1 deletion routeros/datasource_ipv6_firewall_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func getIPv6FirewallFilterSchema() *schema.Schema {
Computed: true,
},
"bytes": {
Type: schema.TypeFloat,
Type: schema.TypeInt,
Computed: true,
},
"chain": {
Expand Down
8 changes: 6 additions & 2 deletions routeros/datasource_system_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ func DatasourceSystemResource() *schema.Resource {
resSchema := map[string]*schema.Schema{
MetaResourcePath: PropResourcePath("/system/resource"),
MetaId: PropId(Id),
MetaSkipFields: PropSkipFields(
"cpu_frequency", "cpu_load", "free_hdd_space", "free_memory",
"uptime", "write_sect_since_reboot", "write_sect_total",
),
"architecture_name": { // Sample = architecture-name: "x86_64"
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -39,11 +43,11 @@ func DatasourceSystemResource() *schema.Resource {
Computed: true,
},
"total_hdd_space": { // Sample = total-hdd-space: "93564928"
Type: schema.TypeFloat,
Type: schema.TypeInt,
Computed: true,
},
"total_memory": { // Sample = total-memory: "469762048"
Type: schema.TypeFloat,
Type: schema.TypeInt,
Computed: true,
},
"version": { // Sample = version: "7.10 (stable)"
Expand Down

0 comments on commit 99d5f05

Please sign in to comment.