Skip to content

Commit

Permalink
feat: Add filter to JSON data sources
Browse files Browse the repository at this point in the history
  • Loading branch information
smutel committed Jan 31, 2023
1 parent 5116cf8 commit 345f1ad
Show file tree
Hide file tree
Showing 97 changed files with 3,680 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "netbox_json_dcim_cable_terminations_list" "test" {
limit = 0
}

output "example" {
value = jsondecode(data.netbox_json_dcim_cable_terminations_list.test.json)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "netbox_json_ipam_l2vpn_terminations_list" "test" {
limit = 0
}

output "example" {
value = jsondecode(data.netbox_json_ipam_l2vpn_terminations_list.test.json)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
data "netbox_json_ipam_l2vpns_list" "test" {
limit = 0
}

output "example" {
value = jsondecode(data.netbox_json_ipam_l2vpns_list.test.json)
}
9 changes: 9 additions & 0 deletions netbox/internal/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"regexp"
"strings"
"unicode"

"github.com/go-openapi/strfmt"
"github.com/smutel/go-netbox/v3/netbox/models"
Expand Down Expand Up @@ -87,3 +88,11 @@ func ToListofStrings(in []interface{}) []string {
func TrimString(val interface{}) string {
return strings.TrimSpace(val.(string))
}

func FieldNameToStructName(k string) string {
r := []rune(k)
r[0] = unicode.ToUpper(r[0])
k = string(r)
k = strings.Replace(k, "_", "", -1)
return k
}
37 changes: 37 additions & 0 deletions netbox/json/data_netbox_json_circuits_circuit_terminations_list.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions netbox/json/data_netbox_json_circuits_circuit_types_list.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions netbox/json/data_netbox_json_circuits_circuits_list.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions netbox/json/data_netbox_json_circuits_provider_networks_list.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions netbox/json/data_netbox_json_circuits_providers_list.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 345f1ad

Please sign in to comment.