Skip to content

Commit 6f5f2b9

Browse files
committed
feat: migrate from gb units to mb units
1 parent 35ff227 commit 6f5f2b9

26 files changed

+339
-130
lines changed

GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
TEST?=netbox/*.go
2-
TEST_FUNC?=TestAccNetboxRack_basic
2+
TEST_FUNC?=TestAccNetboxVirtualMachine*
33
GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
44
DOCKER_COMPOSE=docker compose
55

docs/data-sources/virtual_machines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Read-Only:
6262
- `description` (String)
6363
- `device_id` (Number)
6464
- `device_name` (String)
65-
- `disk_size_gb` (Number)
65+
- `disk_size_mb` (Number)
6666
- `local_context_data` (String)
6767
- `memory_mb` (Number)
6868
- `name` (String)

docs/resources/config_context.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ From the [official documentation](https://docs.netbox.dev/en/stable/models/extra
1818
```terraform
1919
resource "netbox_config_context" "test" {
2020
name = "%s"
21-
data = jsonencode({"testkey" = "testval"})
21+
data = jsonencode({ "testkey" = "testval" })
2222
}
2323
```
2424

docs/resources/event_rule.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ resource "netbox_webhook" "test" {
2222
}
2323
2424
resource "netbox_event_rule" "test" {
25-
name = "my-event-rule"
26-
content_types = ["dcim.site", "virtualization.cluster"]
27-
action_type = "webhook"
28-
action_object_id = netbox_webhook.test.id
29-
event_types = [
25+
name = "my-event-rule"
26+
content_types = ["dcim.site", "virtualization.cluster"]
27+
action_type = "webhook"
28+
action_object_id = netbox_webhook.test.id
29+
event_types = [
3030
"object_created",
3131
"object_updated",
3232
"object_deleted",

docs/resources/interface_template.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ From the [official documentation](https://docs.netbox.dev/en/stable/models/dcim/
1717

1818
```terraform
1919
resource "netbox_manufacturer" "test" {
20-
name = "my-manufacturer"
20+
name = "my-manufacturer"
2121
}
2222
2323
resource "netbox_device_type" "test" {
24-
model = "test-model"
25-
slug = "test-model"
26-
part_number = "test-part-number"
27-
manufacturer_id = netbox_manufacturer.test.id
24+
model = "test-model"
25+
slug = "test-model"
26+
part_number = "test-part-number"
27+
manufacturer_id = netbox_manufacturer.test.id
2828
}
2929
3030
resource "netbox_interface_template" "test" {
31-
name = "eth0"
32-
description = "eth0 description"
33-
label = "eth0 label"
34-
device_type_id = netbox_device_type.test.id
35-
type = "100base-tx"
36-
mgmt_only = true
31+
name = "eth0"
32+
description = "eth0 description"
33+
label = "eth0 label"
34+
device_type_id = netbox_device_type.test.id
35+
type = "100base-tx"
36+
mgmt_only = true
3737
}
3838
```
3939

docs/resources/virtual_disk.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ resource "netbox_virtual_machine" "base_vm" {
2929
resource "netbox_virtual_disk" "example" {
3030
name = "disk-01"
3131
description = "Main disk"
32-
size_gb = 50
32+
size_mb = 50
3333
virtual_machine_id = netbox_virtual_machine.base_vm.id
3434
}
3535
```
@@ -40,7 +40,7 @@ resource "netbox_virtual_disk" "example" {
4040
### Required
4141

4242
- `name` (String)
43-
- `size_gb` (Number)
43+
- `size_mb` (Number)
4444
- `virtual_machine_id` (Number)
4545

4646
### Optional

docs/resources/virtual_machine.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ data "netbox_cluster" "vmw_cluster_01" {
3333
resource "netbox_virtual_machine" "basic_vm" {
3434
cluster_id = data.netbox_cluster.vmw_cluster_01.id
3535
name = "myvm-2"
36-
disk_size_gb = 40
36+
disk_size_mb = 40000
3737
memory_mb = 4092
3838
vcpus = "2"
3939
}
@@ -50,7 +50,7 @@ data "netbox_tenant" "customer_a" {
5050
resource "netbox_virtual_machine" "full_vm" {
5151
cluster_id = data.netbox_cluster.vmw_cluster_01.id
5252
name = "myvm-3"
53-
disk_size_gb = 40
53+
disk_size_mb = 40000
5454
memory_mb = 4092
5555
vcpus = "2"
5656
role_id = 31 // This corresponds to the Netbox ID for a given role
@@ -76,7 +76,7 @@ resource "netbox_virtual_machine" "full_vm" {
7676
- `custom_fields` (Map of String)
7777
- `description` (String)
7878
- `device_id` (Number)
79-
- `disk_size_gb` (Number)
79+
- `disk_size_mb` (Number)
8080
- `local_context_data` (String) This is best managed through the use of `jsonencode` and a map of settings.
8181
- `memory_mb` (Number)
8282
- `platform_id` (Number)

docs/resources/vlan_group.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ description: |-
1515
```terraform
1616
#Basic VLAN Group example
1717
resource "netbox_vlan_group" "example1" {
18-
name = "example1"
19-
slug = "example1"
18+
name = "example1"
19+
slug = "example1"
2020
}
2121
2222
#Full VLAN Group example

example/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ resource "netbox_virtual_machine" "testvm" {
7777
comments = "my-test-comment"
7878
memory_mb = 1024
7979
vcpus = 4
80-
disk_size_gb = 512
80+
disk_size_mb = 512
8181
cluster_id = netbox_cluster.testcluster.id
8282
tenant_id = netbox_tenant.testtenant.id
8383
platform_id = netbox_platform.testplatform.id
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
resource "netbox_config_context" "test" {
22
name = "%s"
3-
data = jsonencode({"testkey" = "testval"})
3+
data = jsonencode({ "testkey" = "testval" })
44
}

0 commit comments

Comments
 (0)