diff --git a/.golangci.yml b/.golangci.yml index 90f759af7..9e387a076 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -279,7 +279,7 @@ linters: #fast: false -#issues: +issues: # List of regexps of issue texts to exclude, empty list by default. # But independently from this option we use default exclude patterns, # it can be disabled by `exclude-use-default: false`. To list all @@ -288,7 +288,7 @@ linters: # - abcdef # Excluding configuration per-path, per-linter, per-text and per-source - #exclude-rules: + exclude-rules: # Exclude some linters from running on tests files. #- path: _test\.go # linters: @@ -310,8 +310,9 @@ linters: # text: "SA9003:" # Exclude lll issues for long lines with go:generate - #- linters: - # - lll + - linters: + - errcheck + text: "Error return value of `d.Set` is not checked" # source: "^//go:generate " # Independently from option `exclude` we use default exclude patterns, diff --git a/README.md b/README.md index 3c5c657e5..f9ed6c561 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ Terraform provider for [Netbox.](https://netbox.readthedocs.io/en/stable/) ## Requirements -* General developper tools like make, bash, ... +* A libc library like libc6-compat or libc-utils +* General developer tools like make, bash, ... (to build the provider) * Go 1.15 minimum (to build the provider) * Terraform (to use the provider) @@ -61,7 +62,7 @@ terraform { You can install the provider manually in your global terraform provider folder. -```sh +```bash $ export NETBOX_PROVIDER_VERSION=1.0.0 $ mkdir -p ~/.terraform.d/plugins/registry.terraform.io/smutel/netbox/${NETBOX_PROVIDER_VERSION}/linux_amd64 $ cp terraform-provider-netbox_v${NETBOX_PROVIDER_VERSION} ~/.terraform.d/plugins/registry.terraform.io/smutel/netbox/${NETBOX_PROVIDER_VERSION}/linux_amd64/terraform-provider-netbox_v${NETBOX_PROVIDER_VERSION} @@ -121,3 +122,6 @@ $ terraform init & terraform apply * *Closed* - [Issue 85 in project go-netbox](https://github.com/netbox-community/go-netbox/issues/85) * *Closed* - [Issue 54 in project go-netbox](https://github.com/netbox-community/go-netbox/issues/54) * *Open* - [Issue 115 in project go-netbox](https://github.com/netbox-community/go-netbox/issues/115) +* *Closed* - [Issue 100 in project go-netbox](https://github.com/netbox-community/go-netbox/issues/100) + - json: cannot unmarshal number into Go struct field \.results.connected_endpoint of type string + - Currently causes issues for Circuits/CircuitTerminations, DCIM/Cables, DCIM/Interfaces, and Extras/ObjectChanges diff --git a/docs/data-sources/json_circuits_circuit_terminations_list.md b/docs/data-sources/json_circuits_circuit_terminations_list.md new file mode 100644 index 000000000..9de0d0de6 --- /dev/null +++ b/docs/data-sources/json_circuits_circuit_terminations_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_circuits\_circuit\_terminations\_list Data Source + +Get json output from the circuits_circuit_terminations_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_circuits_circuit_terminations_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_circuits_circuit_terminations_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_circuits_circuit_types_list.md b/docs/data-sources/json_circuits_circuit_types_list.md new file mode 100644 index 000000000..64c8eee88 --- /dev/null +++ b/docs/data-sources/json_circuits_circuit_types_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_circuits\_circuit\_types\_list Data Source + +Get json output from the circuits_circuit_types_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_circuits_circuit_types_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_circuits_circuit_types_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_circuits_circuits_list.md b/docs/data-sources/json_circuits_circuits_list.md new file mode 100644 index 000000000..875ea7856 --- /dev/null +++ b/docs/data-sources/json_circuits_circuits_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_circuits\_circuits\_list Data Source + +Get json output from the circuits_circuits_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_circuits_circuits_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_circuits_circuits_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_circuits_providers_list.md b/docs/data-sources/json_circuits_providers_list.md new file mode 100644 index 000000000..50ddfc157 --- /dev/null +++ b/docs/data-sources/json_circuits_providers_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_circuits\_providers\_list Data Source + +Get json output from the circuits_providers_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_circuits_providers_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_circuits_providers_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_cables_list.md b/docs/data-sources/json_dcim_cables_list.md new file mode 100644 index 000000000..1a82133cd --- /dev/null +++ b/docs/data-sources/json_dcim_cables_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_cables\_list Data Source + +Get json output from the dcim_cables_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_cables_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_cables_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_console_connections_list.md b/docs/data-sources/json_dcim_console_connections_list.md new file mode 100644 index 000000000..b11547e22 --- /dev/null +++ b/docs/data-sources/json_dcim_console_connections_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_console\_connections\_list Data Source + +Get json output from the dcim_console_connections_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_console_connections_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_console_connections_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_console_port_templates_list.md b/docs/data-sources/json_dcim_console_port_templates_list.md new file mode 100644 index 000000000..c4263cb53 --- /dev/null +++ b/docs/data-sources/json_dcim_console_port_templates_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_console\_port\_templates\_list Data Source + +Get json output from the dcim_console_port_templates_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_console_port_templates_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_console_port_templates_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_console_ports_list.md b/docs/data-sources/json_dcim_console_ports_list.md new file mode 100644 index 000000000..135f12454 --- /dev/null +++ b/docs/data-sources/json_dcim_console_ports_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_console\_ports\_list Data Source + +Get json output from the dcim_console_ports_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_console_ports_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_console_ports_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_console_server_port_templates_list.md b/docs/data-sources/json_dcim_console_server_port_templates_list.md new file mode 100644 index 000000000..23aef11f6 --- /dev/null +++ b/docs/data-sources/json_dcim_console_server_port_templates_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_console\_server\_port\_templates\_list Data Source + +Get json output from the dcim_console_server_port_templates_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_console_server_port_templates_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_console_server_port_templates_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_console_server_ports_list.md b/docs/data-sources/json_dcim_console_server_ports_list.md new file mode 100644 index 000000000..082aa6c8d --- /dev/null +++ b/docs/data-sources/json_dcim_console_server_ports_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_console\_server\_ports\_list Data Source + +Get json output from the dcim_console_server_ports_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_console_server_ports_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_console_server_ports_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_device_bay_templates_list.md b/docs/data-sources/json_dcim_device_bay_templates_list.md new file mode 100644 index 000000000..dfc5b8feb --- /dev/null +++ b/docs/data-sources/json_dcim_device_bay_templates_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_device\_bay\_templates\_list Data Source + +Get json output from the dcim_device_bay_templates_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_device_bay_templates_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_device_bay_templates_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_device_bays_list.md b/docs/data-sources/json_dcim_device_bays_list.md new file mode 100644 index 000000000..2b2dbd54a --- /dev/null +++ b/docs/data-sources/json_dcim_device_bays_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_device\_bays\_list Data Source + +Get json output from the dcim_device_bays_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_device_bays_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_device_bays_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_device_roles_list.md b/docs/data-sources/json_dcim_device_roles_list.md new file mode 100644 index 000000000..d6e99850b --- /dev/null +++ b/docs/data-sources/json_dcim_device_roles_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_device\_roles\_list Data Source + +Get json output from the dcim_device_roles_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_device_roles_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_device_roles_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_device_types_list.md b/docs/data-sources/json_dcim_device_types_list.md new file mode 100644 index 000000000..3bcba5310 --- /dev/null +++ b/docs/data-sources/json_dcim_device_types_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_device\_types\_list Data Source + +Get json output from the dcim_device_types_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_device_types_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_device_types_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_devices_list.md b/docs/data-sources/json_dcim_devices_list.md new file mode 100644 index 000000000..0dd3ff100 --- /dev/null +++ b/docs/data-sources/json_dcim_devices_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_devices\_list Data Source + +Get json output from the dcim_devices_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_devices_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_devices_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_front_port_templates_list.md b/docs/data-sources/json_dcim_front_port_templates_list.md new file mode 100644 index 000000000..0007815b6 --- /dev/null +++ b/docs/data-sources/json_dcim_front_port_templates_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_front\_port\_templates\_list Data Source + +Get json output from the dcim_front_port_templates_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_front_port_templates_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_front_port_templates_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_front_ports_list.md b/docs/data-sources/json_dcim_front_ports_list.md new file mode 100644 index 000000000..21cd62796 --- /dev/null +++ b/docs/data-sources/json_dcim_front_ports_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_front\_ports\_list Data Source + +Get json output from the dcim_front_ports_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_front_ports_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_front_ports_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_interface_connections_list.md b/docs/data-sources/json_dcim_interface_connections_list.md new file mode 100644 index 000000000..6ff2530de --- /dev/null +++ b/docs/data-sources/json_dcim_interface_connections_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_interface\_connections\_list Data Source + +Get json output from the dcim_interface_connections_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_interface_connections_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_interface_connections_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_interface_templates_list.md b/docs/data-sources/json_dcim_interface_templates_list.md new file mode 100644 index 000000000..8fa1baec0 --- /dev/null +++ b/docs/data-sources/json_dcim_interface_templates_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_interface\_templates\_list Data Source + +Get json output from the dcim_interface_templates_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_interface_templates_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_interface_templates_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_interfaces_list.md b/docs/data-sources/json_dcim_interfaces_list.md new file mode 100644 index 000000000..9766a953a --- /dev/null +++ b/docs/data-sources/json_dcim_interfaces_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_interfaces\_list Data Source + +Get json output from the dcim_interfaces_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_interfaces_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_interfaces_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_inventory_items_list.md b/docs/data-sources/json_dcim_inventory_items_list.md new file mode 100644 index 000000000..2c2870eb4 --- /dev/null +++ b/docs/data-sources/json_dcim_inventory_items_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_inventory\_items\_list Data Source + +Get json output from the dcim_inventory_items_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_inventory_items_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_inventory_items_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_manufacturers_list.md b/docs/data-sources/json_dcim_manufacturers_list.md new file mode 100644 index 000000000..9966fd679 --- /dev/null +++ b/docs/data-sources/json_dcim_manufacturers_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_manufacturers\_list Data Source + +Get json output from the dcim_manufacturers_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_manufacturers_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_manufacturers_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_platforms_list.md b/docs/data-sources/json_dcim_platforms_list.md new file mode 100644 index 000000000..dec8064f1 --- /dev/null +++ b/docs/data-sources/json_dcim_platforms_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_platforms\_list Data Source + +Get json output from the dcim_platforms_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_platforms_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_platforms_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_power_connections_list.md b/docs/data-sources/json_dcim_power_connections_list.md new file mode 100644 index 000000000..a7955ae9c --- /dev/null +++ b/docs/data-sources/json_dcim_power_connections_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_power\_connections\_list Data Source + +Get json output from the dcim_power_connections_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_power_connections_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_power_connections_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_power_feeds_list.md b/docs/data-sources/json_dcim_power_feeds_list.md new file mode 100644 index 000000000..c6ccb735e --- /dev/null +++ b/docs/data-sources/json_dcim_power_feeds_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_power\_feeds\_list Data Source + +Get json output from the dcim_power_feeds_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_power_feeds_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_power_feeds_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_power_outlet_templates_list.md b/docs/data-sources/json_dcim_power_outlet_templates_list.md new file mode 100644 index 000000000..6a866086d --- /dev/null +++ b/docs/data-sources/json_dcim_power_outlet_templates_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_power\_outlet\_templates\_list Data Source + +Get json output from the dcim_power_outlet_templates_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_power_outlet_templates_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_power_outlet_templates_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_power_outlets_list.md b/docs/data-sources/json_dcim_power_outlets_list.md new file mode 100644 index 000000000..171defa86 --- /dev/null +++ b/docs/data-sources/json_dcim_power_outlets_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_power\_outlets\_list Data Source + +Get json output from the dcim_power_outlets_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_power_outlets_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_power_outlets_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_power_panels_list.md b/docs/data-sources/json_dcim_power_panels_list.md new file mode 100644 index 000000000..2fac640ae --- /dev/null +++ b/docs/data-sources/json_dcim_power_panels_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_power\_panels\_list Data Source + +Get json output from the dcim_power_panels_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_power_panels_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_power_panels_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_power_port_templates_list.md b/docs/data-sources/json_dcim_power_port_templates_list.md new file mode 100644 index 000000000..862310f22 --- /dev/null +++ b/docs/data-sources/json_dcim_power_port_templates_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_power\_port\_templates\_list Data Source + +Get json output from the dcim_power_port_templates_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_power_port_templates_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_power_port_templates_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_power_ports_list.md b/docs/data-sources/json_dcim_power_ports_list.md new file mode 100644 index 000000000..73320b3da --- /dev/null +++ b/docs/data-sources/json_dcim_power_ports_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_power\_ports\_list Data Source + +Get json output from the dcim_power_ports_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_power_ports_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_power_ports_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_rack_groups_list.md b/docs/data-sources/json_dcim_rack_groups_list.md new file mode 100644 index 000000000..acad80fd6 --- /dev/null +++ b/docs/data-sources/json_dcim_rack_groups_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_rack\_groups\_list Data Source + +Get json output from the dcim_rack_groups_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_rack_groups_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_rack_groups_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_rack_reservations_list.md b/docs/data-sources/json_dcim_rack_reservations_list.md new file mode 100644 index 000000000..34b6d8d8d --- /dev/null +++ b/docs/data-sources/json_dcim_rack_reservations_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_rack\_reservations\_list Data Source + +Get json output from the dcim_rack_reservations_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_rack_reservations_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_rack_reservations_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_rack_roles_list.md b/docs/data-sources/json_dcim_rack_roles_list.md new file mode 100644 index 000000000..bfd010298 --- /dev/null +++ b/docs/data-sources/json_dcim_rack_roles_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_rack\_roles\_list Data Source + +Get json output from the dcim_rack_roles_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_rack_roles_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_rack_roles_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_racks_list.md b/docs/data-sources/json_dcim_racks_list.md new file mode 100644 index 000000000..96d227dae --- /dev/null +++ b/docs/data-sources/json_dcim_racks_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_racks\_list Data Source + +Get json output from the dcim_racks_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_racks_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_racks_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_rear_port_templates_list.md b/docs/data-sources/json_dcim_rear_port_templates_list.md new file mode 100644 index 000000000..cd7aa1e69 --- /dev/null +++ b/docs/data-sources/json_dcim_rear_port_templates_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_rear\_port\_templates\_list Data Source + +Get json output from the dcim_rear_port_templates_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_rear_port_templates_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_rear_port_templates_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_rear_ports_list.md b/docs/data-sources/json_dcim_rear_ports_list.md new file mode 100644 index 000000000..6f86210c5 --- /dev/null +++ b/docs/data-sources/json_dcim_rear_ports_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_rear\_ports\_list Data Source + +Get json output from the dcim_rear_ports_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_rear_ports_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_rear_ports_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_regions_list.md b/docs/data-sources/json_dcim_regions_list.md new file mode 100644 index 000000000..de18facf1 --- /dev/null +++ b/docs/data-sources/json_dcim_regions_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_regions\_list Data Source + +Get json output from the dcim_regions_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_regions_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_regions_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_sites_list.md b/docs/data-sources/json_dcim_sites_list.md new file mode 100644 index 000000000..3d413a8be --- /dev/null +++ b/docs/data-sources/json_dcim_sites_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_sites\_list Data Source + +Get json output from the dcim_sites_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_sites_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_sites_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_dcim_virtual_chassis_list.md b/docs/data-sources/json_dcim_virtual_chassis_list.md new file mode 100644 index 000000000..f6f952b85 --- /dev/null +++ b/docs/data-sources/json_dcim_virtual_chassis_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_dcim\_virtual\_chassis\_list Data Source + +Get json output from the dcim_virtual_chassis_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_dcim_virtual_chassis_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_dcim_virtual_chassis_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_extras_config_contexts_list.md b/docs/data-sources/json_extras_config_contexts_list.md new file mode 100644 index 000000000..eb5be9528 --- /dev/null +++ b/docs/data-sources/json_extras_config_contexts_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_extras\_config\_contexts\_list Data Source + +Get json output from the extras_config_contexts_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_extras_config_contexts_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_extras_config_contexts_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_extras_export_templates_list.md b/docs/data-sources/json_extras_export_templates_list.md new file mode 100644 index 000000000..c04a275d6 --- /dev/null +++ b/docs/data-sources/json_extras_export_templates_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_extras\_export\_templates\_list Data Source + +Get json output from the extras_export_templates_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_extras_export_templates_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_extras_export_templates_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_extras_graphs_list.md b/docs/data-sources/json_extras_graphs_list.md new file mode 100644 index 000000000..cf382235b --- /dev/null +++ b/docs/data-sources/json_extras_graphs_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_extras\_graphs\_list Data Source + +Get json output from the extras_graphs_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_extras_graphs_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_extras_graphs_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_extras_image_attachments_list.md b/docs/data-sources/json_extras_image_attachments_list.md new file mode 100644 index 000000000..d5e78143d --- /dev/null +++ b/docs/data-sources/json_extras_image_attachments_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_extras\_image\_attachments\_list Data Source + +Get json output from the extras_image_attachments_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_extras_image_attachments_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_extras_image_attachments_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_extras_job_results_list.md b/docs/data-sources/json_extras_job_results_list.md new file mode 100644 index 000000000..618025e49 --- /dev/null +++ b/docs/data-sources/json_extras_job_results_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_extras\_job\_results\_list Data Source + +Get json output from the extras_job_results_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_extras_job_results_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_extras_job_results_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_extras_object_changes_list.md b/docs/data-sources/json_extras_object_changes_list.md new file mode 100644 index 000000000..f46eb2b49 --- /dev/null +++ b/docs/data-sources/json_extras_object_changes_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_extras\_object\_changes\_list Data Source + +Get json output from the extras_object_changes_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_extras_object_changes_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_extras_object_changes_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_extras_tags_list.md b/docs/data-sources/json_extras_tags_list.md new file mode 100644 index 000000000..2af8a3033 --- /dev/null +++ b/docs/data-sources/json_extras_tags_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_extras\_tags\_list Data Source + +Get json output from the extras_tags_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_extras_tags_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_extras_tags_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_ipam_aggregates_list.md b/docs/data-sources/json_ipam_aggregates_list.md new file mode 100644 index 000000000..b7eca252e --- /dev/null +++ b/docs/data-sources/json_ipam_aggregates_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_ipam\_aggregates\_list Data Source + +Get json output from the ipam_aggregates_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_ipam_aggregates_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_ipam_aggregates_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_ipam_ip_addresses_list.md b/docs/data-sources/json_ipam_ip_addresses_list.md new file mode 100644 index 000000000..b7e94bd87 --- /dev/null +++ b/docs/data-sources/json_ipam_ip_addresses_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_ipam\_ip\_addresses\_list Data Source + +Get json output from the ipam_ip_addresses_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_ipam_ip_addresses_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_ipam_ip_addresses_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_ipam_prefixes_list.md b/docs/data-sources/json_ipam_prefixes_list.md new file mode 100644 index 000000000..0db9ee965 --- /dev/null +++ b/docs/data-sources/json_ipam_prefixes_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_ipam\_prefixes\_list Data Source + +Get json output from the ipam_prefixes_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_ipam_prefixes_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_ipam_prefixes_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_ipam_rirs_list.md b/docs/data-sources/json_ipam_rirs_list.md new file mode 100644 index 000000000..c1a9d9406 --- /dev/null +++ b/docs/data-sources/json_ipam_rirs_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_ipam\_rirs\_list Data Source + +Get json output from the ipam_rirs_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_ipam_rirs_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_ipam_rirs_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_ipam_roles_list.md b/docs/data-sources/json_ipam_roles_list.md new file mode 100644 index 000000000..35b0a8957 --- /dev/null +++ b/docs/data-sources/json_ipam_roles_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_ipam\_roles\_list Data Source + +Get json output from the ipam_roles_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_ipam_roles_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_ipam_roles_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_ipam_services_list.md b/docs/data-sources/json_ipam_services_list.md new file mode 100644 index 000000000..6f85afc81 --- /dev/null +++ b/docs/data-sources/json_ipam_services_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_ipam\_services\_list Data Source + +Get json output from the ipam_services_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_ipam_services_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_ipam_services_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_ipam_vlan_groups_list.md b/docs/data-sources/json_ipam_vlan_groups_list.md new file mode 100644 index 000000000..50eaddccf --- /dev/null +++ b/docs/data-sources/json_ipam_vlan_groups_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_ipam\_vlan\_groups\_list Data Source + +Get json output from the ipam_vlan_groups_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_ipam_vlan_groups_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_ipam_vlan_groups_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_ipam_vlans_list.md b/docs/data-sources/json_ipam_vlans_list.md new file mode 100644 index 000000000..189a8ed63 --- /dev/null +++ b/docs/data-sources/json_ipam_vlans_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_ipam\_vlans\_list Data Source + +Get json output from the ipam_vlans_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_ipam_vlans_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_ipam_vlans_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_ipam_vrfs_list.md b/docs/data-sources/json_ipam_vrfs_list.md new file mode 100644 index 000000000..e7025fce3 --- /dev/null +++ b/docs/data-sources/json_ipam_vrfs_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_ipam\_vrfs\_list Data Source + +Get json output from the ipam_vrfs_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_ipam_vrfs_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_ipam_vrfs_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_secrets_secret_roles_list.md b/docs/data-sources/json_secrets_secret_roles_list.md new file mode 100644 index 000000000..dd438e3a0 --- /dev/null +++ b/docs/data-sources/json_secrets_secret_roles_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_secrets\_secret\_roles\_list Data Source + +Get json output from the secrets_secret_roles_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_secrets_secret_roles_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_secrets_secret_roles_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_secrets_secrets_list.md b/docs/data-sources/json_secrets_secrets_list.md new file mode 100644 index 000000000..0c9eb2db4 --- /dev/null +++ b/docs/data-sources/json_secrets_secrets_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_secrets\_secrets\_list Data Source + +Get json output from the secrets_secrets_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_secrets_secrets_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_secrets_secrets_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_tenancy_tenant_groups_list.md b/docs/data-sources/json_tenancy_tenant_groups_list.md new file mode 100644 index 000000000..9838d8076 --- /dev/null +++ b/docs/data-sources/json_tenancy_tenant_groups_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_tenancy\_tenant\_groups\_list Data Source + +Get json output from the tenancy_tenant_groups_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_tenancy_tenant_groups_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_tenancy_tenant_groups_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_tenancy_tenants_list.md b/docs/data-sources/json_tenancy_tenants_list.md new file mode 100644 index 000000000..6628f2655 --- /dev/null +++ b/docs/data-sources/json_tenancy_tenants_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_tenancy\_tenants\_list Data Source + +Get json output from the tenancy_tenants_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_tenancy_tenants_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_tenancy_tenants_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_users_groups_list.md b/docs/data-sources/json_users_groups_list.md new file mode 100644 index 000000000..f006409f5 --- /dev/null +++ b/docs/data-sources/json_users_groups_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_users\_groups\_list Data Source + +Get json output from the users_groups_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_users_groups_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_users_groups_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_users_permissions_list.md b/docs/data-sources/json_users_permissions_list.md new file mode 100644 index 000000000..3550b4647 --- /dev/null +++ b/docs/data-sources/json_users_permissions_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_users\_permissions\_list Data Source + +Get json output from the users_permissions_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_users_permissions_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_users_permissions_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_users_users_list.md b/docs/data-sources/json_users_users_list.md new file mode 100644 index 000000000..493526be6 --- /dev/null +++ b/docs/data-sources/json_users_users_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_users\_users\_list Data Source + +Get json output from the users_users_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_users_users_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_users_users_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_virtualization_cluster_groups_list.md b/docs/data-sources/json_virtualization_cluster_groups_list.md new file mode 100644 index 000000000..8f29601dc --- /dev/null +++ b/docs/data-sources/json_virtualization_cluster_groups_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_virtualization\_cluster\_groups\_list Data Source + +Get json output from the virtualization_cluster_groups_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_virtualization_cluster_groups_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_virtualization_cluster_groups_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_virtualization_cluster_types_list.md b/docs/data-sources/json_virtualization_cluster_types_list.md new file mode 100644 index 000000000..eca42827e --- /dev/null +++ b/docs/data-sources/json_virtualization_cluster_types_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_virtualization\_cluster\_types\_list Data Source + +Get json output from the virtualization_cluster_types_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_virtualization_cluster_types_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_virtualization_cluster_types_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_virtualization_clusters_list.md b/docs/data-sources/json_virtualization_clusters_list.md new file mode 100644 index 000000000..3aae6fb55 --- /dev/null +++ b/docs/data-sources/json_virtualization_clusters_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_virtualization\_clusters\_list Data Source + +Get json output from the virtualization_clusters_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_virtualization_clusters_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_virtualization_clusters_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_virtualization_interfaces_list.md b/docs/data-sources/json_virtualization_interfaces_list.md new file mode 100644 index 000000000..64dc1cf77 --- /dev/null +++ b/docs/data-sources/json_virtualization_interfaces_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_virtualization\_interfaces\_list Data Source + +Get json output from the virtualization_interfaces_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_virtualization_interfaces_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_virtualization_interfaces_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/docs/data-sources/json_virtualization_virtual_machines_list.md b/docs/data-sources/json_virtualization_virtual_machines_list.md new file mode 100644 index 000000000..5b480a921 --- /dev/null +++ b/docs/data-sources/json_virtualization_virtual_machines_list.md @@ -0,0 +1,22 @@ +# netbox\_json\_virtualization\_virtual\_machines\_list Data Source + +Get json output from the virtualization_virtual_machines_list Netbox endpoint + +## Example Usage + +```hcl +data "netbox_json_virtualization_virtual_machines_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_virtualization_virtual_machines_list.test.json) +} +``` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* ``json`` - JSON output of the list of objects for this Netbox endpoint. + diff --git a/netbox/data_netbox_json_circuits_circuit_terminations_list.go b/netbox/data_netbox_json_circuits_circuit_terminations_list.go new file mode 100644 index 000000000..f41969093 --- /dev/null +++ b/netbox/data_netbox_json_circuits_circuit_terminations_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONCircuitsCircuitTerminationsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONCircuitsCircuitTerminationsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONCircuitsCircuitTerminationsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Circuits.CircuitsCircuitTerminationsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONCircuitsCircuitTerminationsList") + + return nil +} diff --git a/netbox/data_netbox_json_circuits_circuit_types_list.go b/netbox/data_netbox_json_circuits_circuit_types_list.go new file mode 100644 index 000000000..99736a04c --- /dev/null +++ b/netbox/data_netbox_json_circuits_circuit_types_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONCircuitsCircuitTypesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONCircuitsCircuitTypesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONCircuitsCircuitTypesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Circuits.CircuitsCircuitTypesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONCircuitsCircuitTypesList") + + return nil +} diff --git a/netbox/data_netbox_json_circuits_circuits_list.go b/netbox/data_netbox_json_circuits_circuits_list.go new file mode 100644 index 000000000..d75dc09c1 --- /dev/null +++ b/netbox/data_netbox_json_circuits_circuits_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONCircuitsCircuitsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONCircuitsCircuitsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONCircuitsCircuitsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Circuits.CircuitsCircuitsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONCircuitsCircuitsList") + + return nil +} diff --git a/netbox/data_netbox_json_circuits_providers_list.go b/netbox/data_netbox_json_circuits_providers_list.go new file mode 100644 index 000000000..6ce0b7528 --- /dev/null +++ b/netbox/data_netbox_json_circuits_providers_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONCircuitsProvidersList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONCircuitsProvidersListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONCircuitsProvidersListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Circuits.CircuitsProvidersList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONCircuitsProvidersList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_cables_list.go b/netbox/data_netbox_json_dcim_cables_list.go new file mode 100644 index 000000000..740b8a087 --- /dev/null +++ b/netbox/data_netbox_json_dcim_cables_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimCablesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimCablesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimCablesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimCablesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimCablesList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_console_connections_list.go b/netbox/data_netbox_json_dcim_console_connections_list.go new file mode 100644 index 000000000..96be122f1 --- /dev/null +++ b/netbox/data_netbox_json_dcim_console_connections_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimConsoleConnectionsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimConsoleConnectionsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimConsoleConnectionsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimConsoleConnectionsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimConsoleConnectionsList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_console_port_templates_list.go b/netbox/data_netbox_json_dcim_console_port_templates_list.go new file mode 100644 index 000000000..fec81fa2b --- /dev/null +++ b/netbox/data_netbox_json_dcim_console_port_templates_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimConsolePortTemplatesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimConsolePortTemplatesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimConsolePortTemplatesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimConsolePortTemplatesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimConsolePortTemplatesList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_console_ports_list.go b/netbox/data_netbox_json_dcim_console_ports_list.go new file mode 100644 index 000000000..95ac5a204 --- /dev/null +++ b/netbox/data_netbox_json_dcim_console_ports_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimConsolePortsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimConsolePortsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimConsolePortsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimConsolePortsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimConsolePortsList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_console_server_port_templates_list.go b/netbox/data_netbox_json_dcim_console_server_port_templates_list.go new file mode 100644 index 000000000..1aabed185 --- /dev/null +++ b/netbox/data_netbox_json_dcim_console_server_port_templates_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimConsoleServerPortTemplatesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimConsoleServerPortTemplatesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimConsoleServerPortTemplatesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimConsoleServerPortTemplatesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimConsoleServerPortTemplatesList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_console_server_ports_list.go b/netbox/data_netbox_json_dcim_console_server_ports_list.go new file mode 100644 index 000000000..7a51acbb7 --- /dev/null +++ b/netbox/data_netbox_json_dcim_console_server_ports_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimConsoleServerPortsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimConsoleServerPortsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimConsoleServerPortsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimConsoleServerPortsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimConsoleServerPortsList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_device_bay_templates_list.go b/netbox/data_netbox_json_dcim_device_bay_templates_list.go new file mode 100644 index 000000000..af95637a6 --- /dev/null +++ b/netbox/data_netbox_json_dcim_device_bay_templates_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimDeviceBayTemplatesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimDeviceBayTemplatesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimDeviceBayTemplatesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimDeviceBayTemplatesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimDeviceBayTemplatesList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_device_bays_list.go b/netbox/data_netbox_json_dcim_device_bays_list.go new file mode 100644 index 000000000..ce0a02570 --- /dev/null +++ b/netbox/data_netbox_json_dcim_device_bays_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimDeviceBaysList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimDeviceBaysListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimDeviceBaysListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimDeviceBaysList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimDeviceBaysList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_device_roles_list.go b/netbox/data_netbox_json_dcim_device_roles_list.go new file mode 100644 index 000000000..e2cb71d2a --- /dev/null +++ b/netbox/data_netbox_json_dcim_device_roles_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimDeviceRolesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimDeviceRolesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimDeviceRolesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimDeviceRolesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimDeviceRolesList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_device_types_list.go b/netbox/data_netbox_json_dcim_device_types_list.go new file mode 100644 index 000000000..01d54b10c --- /dev/null +++ b/netbox/data_netbox_json_dcim_device_types_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimDeviceTypesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimDeviceTypesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimDeviceTypesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimDeviceTypesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimDeviceTypesList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_devices_list.go b/netbox/data_netbox_json_dcim_devices_list.go new file mode 100644 index 000000000..c814ccbb0 --- /dev/null +++ b/netbox/data_netbox_json_dcim_devices_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimDevicesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimDevicesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimDevicesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimDevicesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimDevicesList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_front_port_templates_list.go b/netbox/data_netbox_json_dcim_front_port_templates_list.go new file mode 100644 index 000000000..96940c29c --- /dev/null +++ b/netbox/data_netbox_json_dcim_front_port_templates_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimFrontPortTemplatesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimFrontPortTemplatesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimFrontPortTemplatesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimFrontPortTemplatesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimFrontPortTemplatesList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_front_ports_list.go b/netbox/data_netbox_json_dcim_front_ports_list.go new file mode 100644 index 000000000..854b799c1 --- /dev/null +++ b/netbox/data_netbox_json_dcim_front_ports_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimFrontPortsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimFrontPortsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimFrontPortsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimFrontPortsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimFrontPortsList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_interface_connections_list.go b/netbox/data_netbox_json_dcim_interface_connections_list.go new file mode 100644 index 000000000..4935f7dea --- /dev/null +++ b/netbox/data_netbox_json_dcim_interface_connections_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimInterfaceConnectionsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimInterfaceConnectionsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimInterfaceConnectionsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimInterfaceConnectionsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimInterfaceConnectionsList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_interface_templates_list.go b/netbox/data_netbox_json_dcim_interface_templates_list.go new file mode 100644 index 000000000..9a1c1d858 --- /dev/null +++ b/netbox/data_netbox_json_dcim_interface_templates_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimInterfaceTemplatesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimInterfaceTemplatesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimInterfaceTemplatesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimInterfaceTemplatesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimInterfaceTemplatesList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_interfaces_list.go b/netbox/data_netbox_json_dcim_interfaces_list.go new file mode 100644 index 000000000..4bfffc9dd --- /dev/null +++ b/netbox/data_netbox_json_dcim_interfaces_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimInterfacesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimInterfacesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimInterfacesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimInterfacesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimInterfacesList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_inventory_items_list.go b/netbox/data_netbox_json_dcim_inventory_items_list.go new file mode 100644 index 000000000..bea9c613a --- /dev/null +++ b/netbox/data_netbox_json_dcim_inventory_items_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimInventoryItemsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimInventoryItemsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimInventoryItemsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimInventoryItemsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimInventoryItemsList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_manufacturers_list.go b/netbox/data_netbox_json_dcim_manufacturers_list.go new file mode 100644 index 000000000..263e25771 --- /dev/null +++ b/netbox/data_netbox_json_dcim_manufacturers_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimManufacturersList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimManufacturersListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimManufacturersListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimManufacturersList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimManufacturersList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_platforms_list.go b/netbox/data_netbox_json_dcim_platforms_list.go new file mode 100644 index 000000000..95788130a --- /dev/null +++ b/netbox/data_netbox_json_dcim_platforms_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimPlatformsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimPlatformsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimPlatformsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimPlatformsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimPlatformsList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_power_connections_list.go b/netbox/data_netbox_json_dcim_power_connections_list.go new file mode 100644 index 000000000..8976b2a48 --- /dev/null +++ b/netbox/data_netbox_json_dcim_power_connections_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimPowerConnectionsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimPowerConnectionsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimPowerConnectionsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimPowerConnectionsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimPowerConnectionsList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_power_feeds_list.go b/netbox/data_netbox_json_dcim_power_feeds_list.go new file mode 100644 index 000000000..08e1146a5 --- /dev/null +++ b/netbox/data_netbox_json_dcim_power_feeds_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimPowerFeedsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimPowerFeedsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimPowerFeedsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimPowerFeedsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimPowerFeedsList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_power_outlet_templates_list.go b/netbox/data_netbox_json_dcim_power_outlet_templates_list.go new file mode 100644 index 000000000..3c9bc1036 --- /dev/null +++ b/netbox/data_netbox_json_dcim_power_outlet_templates_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimPowerOutletTemplatesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimPowerOutletTemplatesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimPowerOutletTemplatesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimPowerOutletTemplatesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimPowerOutletTemplatesList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_power_outlets_list.go b/netbox/data_netbox_json_dcim_power_outlets_list.go new file mode 100644 index 000000000..c852a7e50 --- /dev/null +++ b/netbox/data_netbox_json_dcim_power_outlets_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimPowerOutletsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimPowerOutletsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimPowerOutletsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimPowerOutletsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimPowerOutletsList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_power_panels_list.go b/netbox/data_netbox_json_dcim_power_panels_list.go new file mode 100644 index 000000000..2bcd25d50 --- /dev/null +++ b/netbox/data_netbox_json_dcim_power_panels_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimPowerPanelsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimPowerPanelsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimPowerPanelsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimPowerPanelsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimPowerPanelsList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_power_port_templates_list.go b/netbox/data_netbox_json_dcim_power_port_templates_list.go new file mode 100644 index 000000000..627c17220 --- /dev/null +++ b/netbox/data_netbox_json_dcim_power_port_templates_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimPowerPortTemplatesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimPowerPortTemplatesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimPowerPortTemplatesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimPowerPortTemplatesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimPowerPortTemplatesList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_power_ports_list.go b/netbox/data_netbox_json_dcim_power_ports_list.go new file mode 100644 index 000000000..e882a86c7 --- /dev/null +++ b/netbox/data_netbox_json_dcim_power_ports_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimPowerPortsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimPowerPortsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimPowerPortsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimPowerPortsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimPowerPortsList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_rack_groups_list.go b/netbox/data_netbox_json_dcim_rack_groups_list.go new file mode 100644 index 000000000..0728b8b03 --- /dev/null +++ b/netbox/data_netbox_json_dcim_rack_groups_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimRackGroupsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimRackGroupsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimRackGroupsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimRackGroupsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimRackGroupsList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_rack_reservations_list.go b/netbox/data_netbox_json_dcim_rack_reservations_list.go new file mode 100644 index 000000000..dd28382a9 --- /dev/null +++ b/netbox/data_netbox_json_dcim_rack_reservations_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimRackReservationsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimRackReservationsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimRackReservationsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimRackReservationsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimRackReservationsList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_rack_roles_list.go b/netbox/data_netbox_json_dcim_rack_roles_list.go new file mode 100644 index 000000000..e431c34c2 --- /dev/null +++ b/netbox/data_netbox_json_dcim_rack_roles_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimRackRolesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimRackRolesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimRackRolesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimRackRolesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimRackRolesList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_racks_list.go b/netbox/data_netbox_json_dcim_racks_list.go new file mode 100644 index 000000000..189ad2229 --- /dev/null +++ b/netbox/data_netbox_json_dcim_racks_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimRacksList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimRacksListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimRacksListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimRacksList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimRacksList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_rear_port_templates_list.go b/netbox/data_netbox_json_dcim_rear_port_templates_list.go new file mode 100644 index 000000000..a9d56f91d --- /dev/null +++ b/netbox/data_netbox_json_dcim_rear_port_templates_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimRearPortTemplatesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimRearPortTemplatesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimRearPortTemplatesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimRearPortTemplatesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimRearPortTemplatesList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_rear_ports_list.go b/netbox/data_netbox_json_dcim_rear_ports_list.go new file mode 100644 index 000000000..6223155e2 --- /dev/null +++ b/netbox/data_netbox_json_dcim_rear_ports_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimRearPortsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimRearPortsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimRearPortsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimRearPortsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimRearPortsList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_regions_list.go b/netbox/data_netbox_json_dcim_regions_list.go new file mode 100644 index 000000000..b45d89f90 --- /dev/null +++ b/netbox/data_netbox_json_dcim_regions_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimRegionsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimRegionsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimRegionsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimRegionsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimRegionsList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_sites_list.go b/netbox/data_netbox_json_dcim_sites_list.go new file mode 100644 index 000000000..eb44468e3 --- /dev/null +++ b/netbox/data_netbox_json_dcim_sites_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimSitesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimSitesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimSitesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimSitesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimSitesList") + + return nil +} diff --git a/netbox/data_netbox_json_dcim_virtual_chassis_list.go b/netbox/data_netbox_json_dcim_virtual_chassis_list.go new file mode 100644 index 000000000..9c42f3fcc --- /dev/null +++ b/netbox/data_netbox_json_dcim_virtual_chassis_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONDcimVirtualChassisList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONDcimVirtualChassisListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONDcimVirtualChassisListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Dcim.DcimVirtualChassisList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONDcimVirtualChassisList") + + return nil +} diff --git a/netbox/data_netbox_json_extras_config_contexts_list.go b/netbox/data_netbox_json_extras_config_contexts_list.go new file mode 100644 index 000000000..bc5aed960 --- /dev/null +++ b/netbox/data_netbox_json_extras_config_contexts_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONExtrasConfigContextsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONExtrasConfigContextsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONExtrasConfigContextsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Extras.ExtrasConfigContextsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONExtrasConfigContextsList") + + return nil +} diff --git a/netbox/data_netbox_json_extras_export_templates_list.go b/netbox/data_netbox_json_extras_export_templates_list.go new file mode 100644 index 000000000..1d9ca32d8 --- /dev/null +++ b/netbox/data_netbox_json_extras_export_templates_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONExtrasExportTemplatesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONExtrasExportTemplatesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONExtrasExportTemplatesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Extras.ExtrasExportTemplatesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONExtrasExportTemplatesList") + + return nil +} diff --git a/netbox/data_netbox_json_extras_graphs_list.go b/netbox/data_netbox_json_extras_graphs_list.go new file mode 100644 index 000000000..52bc4013f --- /dev/null +++ b/netbox/data_netbox_json_extras_graphs_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONExtrasGraphsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONExtrasGraphsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONExtrasGraphsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Extras.ExtrasGraphsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONExtrasGraphsList") + + return nil +} diff --git a/netbox/data_netbox_json_extras_image_attachments_list.go b/netbox/data_netbox_json_extras_image_attachments_list.go new file mode 100644 index 000000000..858608e2c --- /dev/null +++ b/netbox/data_netbox_json_extras_image_attachments_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONExtrasImageAttachmentsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONExtrasImageAttachmentsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONExtrasImageAttachmentsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Extras.ExtrasImageAttachmentsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONExtrasImageAttachmentsList") + + return nil +} diff --git a/netbox/data_netbox_json_extras_job_results_list.go b/netbox/data_netbox_json_extras_job_results_list.go new file mode 100644 index 000000000..cd9024122 --- /dev/null +++ b/netbox/data_netbox_json_extras_job_results_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONExtrasJobResultsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONExtrasJobResultsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONExtrasJobResultsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Extras.ExtrasJobResultsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONExtrasJobResultsList") + + return nil +} diff --git a/netbox/data_netbox_json_extras_object_changes_list.go b/netbox/data_netbox_json_extras_object_changes_list.go new file mode 100644 index 000000000..3c7bbb839 --- /dev/null +++ b/netbox/data_netbox_json_extras_object_changes_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONExtrasObjectChangesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONExtrasObjectChangesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONExtrasObjectChangesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Extras.ExtrasObjectChangesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONExtrasObjectChangesList") + + return nil +} diff --git a/netbox/data_netbox_json_extras_tags_list.go b/netbox/data_netbox_json_extras_tags_list.go new file mode 100644 index 000000000..032d5b911 --- /dev/null +++ b/netbox/data_netbox_json_extras_tags_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONExtrasTagsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONExtrasTagsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONExtrasTagsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Extras.ExtrasTagsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONExtrasTagsList") + + return nil +} diff --git a/netbox/data_netbox_json_ipam_aggregates_list.go b/netbox/data_netbox_json_ipam_aggregates_list.go new file mode 100644 index 000000000..83dd0d4de --- /dev/null +++ b/netbox/data_netbox_json_ipam_aggregates_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONIpamAggregatesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONIpamAggregatesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONIpamAggregatesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Ipam.IpamAggregatesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONIpamAggregatesList") + + return nil +} diff --git a/netbox/data_netbox_json_ipam_ip_addresses_list.go b/netbox/data_netbox_json_ipam_ip_addresses_list.go new file mode 100644 index 000000000..f3c69b014 --- /dev/null +++ b/netbox/data_netbox_json_ipam_ip_addresses_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONIpamIPAddressesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONIpamIPAddressesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONIpamIPAddressesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Ipam.IpamIPAddressesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONIpamIPAddressesList") + + return nil +} diff --git a/netbox/data_netbox_json_ipam_prefixes_list.go b/netbox/data_netbox_json_ipam_prefixes_list.go new file mode 100644 index 000000000..b494587f3 --- /dev/null +++ b/netbox/data_netbox_json_ipam_prefixes_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONIpamPrefixesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONIpamPrefixesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONIpamPrefixesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Ipam.IpamPrefixesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONIpamPrefixesList") + + return nil +} diff --git a/netbox/data_netbox_json_ipam_rirs_list.go b/netbox/data_netbox_json_ipam_rirs_list.go new file mode 100644 index 000000000..ea186fab6 --- /dev/null +++ b/netbox/data_netbox_json_ipam_rirs_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONIpamRirsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONIpamRirsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONIpamRirsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Ipam.IpamRirsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONIpamRirsList") + + return nil +} diff --git a/netbox/data_netbox_json_ipam_roles_list.go b/netbox/data_netbox_json_ipam_roles_list.go new file mode 100644 index 000000000..e53ad3527 --- /dev/null +++ b/netbox/data_netbox_json_ipam_roles_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONIpamRolesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONIpamRolesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONIpamRolesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Ipam.IpamRolesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONIpamRolesList") + + return nil +} diff --git a/netbox/data_netbox_json_ipam_services_list.go b/netbox/data_netbox_json_ipam_services_list.go new file mode 100644 index 000000000..dc3fb2d5b --- /dev/null +++ b/netbox/data_netbox_json_ipam_services_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONIpamServicesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONIpamServicesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONIpamServicesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Ipam.IpamServicesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONIpamServicesList") + + return nil +} diff --git a/netbox/data_netbox_json_ipam_vlan_groups_list.go b/netbox/data_netbox_json_ipam_vlan_groups_list.go new file mode 100644 index 000000000..f49a341cd --- /dev/null +++ b/netbox/data_netbox_json_ipam_vlan_groups_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONIpamVlanGroupsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONIpamVlanGroupsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONIpamVlanGroupsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Ipam.IpamVlanGroupsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONIpamVlanGroupsList") + + return nil +} diff --git a/netbox/data_netbox_json_ipam_vlans_list.go b/netbox/data_netbox_json_ipam_vlans_list.go new file mode 100644 index 000000000..3cffa95b3 --- /dev/null +++ b/netbox/data_netbox_json_ipam_vlans_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONIpamVlansList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONIpamVlansListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONIpamVlansListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Ipam.IpamVlansList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONIpamVlansList") + + return nil +} diff --git a/netbox/data_netbox_json_ipam_vrfs_list.go b/netbox/data_netbox_json_ipam_vrfs_list.go new file mode 100644 index 000000000..63f84cf1c --- /dev/null +++ b/netbox/data_netbox_json_ipam_vrfs_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONIpamVrfsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONIpamVrfsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONIpamVrfsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Ipam.IpamVrfsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONIpamVrfsList") + + return nil +} diff --git a/netbox/data_netbox_json_secrets_secret_roles_list.go b/netbox/data_netbox_json_secrets_secret_roles_list.go new file mode 100644 index 000000000..fe6686279 --- /dev/null +++ b/netbox/data_netbox_json_secrets_secret_roles_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONSecretsSecretRolesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONSecretsSecretRolesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONSecretsSecretRolesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Secrets.SecretsSecretRolesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONSecretsSecretRolesList") + + return nil +} diff --git a/netbox/data_netbox_json_secrets_secrets_list.go b/netbox/data_netbox_json_secrets_secrets_list.go new file mode 100644 index 000000000..52634562f --- /dev/null +++ b/netbox/data_netbox_json_secrets_secrets_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONSecretsSecretsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONSecretsSecretsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONSecretsSecretsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Secrets.SecretsSecretsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONSecretsSecretsList") + + return nil +} diff --git a/netbox/data_netbox_json_tenancy_tenant_groups_list.go b/netbox/data_netbox_json_tenancy_tenant_groups_list.go new file mode 100644 index 000000000..4eeee5bee --- /dev/null +++ b/netbox/data_netbox_json_tenancy_tenant_groups_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONTenancyTenantGroupsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONTenancyTenantGroupsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONTenancyTenantGroupsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Tenancy.TenancyTenantGroupsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONTenancyTenantGroupsList") + + return nil +} diff --git a/netbox/data_netbox_json_tenancy_tenants_list.go b/netbox/data_netbox_json_tenancy_tenants_list.go new file mode 100644 index 000000000..83ab28189 --- /dev/null +++ b/netbox/data_netbox_json_tenancy_tenants_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONTenancyTenantsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONTenancyTenantsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONTenancyTenantsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Tenancy.TenancyTenantsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONTenancyTenantsList") + + return nil +} diff --git a/netbox/data_netbox_json_users_groups_list.go b/netbox/data_netbox_json_users_groups_list.go new file mode 100644 index 000000000..c2d9f6c7e --- /dev/null +++ b/netbox/data_netbox_json_users_groups_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONUsersGroupsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONUsersGroupsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONUsersGroupsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Users.UsersGroupsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONUsersGroupsList") + + return nil +} diff --git a/netbox/data_netbox_json_users_permissions_list.go b/netbox/data_netbox_json_users_permissions_list.go new file mode 100644 index 000000000..a53d596f5 --- /dev/null +++ b/netbox/data_netbox_json_users_permissions_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONUsersPermissionsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONUsersPermissionsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONUsersPermissionsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Users.UsersPermissionsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONUsersPermissionsList") + + return nil +} diff --git a/netbox/data_netbox_json_users_users_list.go b/netbox/data_netbox_json_users_users_list.go new file mode 100644 index 000000000..100db7347 --- /dev/null +++ b/netbox/data_netbox_json_users_users_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONUsersUsersList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONUsersUsersListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONUsersUsersListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Users.UsersUsersList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONUsersUsersList") + + return nil +} diff --git a/netbox/data_netbox_json_virtualization_cluster_groups_list.go b/netbox/data_netbox_json_virtualization_cluster_groups_list.go new file mode 100644 index 000000000..51eeabbf8 --- /dev/null +++ b/netbox/data_netbox_json_virtualization_cluster_groups_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONVirtualizationClusterGroupsList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONVirtualizationClusterGroupsListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONVirtualizationClusterGroupsListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Virtualization.VirtualizationClusterGroupsList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONVirtualizationClusterGroupsList") + + return nil +} diff --git a/netbox/data_netbox_json_virtualization_cluster_types_list.go b/netbox/data_netbox_json_virtualization_cluster_types_list.go new file mode 100644 index 000000000..d993df23e --- /dev/null +++ b/netbox/data_netbox_json_virtualization_cluster_types_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONVirtualizationClusterTypesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONVirtualizationClusterTypesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONVirtualizationClusterTypesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Virtualization.VirtualizationClusterTypesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONVirtualizationClusterTypesList") + + return nil +} diff --git a/netbox/data_netbox_json_virtualization_clusters_list.go b/netbox/data_netbox_json_virtualization_clusters_list.go new file mode 100644 index 000000000..570cbab24 --- /dev/null +++ b/netbox/data_netbox_json_virtualization_clusters_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONVirtualizationClustersList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONVirtualizationClustersListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONVirtualizationClustersListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Virtualization.VirtualizationClustersList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONVirtualizationClustersList") + + return nil +} diff --git a/netbox/data_netbox_json_virtualization_interfaces_list.go b/netbox/data_netbox_json_virtualization_interfaces_list.go new file mode 100644 index 000000000..76c4efe28 --- /dev/null +++ b/netbox/data_netbox_json_virtualization_interfaces_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONVirtualizationInterfacesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONVirtualizationInterfacesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONVirtualizationInterfacesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Virtualization.VirtualizationInterfacesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONVirtualizationInterfacesList") + + return nil +} diff --git a/netbox/data_netbox_json_virtualization_virtual_machines_list.go b/netbox/data_netbox_json_virtualization_virtual_machines_list.go new file mode 100644 index 000000000..a00bc4f75 --- /dev/null +++ b/netbox/data_netbox_json_virtualization_virtual_machines_list.go @@ -0,0 +1,37 @@ +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSONVirtualizationVirtualMachinesList() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSONVirtualizationVirtualMachinesListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSONVirtualizationVirtualMachinesListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.Virtualization.VirtualizationVirtualMachinesList(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSONVirtualizationVirtualMachinesList") + + return nil +} diff --git a/netbox/provider.go b/netbox/provider.go index 9ef94f9e1..b2ef37386 100644 --- a/netbox/provider.go +++ b/netbox/provider.go @@ -36,16 +36,83 @@ func Provider() *schema.Provider { }, }, DataSourcesMap: map[string]*schema.Resource{ - "netbox_dcim_platform": dataNetboxDcimPlatform(), - "netbox_dcim_site": dataNetboxDcimSite(), - "netbox_ipam_aggregate": dataNetboxIpamAggregate(), - "netbox_ipam_ip_addresses": dataNetboxIpamIPAddresses(), - "netbox_ipam_role": dataNetboxIpamRole(), - "netbox_ipam_vlan": dataNetboxIpamVlan(), - "netbox_ipam_vlan_group": dataNetboxIpamVlanGroup(), - "netbox_tenancy_tenant": dataNetboxTenancyTenant(), - "netbox_tenancy_tenant_group": dataNetboxTenancyTenantGroup(), - "netbox_virtualization_cluster": dataNetboxVirtualizationCluster(), + "netbox_dcim_platform": dataNetboxDcimPlatform(), + "netbox_dcim_site": dataNetboxDcimSite(), + "netbox_ipam_aggregate": dataNetboxIpamAggregate(), + "netbox_ipam_ip_addresses": dataNetboxIpamIPAddresses(), + "netbox_ipam_role": dataNetboxIpamRole(), + "netbox_ipam_vlan": dataNetboxIpamVlan(), + "netbox_ipam_vlan_group": dataNetboxIpamVlanGroup(), + "netbox_json_circuits_circuit_terminations_list": dataNetboxJSONCircuitsCircuitTerminationsList(), + "netbox_json_circuits_circuit_types_list": dataNetboxJSONCircuitsCircuitTypesList(), + "netbox_json_circuits_circuits_list": dataNetboxJSONCircuitsCircuitsList(), + "netbox_json_circuits_providers_list": dataNetboxJSONCircuitsProvidersList(), + "netbox_json_dcim_cables_list": dataNetboxJSONDcimCablesList(), + "netbox_json_dcim_console_connections_list": dataNetboxJSONDcimConsoleConnectionsList(), + "netbox_json_dcim_console_port_templates_list": dataNetboxJSONDcimConsolePortTemplatesList(), + "netbox_json_dcim_console_ports_list": dataNetboxJSONDcimConsolePortsList(), + "netbox_json_dcim_console_server_port_templates_list": dataNetboxJSONDcimConsoleServerPortTemplatesList(), + "netbox_json_dcim_console_server_ports_list": dataNetboxJSONDcimConsoleServerPortsList(), + "netbox_json_dcim_device_bay_templates_list": dataNetboxJSONDcimDeviceBayTemplatesList(), + "netbox_json_dcim_device_bays_list": dataNetboxJSONDcimDeviceBaysList(), + "netbox_json_dcim_device_roles_list": dataNetboxJSONDcimDeviceRolesList(), + "netbox_json_dcim_device_types_list": dataNetboxJSONDcimDeviceTypesList(), + "netbox_json_dcim_devices_list": dataNetboxJSONDcimDevicesList(), + "netbox_json_dcim_front_port_templates_list": dataNetboxJSONDcimFrontPortTemplatesList(), + "netbox_json_dcim_front_ports_list": dataNetboxJSONDcimFrontPortsList(), + "netbox_json_dcim_interface_connections_list": dataNetboxJSONDcimInterfaceConnectionsList(), + "netbox_json_dcim_interface_templates_list": dataNetboxJSONDcimInterfaceTemplatesList(), + "netbox_json_dcim_interfaces_list": dataNetboxJSONDcimInterfacesList(), + "netbox_json_dcim_inventory_items_list": dataNetboxJSONDcimInventoryItemsList(), + "netbox_json_dcim_manufacturers_list": dataNetboxJSONDcimManufacturersList(), + "netbox_json_dcim_platforms_list": dataNetboxJSONDcimPlatformsList(), + "netbox_json_dcim_power_connections_list": dataNetboxJSONDcimPowerConnectionsList(), + "netbox_json_dcim_power_feeds_list": dataNetboxJSONDcimPowerFeedsList(), + "netbox_json_dcim_power_outlet_templates_list": dataNetboxJSONDcimPowerOutletTemplatesList(), + "netbox_json_dcim_power_outlets_list": dataNetboxJSONDcimPowerOutletsList(), + "netbox_json_dcim_power_panels_list": dataNetboxJSONDcimPowerPanelsList(), + "netbox_json_dcim_power_port_templates_list": dataNetboxJSONDcimPowerPortTemplatesList(), + "netbox_json_dcim_power_ports_list": dataNetboxJSONDcimPowerPortsList(), + "netbox_json_dcim_rack_groups_list": dataNetboxJSONDcimRackGroupsList(), + "netbox_json_dcim_rack_reservations_list": dataNetboxJSONDcimRackReservationsList(), + "netbox_json_dcim_rack_roles_list": dataNetboxJSONDcimRackRolesList(), + "netbox_json_dcim_racks_list": dataNetboxJSONDcimRacksList(), + "netbox_json_dcim_rear_port_templates_list": dataNetboxJSONDcimRearPortTemplatesList(), + "netbox_json_dcim_rear_ports_list": dataNetboxJSONDcimRearPortsList(), + "netbox_json_dcim_regions_list": dataNetboxJSONDcimRegionsList(), + "netbox_json_dcim_sites_list": dataNetboxJSONDcimSitesList(), + "netbox_json_dcim_virtual_chassis_list": dataNetboxJSONDcimVirtualChassisList(), + "netbox_json_extras_config_contexts_list": dataNetboxJSONExtrasConfigContextsList(), + "netbox_json_extras_export_templates_list": dataNetboxJSONExtrasExportTemplatesList(), + "netbox_json_extras_graphs_list": dataNetboxJSONExtrasGraphsList(), + "netbox_json_extras_image_attachments_list": dataNetboxJSONExtrasImageAttachmentsList(), + "netbox_json_extras_job_results_list": dataNetboxJSONExtrasJobResultsList(), + "netbox_json_extras_object_changes_list": dataNetboxJSONExtrasObjectChangesList(), + "netbox_json_extras_tags_list": dataNetboxJSONExtrasTagsList(), + "netbox_json_ipam_aggregates_list": dataNetboxJSONIpamAggregatesList(), + "netbox_json_ipam_ip_addresses_list": dataNetboxJSONIpamIPAddressesList(), + "netbox_json_ipam_prefixes_list": dataNetboxJSONIpamPrefixesList(), + "netbox_json_ipam_rirs_list": dataNetboxJSONIpamRirsList(), + "netbox_json_ipam_roles_list": dataNetboxJSONIpamRolesList(), + "netbox_json_ipam_services_list": dataNetboxJSONIpamServicesList(), + "netbox_json_ipam_vlan_groups_list": dataNetboxJSONIpamVlanGroupsList(), + "netbox_json_ipam_vlans_list": dataNetboxJSONIpamVlansList(), + "netbox_json_ipam_vrfs_list": dataNetboxJSONIpamVrfsList(), + "netbox_json_secrets_secret_roles_list": dataNetboxJSONSecretsSecretRolesList(), + "netbox_json_secrets_secrets_list": dataNetboxJSONSecretsSecretsList(), + "netbox_json_tenancy_tenant_groups_list": dataNetboxJSONTenancyTenantGroupsList(), + "netbox_json_tenancy_tenants_list": dataNetboxJSONTenancyTenantsList(), + "netbox_json_users_groups_list": dataNetboxJSONUsersGroupsList(), + "netbox_json_users_permissions_list": dataNetboxJSONUsersPermissionsList(), + "netbox_json_users_users_list": dataNetboxJSONUsersUsersList(), + "netbox_json_virtualization_cluster_groups_list": dataNetboxJSONVirtualizationClusterGroupsList(), + "netbox_json_virtualization_cluster_types_list": dataNetboxJSONVirtualizationClusterTypesList(), + "netbox_json_virtualization_clusters_list": dataNetboxJSONVirtualizationClustersList(), + "netbox_json_virtualization_interfaces_list": dataNetboxJSONVirtualizationInterfacesList(), + "netbox_json_virtualization_virtual_machines_list": dataNetboxJSONVirtualizationVirtualMachinesList(), + "netbox_tenancy_tenant": dataNetboxTenancyTenant(), + "netbox_tenancy_tenant_group": dataNetboxTenancyTenantGroup(), + "netbox_virtualization_cluster": dataNetboxVirtualizationCluster(), }, ResourcesMap: map[string]*schema.Resource{ "netbox_ipam_aggregate": resourceNetboxIpamAggregate(), diff --git a/utils/netbox_generate_json_datasources.sh b/utils/netbox_generate_json_datasources.sh new file mode 100755 index 000000000..dc81e02c7 --- /dev/null +++ b/utils/netbox_generate_json_datasources.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +FILE=netbox_list_endpoints.txt + +while read -r line; do + SPLIT=( $line ) + + ENDPOINT=${SPLIT[0]} + SECTION=${SPLIT[1]} + ITEM=${SPLIT[2]} + +cat << EOF > ../netbox/data_netbox_json_${ENDPOINT}_list.go +package netbox + +import ( + "encoding/json" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + netboxclient "github.com/netbox-community/go-netbox/netbox/client" +) + +func dataNetboxJSON${SECTION}${ITEM}List() *schema.Resource { + return &schema.Resource{ + Read: dataNetboxJSON${SECTION}${ITEM}ListRead, + + Schema: map[string]*schema.Schema{ + "json": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataNetboxJSON${SECTION}${ITEM}ListRead(d *schema.ResourceData, m interface{}) error { + client := m.(*netboxclient.NetBoxAPI) + + list, err := client.${SECTION}.${SECTION}${ITEM}List(nil, nil) + if err != nil { + return err + } + + j, _ := json.Marshal(list.Payload.Results) + + d.Set("json", string(j)) + d.SetId("NetboxJSON${SECTION}${ITEM}List") + + return nil +} +EOF + + +cat << EOF >> provider_update.txt +"netbox_json_${ENDPOINT}_list": dataNetboxJSON${SECTION}${ITEM}List(), +EOF + + +cat << EOF > ../docs/data-sources/json_${ENDPOINT}_list.md +# netbox\_json\_`echo ${ENDPOINT} | sed 's/_/\\\_/g'`\_list Data Source + +Get json output from the ${ENDPOINT}_list Netbox endpoint + +## Example Usage + +\`\`\`hcl +data "netbox_json_${ENDPOINT}_list" "test" {} +output "example" { + value = jsondecode(data.netbox_json_${ENDPOINT}_list.test.json) +} +\`\`\` + +## Argument Reference + +This function takes no arguments. + +## Attributes Reference + +In addition to the above arguments, the following attributes are exported: +* \`\`json\`\` - JSON output of the list of objects for this Netbox endpoint. + +EOF + +done < "$FILE" diff --git a/utils/netbox_list_endpoints.txt b/utils/netbox_list_endpoints.txt new file mode 100644 index 000000000..d8ded321e --- /dev/null +++ b/utils/netbox_list_endpoints.txt @@ -0,0 +1,67 @@ +circuits_circuit_terminations Circuits CircuitTerminations +circuits_circuit_types Circuits CircuitTypes +circuits_circuits Circuits Circuits +circuits_providers Circuits Providers +dcim_cables Dcim Cables +dcim_console_connections Dcim ConsoleConnections +dcim_console_port_templates Dcim ConsolePortTemplates +dcim_console_ports Dcim ConsolePorts +dcim_console_server_port_templates Dcim ConsoleServerPortTemplates +dcim_console_server_ports Dcim ConsoleServerPorts +dcim_device_bay_templates Dcim DeviceBayTemplates +dcim_device_bays Dcim DeviceBays +dcim_device_roles Dcim DeviceRoles +dcim_device_types Dcim DeviceTypes +dcim_devices Dcim Devices +dcim_front_port_templates Dcim FrontPortTemplates +dcim_front_ports Dcim FrontPorts +dcim_interface_connections Dcim InterfaceConnections +dcim_interface_templates Dcim InterfaceTemplates +dcim_interfaces Dcim Interfaces +dcim_inventory_items Dcim InventoryItems +dcim_manufacturers Dcim Manufacturers +dcim_platforms Dcim Platforms +dcim_power_connections Dcim PowerConnections +dcim_power_feeds Dcim PowerFeeds +dcim_power_outlet_templates Dcim PowerOutletTemplates +dcim_power_outlets Dcim PowerOutlets +dcim_power_panels Dcim PowerPanels +dcim_power_port_templates Dcim PowerPortTemplates +dcim_power_ports Dcim PowerPorts +dcim_rack_groups Dcim RackGroups +dcim_rack_reservations Dcim RackReservations +dcim_rack_roles Dcim RackRoles +dcim_racks Dcim Racks +dcim_rear_port_templates Dcim RearPortTemplates +dcim_rear_ports Dcim RearPorts +dcim_regions Dcim Regions +dcim_sites Dcim Sites +dcim_virtual_chassis Dcim VirtualChassis +extras_config_contexts Extras ConfigContexts +extras_export_templates Extras ExportTemplates +extras_graphs Extras Graphs +extras_image_attachments Extras ImageAttachments +extras_job_results Extras JobResults +extras_object_changes Extras ObjectChanges +extras_tags Extras Tags +ipam_aggregates Ipam Aggregates +ipam_ip_addresses Ipam IPAddresses +ipam_prefixes Ipam Prefixes +ipam_rirs Ipam Rirs +ipam_roles Ipam Roles +ipam_services Ipam Services +ipam_vlan_groups Ipam VlanGroups +ipam_vlans Ipam Vlans +ipam_vrfs Ipam Vrfs +secrets_secret_roles Secrets SecretRoles +secrets_secrets Secrets Secrets +tenancy_tenant_groups Tenancy TenantGroups +tenancy_tenants Tenancy Tenants +users_groups Users Groups +users_permissions Users Permissions +users_users Users Users +virtualization_cluster_groups Virtualization ClusterGroups +virtualization_cluster_types Virtualization ClusterTypes +virtualization_clusters Virtualization Clusters +virtualization_interfaces Virtualization Interfaces +virtualization_virtual_machines Virtualization VirtualMachines diff --git a/utils/provider_update.txt b/utils/provider_update.txt new file mode 100644 index 000000000..1f10033fb --- /dev/null +++ b/utils/provider_update.txt @@ -0,0 +1,134 @@ +"netbox_json_circuits_circuit_terminations_list": dataNetboxJSONCircuitsCircuitTerminationsList(), +"netbox_json_circuits_circuit_types_list": dataNetboxJSONCircuitsCircuitTypesList(), +"netbox_json_circuits_circuits_list": dataNetboxJSONCircuitsCircuitsList(), +"netbox_json_circuits_providers_list": dataNetboxJSONCircuitsProvidersList(), +"netbox_json_dcim_cables_list": dataNetboxJSONDcimCablesList(), +"netbox_json_dcim_console_connections_list": dataNetboxJSONDcimConsoleConnectionsList(), +"netbox_json_dcim_console_port_templates_list": dataNetboxJSONDcimConsolePortTemplatesList(), +"netbox_json_dcim_console_ports_list": dataNetboxJSONDcimConsolePortsList(), +"netbox_json_dcim_console_server_port_templates_list": dataNetboxJSONDcimConsoleServerPortTemplatesList(), +"netbox_json_dcim_console_server_ports_list": dataNetboxJSONDcimConsoleServerPortsList(), +"netbox_json_dcim_device_bay_templates_list": dataNetboxJSONDcimDeviceBayTemplatesList(), +"netbox_json_dcim_device_bays_list": dataNetboxJSONDcimDeviceBaysList(), +"netbox_json_dcim_device_roles_list": dataNetboxJSONDcimDeviceRolesList(), +"netbox_json_dcim_device_types_list": dataNetboxJSONDcimDeviceTypesList(), +"netbox_json_dcim_devices_list": dataNetboxJSONDcimDevicesList(), +"netbox_json_dcim_front_port_templates_list": dataNetboxJSONDcimFrontPortTemplatesList(), +"netbox_json_dcim_front_ports_list": dataNetboxJSONDcimFrontPortsList(), +"netbox_json_dcim_interface_connections_list": dataNetboxJSONDcimInterfaceConnectionsList(), +"netbox_json_dcim_interface_templates_list": dataNetboxJSONDcimInterfaceTemplatesList(), +"netbox_json_dcim_interfaces_list": dataNetboxJSONDcimInterfacesList(), +"netbox_json_dcim_inventory_items_list": dataNetboxJSONDcimInventoryItemsList(), +"netbox_json_dcim_manufacturers_list": dataNetboxJSONDcimManufacturersList(), +"netbox_json_dcim_platforms_list": dataNetboxJSONDcimPlatformsList(), +"netbox_json_dcim_power_connections_list": dataNetboxJSONDcimPowerConnectionsList(), +"netbox_json_dcim_power_feeds_list": dataNetboxJSONDcimPowerFeedsList(), +"netbox_json_dcim_power_outlet_templates_list": dataNetboxJSONDcimPowerOutletTemplatesList(), +"netbox_json_dcim_power_outlets_list": dataNetboxJSONDcimPowerOutletsList(), +"netbox_json_dcim_power_panels_list": dataNetboxJSONDcimPowerPanelsList(), +"netbox_json_dcim_power_port_templates_list": dataNetboxJSONDcimPowerPortTemplatesList(), +"netbox_json_dcim_power_ports_list": dataNetboxJSONDcimPowerPortsList(), +"netbox_json_dcim_rack_groups_list": dataNetboxJSONDcimRackGroupsList(), +"netbox_json_dcim_rack_reservations_list": dataNetboxJSONDcimRackReservationsList(), +"netbox_json_dcim_rack_roles_list": dataNetboxJSONDcimRackRolesList(), +"netbox_json_dcim_racks_list": dataNetboxJSONDcimRacksList(), +"netbox_json_dcim_rear_port_templates_list": dataNetboxJSONDcimRearPortTemplatesList(), +"netbox_json_dcim_rear_ports_list": dataNetboxJSONDcimRearPortsList(), +"netbox_json_dcim_regions_list": dataNetboxJSONDcimRegionsList(), +"netbox_json_dcim_sites_list": dataNetboxJSONDcimSitesList(), +"netbox_json_dcim_virtual_chassis_list": dataNetboxJSONDcimVirtualChassisList(), +"netbox_json_extras_config_contexts_list": dataNetboxJSONExtrasConfigContextsList(), +"netbox_json_extras_export_templates_list": dataNetboxJSONExtrasExportTemplatesList(), +"netbox_json_extras_graphs_list": dataNetboxJSONExtrasGraphsList(), +"netbox_json_extras_image_attachments_list": dataNetboxJSONExtrasImageAttachmentsList(), +"netbox_json_extras_job_results_list": dataNetboxJSONExtrasJobResultsList(), +"netbox_json_extras_object_changes_list": dataNetboxJSONExtrasObjectChangesList(), +"netbox_json_extras_tags_list": dataNetboxJSONExtrasTagsList(), +"netbox_json_ipam_aggregates_list": dataNetboxJSONIpamAggregatesList(), +"netbox_json_ipam_ip_addresses_list": dataNetboxJSONIpamIPAddressesList(), +"netbox_json_ipam_prefixes_list": dataNetboxJSONIpamPrefixesList(), +"netbox_json_ipam_rirs_list": dataNetboxJSONIpamRirsList(), +"netbox_json_ipam_roles_list": dataNetboxJSONIpamRolesList(), +"netbox_json_ipam_services_list": dataNetboxJSONIpamServicesList(), +"netbox_json_ipam_vlan_groups_list": dataNetboxJSONIpamVlanGroupsList(), +"netbox_json_ipam_vlans_list": dataNetboxJSONIpamVlansList(), +"netbox_json_ipam_vrfs_list": dataNetboxJSONIpamVrfsList(), +"netbox_json_secrets_secret_roles_list": dataNetboxJSONSecretsSecretRolesList(), +"netbox_json_secrets_secrets_list": dataNetboxJSONSecretsSecretsList(), +"netbox_json_tenancy_tenant_groups_list": dataNetboxJSONTenancyTenantGroupsList(), +"netbox_json_tenancy_tenants_list": dataNetboxJSONTenancyTenantsList(), +"netbox_json_users_groups_list": dataNetboxJSONUsersGroupsList(), +"netbox_json_users_permissions_list": dataNetboxJSONUsersPermissionsList(), +"netbox_json_users_users_list": dataNetboxJSONUsersUsersList(), +"netbox_json_virtualization_cluster_groups_list": dataNetboxJSONVirtualizationClusterGroupsList(), +"netbox_json_virtualization_cluster_types_list": dataNetboxJSONVirtualizationClusterTypesList(), +"netbox_json_virtualization_clusters_list": dataNetboxJSONVirtualizationClustersList(), +"netbox_json_virtualization_interfaces_list": dataNetboxJSONVirtualizationInterfacesList(), +"netbox_json_virtualization_virtual_machines_list": dataNetboxJSONVirtualizationVirtualMachinesList(), +"netbox_json_circuits_circuit_terminations_list": dataNetboxJSONCircuitsCircuitTerminationsList(), +"netbox_json_circuits_circuit_types_list": dataNetboxJSONCircuitsCircuitTypesList(), +"netbox_json_circuits_circuits_list": dataNetboxJSONCircuitsCircuitsList(), +"netbox_json_circuits_providers_list": dataNetboxJSONCircuitsProvidersList(), +"netbox_json_dcim_cables_list": dataNetboxJSONDcimCablesList(), +"netbox_json_dcim_console_connections_list": dataNetboxJSONDcimConsoleConnectionsList(), +"netbox_json_dcim_console_port_templates_list": dataNetboxJSONDcimConsolePortTemplatesList(), +"netbox_json_dcim_console_ports_list": dataNetboxJSONDcimConsolePortsList(), +"netbox_json_dcim_console_server_port_templates_list": dataNetboxJSONDcimConsoleServerPortTemplatesList(), +"netbox_json_dcim_console_server_ports_list": dataNetboxJSONDcimConsoleServerPortsList(), +"netbox_json_dcim_device_bay_templates_list": dataNetboxJSONDcimDeviceBayTemplatesList(), +"netbox_json_dcim_device_bays_list": dataNetboxJSONDcimDeviceBaysList(), +"netbox_json_dcim_device_roles_list": dataNetboxJSONDcimDeviceRolesList(), +"netbox_json_dcim_device_types_list": dataNetboxJSONDcimDeviceTypesList(), +"netbox_json_dcim_devices_list": dataNetboxJSONDcimDevicesList(), +"netbox_json_dcim_front_port_templates_list": dataNetboxJSONDcimFrontPortTemplatesList(), +"netbox_json_dcim_front_ports_list": dataNetboxJSONDcimFrontPortsList(), +"netbox_json_dcim_interface_connections_list": dataNetboxJSONDcimInterfaceConnectionsList(), +"netbox_json_dcim_interface_templates_list": dataNetboxJSONDcimInterfaceTemplatesList(), +"netbox_json_dcim_interfaces_list": dataNetboxJSONDcimInterfacesList(), +"netbox_json_dcim_inventory_items_list": dataNetboxJSONDcimInventoryItemsList(), +"netbox_json_dcim_manufacturers_list": dataNetboxJSONDcimManufacturersList(), +"netbox_json_dcim_platforms_list": dataNetboxJSONDcimPlatformsList(), +"netbox_json_dcim_power_connections_list": dataNetboxJSONDcimPowerConnectionsList(), +"netbox_json_dcim_power_feeds_list": dataNetboxJSONDcimPowerFeedsList(), +"netbox_json_dcim_power_outlet_templates_list": dataNetboxJSONDcimPowerOutletTemplatesList(), +"netbox_json_dcim_power_outlets_list": dataNetboxJSONDcimPowerOutletsList(), +"netbox_json_dcim_power_panels_list": dataNetboxJSONDcimPowerPanelsList(), +"netbox_json_dcim_power_port_templates_list": dataNetboxJSONDcimPowerPortTemplatesList(), +"netbox_json_dcim_power_ports_list": dataNetboxJSONDcimPowerPortsList(), +"netbox_json_dcim_rack_groups_list": dataNetboxJSONDcimRackGroupsList(), +"netbox_json_dcim_rack_reservations_list": dataNetboxJSONDcimRackReservationsList(), +"netbox_json_dcim_rack_roles_list": dataNetboxJSONDcimRackRolesList(), +"netbox_json_dcim_racks_list": dataNetboxJSONDcimRacksList(), +"netbox_json_dcim_rear_port_templates_list": dataNetboxJSONDcimRearPortTemplatesList(), +"netbox_json_dcim_rear_ports_list": dataNetboxJSONDcimRearPortsList(), +"netbox_json_dcim_regions_list": dataNetboxJSONDcimRegionsList(), +"netbox_json_dcim_sites_list": dataNetboxJSONDcimSitesList(), +"netbox_json_dcim_virtual_chassis_list": dataNetboxJSONDcimVirtualChassisList(), +"netbox_json_extras_config_contexts_list": dataNetboxJSONExtrasConfigContextsList(), +"netbox_json_extras_export_templates_list": dataNetboxJSONExtrasExportTemplatesList(), +"netbox_json_extras_graphs_list": dataNetboxJSONExtrasGraphsList(), +"netbox_json_extras_image_attachments_list": dataNetboxJSONExtrasImageAttachmentsList(), +"netbox_json_extras_job_results_list": dataNetboxJSONExtrasJobResultsList(), +"netbox_json_extras_object_changes_list": dataNetboxJSONExtrasObjectChangesList(), +"netbox_json_extras_tags_list": dataNetboxJSONExtrasTagsList(), +"netbox_json_ipam_aggregates_list": dataNetboxJSONIpamAggregatesList(), +"netbox_json_ipam_ip_addresses_list": dataNetboxJSONIpamIPAddressesList(), +"netbox_json_ipam_prefixes_list": dataNetboxJSONIpamPrefixesList(), +"netbox_json_ipam_rirs_list": dataNetboxJSONIpamRirsList(), +"netbox_json_ipam_roles_list": dataNetboxJSONIpamRolesList(), +"netbox_json_ipam_services_list": dataNetboxJSONIpamServicesList(), +"netbox_json_ipam_vlan_groups_list": dataNetboxJSONIpamVlanGroupsList(), +"netbox_json_ipam_vlans_list": dataNetboxJSONIpamVlansList(), +"netbox_json_ipam_vrfs_list": dataNetboxJSONIpamVrfsList(), +"netbox_json_secrets_secret_roles_list": dataNetboxJSONSecretsSecretRolesList(), +"netbox_json_secrets_secrets_list": dataNetboxJSONSecretsSecretsList(), +"netbox_json_tenancy_tenant_groups_list": dataNetboxJSONTenancyTenantGroupsList(), +"netbox_json_tenancy_tenants_list": dataNetboxJSONTenancyTenantsList(), +"netbox_json_users_groups_list": dataNetboxJSONUsersGroupsList(), +"netbox_json_users_permissions_list": dataNetboxJSONUsersPermissionsList(), +"netbox_json_users_users_list": dataNetboxJSONUsersUsersList(), +"netbox_json_virtualization_cluster_groups_list": dataNetboxJSONVirtualizationClusterGroupsList(), +"netbox_json_virtualization_cluster_types_list": dataNetboxJSONVirtualizationClusterTypesList(), +"netbox_json_virtualization_clusters_list": dataNetboxJSONVirtualizationClustersList(), +"netbox_json_virtualization_interfaces_list": dataNetboxJSONVirtualizationInterfacesList(), +"netbox_json_virtualization_virtual_machines_list": dataNetboxJSONVirtualizationVirtualMachinesList(),