-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enh: Update JSON data/resource with Netbox 3.1
- Loading branch information
Showing
93 changed files
with
2,922 additions
and
2,202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# netbox\_json\_ipam\_asns\_list Data Source | ||
|
||
Get json output from the ipam_asns_list Netbox endpoint | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "netbox_json_ipam_asns_list" "test" { | ||
limit = 0 | ||
} | ||
output "example" { | ||
value = jsondecode(data.netbox_json_ipam_asns_list.test.json) | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* ``limit`` (Optional). The max number of returned results. If 0 is specified, all records will be returned. | ||
|
||
## 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. | ||
|
24 changes: 24 additions & 0 deletions
24
docs/data-sources/json_ipam_fhrp_group_assignments_list.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# netbox\_json\_ipam\_fhrp\_group\_assignments\_list Data Source | ||
|
||
Get json output from the ipam_fhrp_group_assignments_list Netbox endpoint | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "netbox_json_ipam_fhrp_group_assignments_list" "test" { | ||
limit = 0 | ||
} | ||
output "example" { | ||
value = jsondecode(data.netbox_json_ipam_fhrp_group_assignments_list.test.json) | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* ``limit`` (Optional). The max number of returned results. If 0 is specified, all records will be returned. | ||
|
||
## 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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# netbox\_json\_ipam\_fhrp\_groups\_list Data Source | ||
|
||
Get json output from the ipam_fhrp_groups_list Netbox endpoint | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "netbox_json_ipam_fhrp_groups_list" "test" { | ||
limit = 0 | ||
} | ||
output "example" { | ||
value = jsondecode(data.netbox_json_ipam_fhrp_groups_list.test.json) | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* ``limit`` (Optional). The max number of returned results. If 0 is specified, all records will be returned. | ||
|
||
## 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. | ||
|
24 changes: 24 additions & 0 deletions
24
docs/data-sources/json_tenancy_contact_assignments_list.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# netbox\_json\_tenancy\_contact\_assignments\_list Data Source | ||
|
||
Get json output from the tenancy_contact_assignments_list Netbox endpoint | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "netbox_json_tenancy_contact_assignments_list" "test" { | ||
limit = 0 | ||
} | ||
output "example" { | ||
value = jsondecode(data.netbox_json_tenancy_contact_assignments_list.test.json) | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* ``limit`` (Optional). The max number of returned results. If 0 is specified, all records will be returned. | ||
|
||
## 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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# netbox\_json\_tenancy\_contact\_groups\_list Data Source | ||
|
||
Get json output from the tenancy_contact_groups_list Netbox endpoint | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "netbox_json_tenancy_contact_groups_list" "test" { | ||
limit = 0 | ||
} | ||
output "example" { | ||
value = jsondecode(data.netbox_json_tenancy_contact_groups_list.test.json) | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* ``limit`` (Optional). The max number of returned results. If 0 is specified, all records will be returned. | ||
|
||
## 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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# netbox\_json\_tenancy\_contact\_roles\_list Data Source | ||
|
||
Get json output from the tenancy_contact_roles_list Netbox endpoint | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "netbox_json_tenancy_contact_roles_list" "test" { | ||
limit = 0 | ||
} | ||
output "example" { | ||
value = jsondecode(data.netbox_json_tenancy_contact_roles_list.test.json) | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* ``limit`` (Optional). The max number of returned results. If 0 is specified, all records will be returned. | ||
|
||
## 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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# netbox\_json\_tenancy\_contacts\_list Data Source | ||
|
||
Get json output from the tenancy_contacts_list Netbox endpoint | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "netbox_json_tenancy_contacts_list" "test" { | ||
limit = 0 | ||
} | ||
output "example" { | ||
value = jsondecode(data.netbox_json_tenancy_contacts_list.test.json) | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* ``limit`` (Optional). The max number of returned results. If 0 is specified, all records will be returned. | ||
|
||
## 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. | ||
|
24 changes: 24 additions & 0 deletions
24
docs/data-sources/json_wireless_wireless_lan_groups_list.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# netbox\_json\_wireless\_wireless\_lan\_groups\_list Data Source | ||
|
||
Get json output from the wireless_wireless_lan_groups_list Netbox endpoint | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "netbox_json_wireless_wireless_lan_groups_list" "test" { | ||
limit = 0 | ||
} | ||
output "example" { | ||
value = jsondecode(data.netbox_json_wireless_wireless_lan_groups_list.test.json) | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* ``limit`` (Optional). The max number of returned results. If 0 is specified, all records will be returned. | ||
|
||
## 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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# netbox\_json\_wireless\_wireless\_lans\_list Data Source | ||
|
||
Get json output from the wireless_wireless_lans_list Netbox endpoint | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "netbox_json_wireless_wireless_lans_list" "test" { | ||
limit = 0 | ||
} | ||
output "example" { | ||
value = jsondecode(data.netbox_json_wireless_wireless_lans_list.test.json) | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* ``limit`` (Optional). The max number of returned results. If 0 is specified, all records will be returned. | ||
|
||
## 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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# netbox\_json\_wireless\_wireless\_links\_list Data Source | ||
|
||
Get json output from the wireless_wireless_links_list Netbox endpoint | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "netbox_json_wireless_wireless_links_list" "test" { | ||
limit = 0 | ||
} | ||
output "example" { | ||
value = jsondecode(data.netbox_json_wireless_wireless_links_list.test.json) | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
* ``limit`` (Optional). The max number of returned results. If 0 is specified, all records will be returned. | ||
|
||
## 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. | ||
|
62 changes: 31 additions & 31 deletions
62
netbox/data_netbox_json_circuits_circuit_terminations_list.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
package netbox | ||
|
||
import ( | ||
"encoding/json" | ||
"encoding/json" | ||
|
||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
netboxclient "github.com/smutel/go-netbox/netbox/client" | ||
"github.com/smutel/go-netbox/netbox/client/circuits" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
netboxclient "github.com/smutel/go-netbox/netbox/client" | ||
"github.com/smutel/go-netbox/netbox/client/circuits" | ||
) | ||
|
||
func dataNetboxJSONCircuitsCircuitTerminationsList() *schema.Resource { | ||
return &schema.Resource{ | ||
Read: dataNetboxJSONCircuitsCircuitTerminationsListRead, | ||
|
||
Schema: map[string]*schema.Schema{ | ||
"limit": { | ||
Type: schema.TypeInt, | ||
Optional: true, | ||
Default: 0, | ||
}, | ||
"json": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
}, | ||
} | ||
return &schema.Resource{ | ||
Read: dataNetboxJSONCircuitsCircuitTerminationsListRead, | ||
|
||
Schema: map[string]*schema.Schema{ | ||
"limit": { | ||
Type: schema.TypeInt, | ||
Optional: true, | ||
Default: 0, | ||
}, | ||
"json": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
}, | ||
}, | ||
} | ||
} | ||
|
||
func dataNetboxJSONCircuitsCircuitTerminationsListRead(d *schema.ResourceData, m interface{}) error { | ||
client := m.(*netboxclient.NetBoxAPI) | ||
client := m.(*netboxclient.NetBoxAPI) | ||
|
||
params := circuits.NewCircuitsCircuitTerminationsListParams() | ||
limit := int64(d.Get("limit").(int)) | ||
params.Limit = &limit | ||
params := circuits.NewCircuitsCircuitTerminationsListParams() | ||
limit := int64(d.Get("limit").(int)) | ||
params.Limit = &limit | ||
|
||
list, err := client.Circuits.CircuitsCircuitTerminationsList(params, nil) | ||
if err != nil { | ||
return err | ||
} | ||
list, err := client.Circuits.CircuitsCircuitTerminationsList(params, nil) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
j, _ := json.Marshal(list.Payload.Results) | ||
j, _ := json.Marshal(list.Payload.Results) | ||
|
||
d.Set("json", string(j)) | ||
d.SetId("NetboxJSONCircuitsCircuitTerminationsList") | ||
d.Set("json", string(j)) | ||
d.SetId("NetboxJSONCircuitsCircuitTerminationsList") | ||
|
||
return nil | ||
return nil | ||
} |
Oops, something went wrong.