Skip to content

Commit

Permalink
feat: add id return value
Browse files Browse the repository at this point in the history
  • Loading branch information
msmolinski committed Nov 8, 2024
1 parent c571ca4 commit 1119452
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/data-sources/vlans.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Read-Only:

- `description` (String)
- `group_id` (Number)
- `id` (Number)
- `name` (String)
- `role` (Number)
- `site` (Number)
Expand Down
7 changes: 7 additions & 0 deletions netbox/data_source_netbox_vlans.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,15 @@ func dataSourceNetboxVlans() *schema.Resource {
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeInt,
Computed: true,
Description: "The netbox ID for the VLAN.",
},
"vid": {
Type: schema.TypeInt,
Computed: true,
Description: "The 802.1q VLAN Identifier.",
},
"name": {
Type: schema.TypeString,
Expand Down Expand Up @@ -172,6 +178,7 @@ func dataSourceNetboxVlansRead(d *schema.ResourceData, m interface{}) error {
for _, v := range filteredVlans {
var mapping = make(map[string]interface{})

mapping["id"] = v.ID
mapping["vid"] = v.Vid
mapping["name"] = v.Name
mapping["description"] = v.Description
Expand Down

0 comments on commit 1119452

Please sign in to comment.