From b2c5fa15e70ca205dd1da66f814338d4ae8d4068 Mon Sep 17 00:00:00 2001 From: Fabian Breckle Date: Mon, 10 Jul 2023 12:02:48 +0200 Subject: [PATCH] chore: Make docs and fmt --- docs/resources/virtual_machine.md | 6 +++++- netbox/data_source_netbox_ip_addresses.go | 2 +- netbox/resource_netbox_virtual_machine.go | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/resources/virtual_machine.md b/docs/resources/virtual_machine.md index aa6225e4..a2b90b9b 100644 --- a/docs/resources/virtual_machine.md +++ b/docs/resources/virtual_machine.md @@ -55,6 +55,10 @@ resource "netbox_virtual_machine" "full_vm" { vcpus = "2" role_id = 31 // This corresponds to the Netbox ID for a given role tenant_id = data.netbox_tenant.customer_a.id + local_context_data = jsonencode({ + "setting_a" = "Some Setting" + "setting_b" = 42 + }) } ``` @@ -72,6 +76,7 @@ resource "netbox_virtual_machine" "full_vm" { - `custom_fields` (Map of String) - `device_id` (Number) - `disk_size_gb` (Number) +- `local_context_data` (String) This is best managed through the use of `jsonencode` and a map of settings. - `memory_mb` (Number) - `platform_id` (Number) - `role_id` (Number) @@ -80,7 +85,6 @@ resource "netbox_virtual_machine" "full_vm" { - `tags` (Set of String) - `tenant_id` (Number) - `vcpus` (Number) -- `local_context_data` (String) This is best managed through the use of `jsonencode` and a map of settings. ### Read-Only diff --git a/netbox/data_source_netbox_ip_addresses.go b/netbox/data_source_netbox_ip_addresses.go index dad9ac17..2f26e5f9 100644 --- a/netbox/data_source_netbox_ip_addresses.go +++ b/netbox/data_source_netbox_ip_addresses.go @@ -196,7 +196,7 @@ func dataSourceNetboxIpAddressesRead(d *schema.ResourceData, m interface{}) erro mapping["dns_name"] = v.DNSName mapping["tenant"] = flattenTenant(v.Tenant) var stags []map[string]interface{} - for _,t := range v.Tags { + for _, t := range v.Tags { var tagmapping = make(map[string]interface{}) tagmapping["name"] = t.Name tagmapping["display"] = t.Display diff --git a/netbox/resource_netbox_virtual_machine.go b/netbox/resource_netbox_virtual_machine.go index a432e15e..9b2e7ab5 100644 --- a/netbox/resource_netbox_virtual_machine.go +++ b/netbox/resource_netbox_virtual_machine.go @@ -88,8 +88,9 @@ func resourceNetboxVirtualMachine() *schema.Resource { Computed: true, }, "local_context_data": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Optional: true, + Description: "This is best managed through the use of `jsonencode` and a map of settings.", }, customFieldsKey: customFieldsSchema, },