Skip to content

Commit

Permalink
doc: improve docs for data_source_netbox_prefixes
Browse files Browse the repository at this point in the history
Added additional description fields with information about filters and
the filter types that are currently supported.
  • Loading branch information
tagur87 committed May 16, 2023
1 parent 6492b9e commit 560b7a2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
8 changes: 4 additions & 4 deletions docs/data-sources/prefixes.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ description: |-

### Optional

- `filter` (Block Set) (see [below for nested schema](#nestedblock--filter))
- `limit` (Number) Defaults to `0`.
- `filter` (Block Set) A list of filters to apply to the API query when requesting prefixes. (see [below for nested schema](#nestedblock--filter))
- `limit` (Number) The limit of objects to return from the API lookup. Defaults to `0`.

### Read-Only

Expand All @@ -30,8 +30,8 @@ description: |-

Required:

- `name` (String)
- `value` (String)
- `name` (String) The name of the field to filter on. Supported fields are: `prefix`, `vlan_vid`, `vrf_id`, `vlan_id`, `status`, `site_id`, & `tag`.
- `value` (String) The value to pass to the specified filter.


<a id="nestedatt--prefixes"></a>
Expand Down
16 changes: 10 additions & 6 deletions netbox/data_source_netbox_prefixes.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@ func dataSourceNetboxPrefixes() *schema.Resource {
Description: `:meta:subcategory:IP Address Management (IPAM):`,
Schema: map[string]*schema.Schema{
"filter": {
Type: schema.TypeSet,
Optional: true,
Type: schema.TypeSet,
Optional: true,
Description: "A list of filters to apply to the API query when requesting prefixes.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
Type: schema.TypeString,
Required: true,
Description: "The name of the field to filter on. Supported fields are: `prefix`, `vlan_vid`, `vrf_id`, `vlan_id`, `status`, `site_id`, & `tag`.",
},
"value": {
Type: schema.TypeString,
Required: true,
Type: schema.TypeString,
Required: true,
Description: "The value to pass to the specified filter.",
},
},
},
Expand All @@ -37,6 +40,7 @@ func dataSourceNetboxPrefixes() *schema.Resource {
Optional: true,
ValidateDiagFunc: validation.ToDiagFunc(validation.IntAtLeast(1)),
Default: 0,
Description: "The limit of objects to return from the API lookup.",
},
"prefixes": {
Type: schema.TypeList,
Expand Down

0 comments on commit 560b7a2

Please sign in to comment.