Skip to content

Commit

Permalink
feat: Add suppport for missing customfield types
Browse files Browse the repository at this point in the history
  • Loading branch information
amhn authored and smutel committed Nov 10, 2022
1 parent dc4bc87 commit c770ce9
Show file tree
Hide file tree
Showing 26 changed files with 927 additions and 419 deletions.
418 changes: 374 additions & 44 deletions examples/main.tf

Large diffs are not rendered by default.

38 changes: 34 additions & 4 deletions examples/resources/netbox_ipam_aggregate/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ resource "netbox_ipam_aggregate" "aggregate_test" {

custom_field {
name = "cf_selection"
type = "selection"
type = "select"
value = "1"
}

Expand All @@ -45,8 +45,38 @@ resource "netbox_ipam_aggregate" "aggregate_test" {
}

custom_field {
name = "cf_multiple_selection"
type = "multiple"
value = "0,1"
name = "cf_multi_selection"
type = "multiselect"
value = jsonencode([
"0",
"1"
])
}

custom_field {
name = "cf_json"
type = "json"
value = jsonencode({
stringvalue = "string"
boolvalue = false
dictionary = {
numbervalue = 5
}
})
}

custom_field {
name = "cf_object"
type = "object"
value = 1
}

custom_field {
name = "cf_multi_object"
type = "multiobject"
value = jsonencode([
1,
2
])
}
}
38 changes: 34 additions & 4 deletions examples/resources/netbox_ipam_ip_addresses/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ resource "netbox_ipam_ip_addresses" "ip_test" {

custom_field {
name = "cf_selection"
type = "selection"
type = "select"
value = "1"
}

Expand All @@ -45,9 +45,39 @@ resource "netbox_ipam_ip_addresses" "ip_test" {
}

custom_field {
name = "cf_multiple_selection"
type = "multiple"
value = "0,1"
name = "cf_multi_selection"
type = "multiselect"
value = jsonencode([
"0",
"1"
])
}

custom_field {
name = "cf_json"
type = "json"
value = jsonencode({
stringvalue = "string"
boolvalue = false
dictionary = {
numbervalue = 5
}
})
}

custom_field {
name = "cf_object"
type = "object"
value = 1
}

custom_field {
name = "cf_multi_object"
type = "multiobject"
value = jsonencode([
1,
2
])
}
}

Expand Down
38 changes: 34 additions & 4 deletions examples/resources/netbox_ipam_ip_range/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ resource "netbox_ipam_ip_range" "range_test" {

custom_field {
name = "cf_selection"
type = "selection"
type = "select"
value = "1"
}

Expand All @@ -47,8 +47,38 @@ resource "netbox_ipam_ip_range" "range_test" {
}

custom_field {
name = "cf_multiple_selection"
type = "multiple"
value = "0,1"
name = "cf_multi_selection"
type = "multiselect"
value = jsonencode([
"0",
"1"
])
}

custom_field {
name = "cf_json"
type = "json"
value = jsonencode({
stringvalue = "string"
boolvalue = false
dictionary = {
numbervalue = 5
}
})
}

custom_field {
name = "cf_object"
type = "object"
value = 1
}

custom_field {
name = "cf_multi_object"
type = "multiobject"
value = jsonencode([
1,
2
])
}
}
38 changes: 34 additions & 4 deletions examples/resources/netbox_ipam_prefix/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ resource "netbox_ipam_prefix" "prefix_test" {

custom_field {
name = "cf_selection"
type = "selection"
type = "select"
value = "1"
}

Expand All @@ -48,9 +48,39 @@ resource "netbox_ipam_prefix" "prefix_test" {
}

custom_field {
name = "cf_multiple_selection"
type = "multiple"
value = "0,1"
name = "cf_multi_selection"
type = "multiselect"
value = jsonencode([
"0",
"1"
])
}

custom_field {
name = "cf_json"
type = "json"
value = jsonencode({
stringvalue = "string"
boolvalue = false
dictionary = {
numbervalue = 5
}
})
}

custom_field {
name = "cf_object"
type = "object"
value = 1
}

custom_field {
name = "cf_multi_object"
type = "multiobject"
value = jsonencode([
1,
2
])
}
}

Expand Down
38 changes: 34 additions & 4 deletions examples/resources/netbox_ipam_service/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ resource "netbox_ipam_service" "service_test" {

custom_field {
name = "cf_selection"
type = "selection"
type = "select"
value = "1"
}

Expand All @@ -48,8 +48,38 @@ resource "netbox_ipam_service" "service_test" {
}

custom_field {
name = "cf_multiple_selection"
type = "multiple"
value = "0,1"
name = "cf_multi_selection"
type = "multiselect"
value = jsonencode([
"0",
"1"
])
}

custom_field {
name = "cf_json"
type = "json"
value = jsonencode({
stringvalue = "string"
boolvalue = false
dictionary = {
numbervalue = 5
}
})
}

custom_field {
name = "cf_object"
type = "object"
value = 1
}

custom_field {
name = "cf_multi_object"
type = "multiobject"
value = jsonencode([
1,
2
])
}
}
38 changes: 34 additions & 4 deletions examples/resources/netbox_ipam_vlan/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ resource "netbox_ipam_vlan" "vlan_test" {

custom_field {
name = "cf_selection"
type = "selection"
type = "select"
value = "1"
}

Expand All @@ -49,8 +49,38 @@ resource "netbox_ipam_vlan" "vlan_test" {
}

custom_field {
name = "cf_multiple_selection"
type = "multiple"
value = "0,1"
name = "cf_multi_selection"
type = "multiselect"
value = jsonencode([
"0",
"1"
])
}

custom_field {
name = "cf_json"
type = "json"
value = jsonencode({
stringvalue = "string"
boolvalue = false
dictionary = {
numbervalue = 5
}
})
}

custom_field {
name = "cf_object"
type = "object"
value = 1
}

custom_field {
name = "cf_multi_object"
type = "multiobject"
value = jsonencode([
1,
2
])
}
}
38 changes: 34 additions & 4 deletions examples/resources/netbox_tenancy_contact/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ resource "netbox_tenancy_contact" "contact_test" {

custom_field {
name = "cf_selection"
type = "selection"
type = "select"
value = "1"
}

Expand All @@ -49,8 +49,38 @@ resource "netbox_tenancy_contact" "contact_test" {
}

custom_field {
name = "cf_multiple_selection"
type = "multiple"
value = "0,1"
name = "cf_multi_selection"
type = "multiselect"
value = jsonencode([
"0",
"1"
])
}

custom_field {
name = "cf_json"
type = "json"
value = jsonencode({
stringvalue = "string"
boolvalue = false
dictionary = {
numbervalue = 5
}
})
}

custom_field {
name = "cf_object"
type = "object"
value = 1
}

custom_field {
name = "cf_multi_object"
type = "multiobject"
value = jsonencode([
1,
2
])
}
}
Loading

0 comments on commit c770ce9

Please sign in to comment.