Skip to content

Commit

Permalink
feat: Add ability to return json objects of all endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
smutel committed Jan 1, 2021
1 parent f2fd13a commit dceb7f2
Show file tree
Hide file tree
Showing 140 changed files with 4,325 additions and 16 deletions.
9 changes: 5 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand 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:
Expand All @@ -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,
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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 \<field\>.results.connected_endpoint of type string
- Currently causes issues for Circuits/CircuitTerminations, DCIM/Cables, DCIM/Interfaces, and Extras/ObjectChanges
22 changes: 22 additions & 0 deletions docs/data-sources/json_circuits_circuit_terminations_list.md
Original file line number Diff line number Diff line change
@@ -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.

22 changes: 22 additions & 0 deletions docs/data-sources/json_circuits_circuit_types_list.md
Original file line number Diff line number Diff line change
@@ -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.

22 changes: 22 additions & 0 deletions docs/data-sources/json_circuits_circuits_list.md
Original file line number Diff line number Diff line change
@@ -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.

22 changes: 22 additions & 0 deletions docs/data-sources/json_circuits_providers_list.md
Original file line number Diff line number Diff line change
@@ -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.

22 changes: 22 additions & 0 deletions docs/data-sources/json_dcim_cables_list.md
Original file line number Diff line number Diff line change
@@ -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.

22 changes: 22 additions & 0 deletions docs/data-sources/json_dcim_console_connections_list.md
Original file line number Diff line number Diff line change
@@ -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.

22 changes: 22 additions & 0 deletions docs/data-sources/json_dcim_console_port_templates_list.md
Original file line number Diff line number Diff line change
@@ -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.

22 changes: 22 additions & 0 deletions docs/data-sources/json_dcim_console_ports_list.md
Original file line number Diff line number Diff line change
@@ -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.

22 changes: 22 additions & 0 deletions docs/data-sources/json_dcim_console_server_port_templates_list.md
Original file line number Diff line number Diff line change
@@ -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.

22 changes: 22 additions & 0 deletions docs/data-sources/json_dcim_console_server_ports_list.md
Original file line number Diff line number Diff line change
@@ -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.

22 changes: 22 additions & 0 deletions docs/data-sources/json_dcim_device_bay_templates_list.md
Original file line number Diff line number Diff line change
@@ -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.

22 changes: 22 additions & 0 deletions docs/data-sources/json_dcim_device_bays_list.md
Original file line number Diff line number Diff line change
@@ -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.

22 changes: 22 additions & 0 deletions docs/data-sources/json_dcim_device_roles_list.md
Original file line number Diff line number Diff line change
@@ -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.

22 changes: 22 additions & 0 deletions docs/data-sources/json_dcim_device_types_list.md
Original file line number Diff line number Diff line change
@@ -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.

Loading

0 comments on commit dceb7f2

Please sign in to comment.