Skip to content

Commit 40246df

Browse files
sjurtffbreckle
authored andcommitted
fix: handle netbox 4.1.x
1 parent 3a0ba4f commit 40246df

20 files changed

+25
-112
lines changed

.github/workflows/ci-testing.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,10 @@ jobs:
3333
fail-fast: false
3434
matrix:
3535
netbox-version:
36-
# - v4.0.0 has mandatory tenant group
37-
- v4.0.1
38-
- v4.0.2
39-
- v4.0.3
40-
# - v4.0.4 does not exist for some reason
41-
- v4.0.5
42-
- v4.0.6
43-
- v4.0.7
44-
- v4.0.8
45-
- v4.0.9
46-
- v4.0.10
47-
- v4.0.11
36+
- v4.1.0
37+
- v4.1.1
38+
- v4.1.2
39+
- v4.1.3
4840
steps:
4941
- uses: actions/checkout@v4
5042
- name: Set up Go

GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ TEST_FUNC?=TestAccNetboxEventRule_basic
33
GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
44
DOCKER_COMPOSE=docker compose
55

6-
export NETBOX_VERSION=v4.0.11
6+
export NETBOX_VERSION=v4.1.3
77
export NETBOX_SERVER_URL=http://localhost:8001
88
export NETBOX_API_TOKEN=0123456789abcdef0123456789abcdef01234567
99
export NETBOX_TOKEN=$(NETBOX_API_TOKEN)

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ Since version [1.6.6](https://github.com/e-breuninger/terraform-provider-netbox/
1818

1919
| Netbox version | Provider version |
2020
| --------------- | ---------------- |
21-
| v4.0.0 - 4.0.11 | v3.9.0 and up |
21+
| v4.1.0 - 4.1.3 | v3.10.0 and up |
22+
| v4.0.0 - 4.0.11 | v3.9.0 - 3.9.2 |
2223
| v3.7.0 - 3.7.8 | v3.8.0 - 3.8.9 |
2324
| v3.6.0 - 3.6.9 | v3.7.0 - 3.7.7 |
2425
| v3.5.1 - 3.5.9 | v3.6.x |

docs/data-sources/vlan_group.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ data "netbox_vlan_group" "example3" {
4545

4646
- `description` (String)
4747
- `id` (String) The ID of this resource.
48-
- `max_vid` (Number)
49-
- `min_vid` (Number)
5048
- `vlan_count` (Number)
5149

5250

docs/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ Netbox often makes breaking API changes even in non-major releases. Check the ta
1616

1717
| Netbox version | Provider version |
1818
| --------------- | ---------------- |
19-
| v4.0.0 - 4.0.11 | v3.9.0 and up |
19+
| v4.1.0 - 4.1.3 | v3.10.0 and up |
20+
| v4.0.0 - 4.0.11 | v3.9.0 - 3.9.2 |
2021
| v3.7.0 - 3.7.8 | v3.8.0 - 3.8.9 |
2122
| v3.6.0 - 3.6.9 | v3.7.0 - 3.7.7 |
2223
| v3.5.1 - 3.5.9 | v3.6.x |

docs/resources/rack.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ resource "netbox_rack" "test" {
6565
- `serial` (String)
6666
- `tags` (Set of String)
6767
- `tenant_id` (Number)
68-
- `type` (String) Valid values are `2-post-frame`, `4-post-frame`, `4-post-cabinet`, `wall-frame`, `wall-frame-vertical`, `wall-cabinet` and `wall-cabinet-vertical`.
6968
- `weight` (Number)
7069
- `weight_unit` (String) Valid values are `kg`, `g`, `lb` and `oz`. Required when `weight` and `max_weight` is set.
7170

docs/resources/vlan_group.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,12 @@ description: |-
1717
resource "netbox_vlan_group" "example1" {
1818
name = "example1"
1919
slug = "example1"
20-
min_vid = 1
21-
max_vid = 4094
2220
}
2321
2422
#Full VLAN Group example
2523
resource "netbox_vlan_group" "example2" {
2624
name = "Second Example"
2725
slug = "example2"
28-
min_vid = 1
29-
max_vid = 4094
3026
scope_type = "dcim.site"
3127
scope_id = netbox_site.example.id
3228
description = "Second Example VLAN Group"
@@ -39,8 +35,6 @@ resource "netbox_vlan_group" "example2" {
3935

4036
### Required
4137

42-
- `max_vid` (Number)
43-
- `min_vid` (Number)
4438
- `name` (String)
4539
- `slug` (String)
4640

examples/resources/netbox_vlan_group/resource.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22
resource "netbox_vlan_group" "example1" {
33
name = "example1"
44
slug = "example1"
5-
min_vid = 1
6-
max_vid = 4094
75
}
86

97
#Full VLAN Group example
108
resource "netbox_vlan_group" "example2" {
119
name = "Second Example"
1210
slug = "example2"
13-
min_vid = 1
14-
max_vid = 4094
1511
scope_type = "dcim.site"
1612
scope_id = netbox_site.example.id
1713
description = "Second Example VLAN Group"

netbox/data_source_netbox_virtual_machines.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func dataSourceNetboxVirtualMachineRead(d *schema.ResourceData, m interface{}) e
244244
mapping["custom_fields"] = v.CustomFields
245245
}
246246
if v.Disk != nil {
247-
mapping["disk_size_gb"] = *v.Disk
247+
mapping["disk_size_gb"] = *v.Disk / 1000
248248
}
249249
if v.LocalContextData != nil {
250250
if localContextData, err := json.Marshal(v.LocalContextData); err == nil {

netbox/data_source_netbox_vlan_group.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ func dataSourceNetboxVlanGroup() *schema.Resource {
3838
Optional: true,
3939
RequiredWith: []string{"scope_type"},
4040
},
41-
"min_vid": {
42-
Type: schema.TypeInt,
43-
Computed: true,
44-
},
45-
"max_vid": {
46-
Type: schema.TypeInt,
47-
Computed: true,
48-
},
4941
"vlan_count": {
5042
Type: schema.TypeInt,
5143
Computed: true,
@@ -92,8 +84,6 @@ func dataSourceNetboxVlanGroupRead(d *schema.ResourceData, m interface{}) error
9284
d.SetId(strconv.FormatInt(result.ID, 10))
9385
d.Set("name", result.Name)
9486
d.Set("slug", result.Slug)
95-
d.Set("min_vid", result.MinVid)
96-
d.Set("max_vid", result.MaxVid)
9787
d.Set("vlan_count", result.VlanCount)
9888
d.Set("description", result.Description)
9989
return nil

0 commit comments

Comments
 (0)